Skip to content

Commit f2777c5

Browse files
committed
Updates
1 parent 8ceea71 commit f2777c5

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

src/client/chat/listPackagesTool.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,30 @@ export class ListPythonPackagesTool implements LanguageModelTool<IResourceRefere
9696
const resourcePath = resolveFilePath(options.input.resourcePath);
9797
const envName = await raceCancellationError(getEnvDisplayName(this.discovery, resourcePath, this.api), token);
9898
return {
99-
invocationMessage: envName ? l10n.t('Listing packages in {0}', envName) : l10n.t('Fetching Python environment information'),
99+
invocationMessage: envName
100+
? l10n.t('Listing packages in {0}', envName)
101+
: l10n.t('Fetching Python environment information'),
100102
};
101103
}
102104
}
103105

104-
105-
async function listPipPackages(execFactory: IPythonExecutionFactory, resource: Uri | undefined): Promise<[packageName:string, version:string][]> {
106+
async function listPipPackages(
107+
execFactory: IPythonExecutionFactory,
108+
resource: Uri | undefined,
109+
): Promise<[string, string][]> {
106110
// Add option --format to subcommand list of pip cache, with abspath choice to output the full path of a wheel file. (#8355)
107111
// Added in 202. Thats almost 5 years ago. When Python 3.8 was released.
108112
const exec = await execFactory.createActivatedEnvironment({ allowEnvironmentFetchExceptions: true, resource });
109113
const output = await exec.execModule('pip', ['list'], { throwOnStdErr: false, encoding: 'utf8' });
110-
return parsePipList(output.stdout).map((pkg) => [pkg.name, pkg.version] );
114+
return parsePipList(output.stdout).map((pkg) => [pkg.name, pkg.version]);
111115
}
112116

113117
async function listCondaPackages(
114118
execFactory: IPythonExecutionFactory,
115119
env: ResolvedEnvironment,
116120
resource: Uri | undefined,
117121
processService: IProcessService,
118-
): Promise<[packageName:string, version:string][]> {
122+
): Promise<[string, string][]> {
119123
const conda = await Conda.getConda();
120124
if (!conda) {
121125
traceError('Conda is not installed, falling back to pip packages');

src/test/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function updateSetting(
6262
configTarget: ConfigurationTarget,
6363
) {
6464
const vscode = require('vscode') as typeof import('vscode');
65-
const settings = vscode.workspace.getConfiguration('python', { uri: resource, languageId: 'python' } || null);
65+
const settings = vscode.workspace.getConfiguration('python', { uri: resource, languageId: 'python' });
6666
const currentValue = settings.inspect(setting);
6767
if (
6868
currentValue !== undefined &&

src/test/interpreters/pythonPathUpdaterFactory.unit.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ suite('Python Path Settings Updater', () => {
1717
serviceContainer = TypeMoq.Mock.ofType<IServiceContainer>();
1818
workspaceService = TypeMoq.Mock.ofType<IWorkspaceService>();
1919
interpreterPathService = TypeMoq.Mock.ofType<IInterpreterPathService>();
20+
experimentsManager = TypeMoq.Mock.ofType<IExperimentService>();
2021
serviceContainer
2122
.setup((c) => c.get(TypeMoq.It.isValue(IWorkspaceService)))
2223
.returns(() => workspaceService.object);

src/test/testing/testController/testCancellationRunAdapters.unit.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ suite('Execution Flow Run Adapters', () => {
3636
let useEnvExtensionStub: sinon.SinonStub;
3737

3838
setup(() => {
39+
mockProc = {} as MockChildProcess;
3940
useEnvExtensionStub = sinon.stub(extapi, 'useEnvExtension');
4041
useEnvExtensionStub.returns(false);
4142
// general vars

0 commit comments

Comments
 (0)