|
1 | 1 | 'use strict'; |
2 | 2 |
|
3 | 3 | import * as vscode from 'vscode'; |
| 4 | +import { JediFactory } from './languageServices/jediProxyFactory'; |
4 | 5 | import { PythonCompletionItemProvider } from './providers/completionProvider'; |
5 | 6 | import { PythonHoverProvider } from './providers/hoverProvider'; |
6 | 7 | import { PythonDefinitionProvider } from './providers/definitionProvider'; |
@@ -68,7 +69,8 @@ export async function activate(context: vscode.ExtensionContext) { |
68 | 69 | context.subscriptions.push(activateUpdateSparkLibraryProvider()); |
69 | 70 | activateSimplePythonRefactorProvider(context, formatOutChannel); |
70 | 71 | context.subscriptions.push(activateFormatOnSaveProvider(PYTHON, formatOutChannel)); |
71 | | - context.subscriptions.push(activateGoToObjectDefinitionProvider(context)); |
| 72 | + const jediFactory = new JediFactory(context.asAbsolutePath('.')); |
| 73 | + context.subscriptions.push(...activateGoToObjectDefinitionProvider(jediFactory)); |
72 | 74 |
|
73 | 75 | context.subscriptions.push(vscode.commands.registerCommand(Commands.Start_REPL, () => { |
74 | 76 | getPathFromPythonCommand(["-c", "import sys;print(sys.executable)"]).catch(() => { |
@@ -99,19 +101,19 @@ export async function activate(context: vscode.ExtensionContext) { |
99 | 101 | ] |
100 | 102 | }); |
101 | 103 |
|
| 104 | + context.subscriptions.push(jediFactory); |
102 | 105 | context.subscriptions.push(vscode.languages.registerRenameProvider(PYTHON, new PythonRenameProvider(formatOutChannel))); |
103 | | - const definitionProvider = new PythonDefinitionProvider(context); |
104 | | - const jediProx = definitionProvider.JediProxy; |
| 106 | + const definitionProvider = new PythonDefinitionProvider(jediFactory); |
105 | 107 | context.subscriptions.push(vscode.languages.registerDefinitionProvider(PYTHON, definitionProvider)); |
106 | | - context.subscriptions.push(vscode.languages.registerHoverProvider(PYTHON, new PythonHoverProvider(context, jediProx))); |
107 | | - context.subscriptions.push(vscode.languages.registerReferenceProvider(PYTHON, new PythonReferenceProvider(context, jediProx))); |
108 | | - context.subscriptions.push(vscode.languages.registerCompletionItemProvider(PYTHON, new PythonCompletionItemProvider(context, jediProx), '.')); |
| 108 | + context.subscriptions.push(vscode.languages.registerHoverProvider(PYTHON, new PythonHoverProvider(jediFactory))); |
| 109 | + context.subscriptions.push(vscode.languages.registerReferenceProvider(PYTHON, new PythonReferenceProvider(jediFactory))); |
| 110 | + context.subscriptions.push(vscode.languages.registerCompletionItemProvider(PYTHON, new PythonCompletionItemProvider(jediFactory), '.')); |
109 | 111 | context.subscriptions.push(vscode.languages.registerCodeLensProvider(PYTHON, new ShebangCodeLensProvider())) |
110 | 112 |
|
111 | | - const symbolProvider = new PythonSymbolProvider(context, jediProx); |
| 113 | + const symbolProvider = new PythonSymbolProvider(jediFactory); |
112 | 114 | context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider(PYTHON, symbolProvider)); |
113 | 115 | if (pythonSettings.devOptions.indexOf('DISABLE_SIGNATURE') === -1) { |
114 | | - context.subscriptions.push(vscode.languages.registerSignatureHelpProvider(PYTHON, new PythonSignatureProvider(context, jediProx), '(', ',')); |
| 116 | + context.subscriptions.push(vscode.languages.registerSignatureHelpProvider(PYTHON, new PythonSignatureProvider(jediFactory), '(', ',')); |
115 | 117 | } |
116 | 118 | if (pythonSettings.formatting.provider !== 'none') { |
117 | 119 | const formatProvider = new PythonFormattingEditProvider(context, formatOutChannel); |
|
0 commit comments