11import * as path from 'path' ;
2- import { commands , ConfigurationTarget , QuickPickItem , window } from 'vscode' ;
2+ import { commands , ConfigurationTarget , window } from 'vscode' ;
33import { Common , EnvManagerSearchStrings } from '../../common/localize' ;
44import { traceLog } from '../../common/logging' ;
55import { getWorkspacePersistentState } from '../../common/persistentState' ;
@@ -8,54 +8,23 @@ import { getConfiguration, getWorkspaceFolders } from '../../common/workspace.ap
88import { EnvironmentManagers } from '../../internal.api' ;
99import { NativePythonFinder } from '../../managers/common/nativePythonFinder' ;
1010
11- type SearchAction = 'settings' | 'fullSearch' ;
12-
13- interface SearchActionItem extends QuickPickItem {
14- action : SearchAction ;
15- }
16-
1711const SUPPRESS_SAVE_PROMPT_KEY = 'python-envs.search.fullWorkspace.suppressSavePrompt' ;
1812
1913/**
20- * Handles the "Manage Environment Search" action from the Environment Managers view.
21- * Presents a quick pick menu allowing users to either adjust search path settings
22- * or perform a full workspace search for Python environments.
14+ * Handles the Environment Managers view search action.
15+ * Performs a full workspace search for Python environments.
2316 */
2417export async function handleEnvManagerSearchAction (
2518 envManagers : EnvironmentManagers ,
2619 nativeFinder : NativePythonFinder ,
2720) : Promise < void > {
28- const items : SearchActionItem [ ] = [
29- {
30- label : EnvManagerSearchStrings . adjustSearchPaths ,
31- description : EnvManagerSearchStrings . adjustSearchPathsDescription ,
32- action : 'settings' ,
33- } ,
34- {
35- label : EnvManagerSearchStrings . fullWorkspaceSearch ,
36- description : EnvManagerSearchStrings . fullWorkspaceSearchDescription ,
37- action : 'fullSearch' ,
38- } ,
39- ] ;
40-
41- const selection = await window . showQuickPick ( items , {
42- placeHolder : EnvManagerSearchStrings . selectAction ,
43- matchOnDescription : true ,
44- } ) ;
45-
46- if ( ! selection ) {
47- return ;
48- }
49-
50- if ( selection . action === 'settings' ) {
51- await openSearchSettings ( ) ;
52- return ;
53- }
54-
5521 await runFullWorkspaceSearch ( envManagers , nativeFinder ) ;
5622}
5723
58- async function openSearchSettings ( ) : Promise < void > {
24+ /**
25+ * Opens environment search settings.
26+ */
27+ export async function openSearchSettings ( ) : Promise < void > {
5928 await commands . executeCommand ( 'workbench.action.openSettings' , '@ext:ms-python.vscode-python-envs "search path"' ) ;
6029}
6130
@@ -64,7 +33,7 @@ async function openSearchSettings(): Promise<void> {
6433 * Uses the `./**` glob pattern to search the entire workspace tree.
6534 * After the search completes, prompts the user to save the search pattern to settings.
6635 */
67- async function runFullWorkspaceSearch (
36+ export async function runFullWorkspaceSearch (
6837 envManagers : EnvironmentManagers ,
6938 nativeFinder : NativePythonFinder ,
7039) : Promise < void > {
0 commit comments