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
1 change: 1 addition & 0 deletions news/2 Fixes/1476.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure python environment activation works as expected within a multi-root workspace.
2 changes: 1 addition & 1 deletion src/client/common/installer/moduleInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export abstract class ModuleInstaller {
constructor(protected serviceContainer: IServiceContainer) { }
public async installModule(name: string, resource?: vscode.Uri): Promise<void> {
const executionInfo = await this.getExecutionInfo(name, resource);
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory).getTerminalService();
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory).getTerminalService(resource);

if (executionInfo.moduleName) {
const settings = PythonSettings.getInstance(resource);
Expand Down
4 changes: 2 additions & 2 deletions src/client/common/installer/pipEnvInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class PipEnvInstaller implements IModuleInstaller {
this.pipenv = this.serviceContainer.get<IInterpreterLocatorService>(IInterpreterLocatorService, PIPENV_SERVICE);
}

public installModule(name: string): Promise<void> {
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory).getTerminalService();
public installModule(name: string, resource?: Uri): Promise<void> {
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory).getTerminalService(resource);
return terminalService.sendCommand(pipenvName, ['install', name, '--dev']);
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/common/installer/productInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class CTagsInstaller extends BaseInstaller {
this.outputChannel.appendLine('Option 3: Extract to any folder and define that path in the python.workspaceSymbols.ctagsPath setting of your user settings file (settings.json).');
this.outputChannel.show();
} else {
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory).getTerminalService();
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory).getTerminalService(resource);
const logger = this.serviceContainer.get<ILogger>(ILogger);
terminalService.sendCommand(CTagsInsllationScript, [])
.catch(logger.logError.bind(logger, `Failed to install ctags. Script sent '${CTagsInsllationScript}'.`));
Expand Down
5 changes: 4 additions & 1 deletion src/client/linters/prospector.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as path from 'path';
import { CancellationToken, OutputChannel, TextDocument } from 'vscode';
import '../common/extensions';
import { Product } from '../common/types';
Expand Down Expand Up @@ -28,7 +29,9 @@ export class Prospector extends BaseLinter {
}

protected async runLinter(document: TextDocument, cancellation: CancellationToken): Promise<ILintMessage[]> {
return this.run(['--absolute-paths', '--output-format=json', document.uri.fsPath], document, cancellation);
const cwd = this.getWorkspaceRootPath(document);
const relativePath = path.relative(cwd, document.uri.fsPath);
return this.run(['--absolute-paths', '--output-format=json', relativePath], document, cancellation);
}
protected async parseMessages(output: string, document: TextDocument, token: CancellationToken, regEx: string) {
let parsedData: IProspectorResponse;
Expand Down
Loading