Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions build/ci/templates/test_phases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,22 @@ steps:
inputs:
targets: 'prePublishNonBundle'

# Run the `hygiene` gulp task to ensure that the added code adheres to the
# code standards we are trying to maintain.
# Make sure the project compiles (with strict checks enabled).
# Example command line (windows pwsh):
# > gulp hygiene
# > npx tsc -p ./
- bash: |
npx tsc -p ./
displayName: 'make sure project compiles'
condition: and(succeeded(), contains(variables['TestsToRun'], 'runHygiene'))

# Run tslint on the project source to ensure that the added code adheres
# to the # code standards we are trying to maintain.
# Example command line (windows pwsh):
# > npx tslint ./src/**/*.ts{,x}
- bash: |
npx tslint ./src/**/*.ts{,x}
#npx gulp hygiene
displayName: 'gulp code hygiene'
displayName: 'code hygiene'
condition: and(succeeded(), contains(variables['TestsToRun'], 'runHygiene'))

# Enable test coverage reporting for all subsequent tests (typescript-based)
Expand Down
9 changes: 7 additions & 2 deletions src/client/activation/languageServer/analysisOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ export class LanguageServerAnalysisOptions implements ILanguageServerAnalysisOpt
const properties: Record<string, {}> = {};

const interpreterInfo = await this.interpreterService.getActiveInterpreter(this.resource);
if (!interpreterInfo) {
// tslint:disable-next-line:no-suspicious-comment
// TODO: How do we handle this? It is pretty unlikely...
throw Error('did not find an active interpreter');
}

// tslint:disable-next-line:no-string-literal
properties['InterpreterPath'] = interpreterInfo.path;
Expand All @@ -87,8 +92,8 @@ export class LanguageServerAnalysisOptions implements ILanguageServerAnalysisOpt
properties['DatabasePath'] = path.join(this.context.extensionPath, this.languageServerFolder);

const vars = await this.envVarsProvider.getEnvironmentVariables();
this.envPythonPath = vars.PYTHONPATH;
if (this.envPythonPath && this.envPythonPath.length > 0) {
this.envPythonPath = vars.PYTHONPATH || '';
if (this.envPythonPath !== '') {
const paths = this.envPythonPath.split(this.pathUtils.delimiter).filter(item => item.trim().length > 0);
searchPaths.push(...paths);
}
Expand Down
6 changes: 4 additions & 2 deletions src/client/activation/languageServer/languageClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ export class BaseLanguageClientFactory implements ILanguageClientFactory {

private async getEnvVars(resource: Resource): Promise<NodeJS.ProcessEnv> {
const envVars = await this.environmentActivationService.getActivatedEnvironmentVariables(resource);
const hasEnvVars = envVars && Object.keys(envVars).length > 0;
return hasEnvVars ? envVars : this.envVarsProvider.getEnvironmentVariables(resource);
if (envVars && Object.keys(envVars).length > 0) {
return envVars;
}
return this.envVarsProvider.getEnvironmentVariables(resource);
}
}

Expand Down