6
6
7
7
import { inject , injectable , named } from 'inversify' ;
8
8
import { dirname } from 'path' ;
9
- import { CancellationToken , Disposable , Event , Extension , Memento , Uri } from 'vscode' ;
10
- import * as lsp from 'vscode-languageserver-protocol' ;
9
+ import { CancellationToken , Event , Extension , Memento , Uri } from 'vscode' ;
11
10
import type { SemVer } from 'semver' ;
12
- import { ILanguageServerCache , ILanguageServerConnection } from '../activation/types' ;
13
11
import { IWorkspaceService } from '../common/application/types' ;
14
12
import { JUPYTER_EXTENSION_ID } from '../common/constants' ;
15
13
import { InterpreterUri , ModuleInstallFlags } from '../common/installer/types' ;
@@ -23,7 +21,6 @@ import {
23
21
ProductInstallStatus ,
24
22
Resource ,
25
23
} from '../common/types' ;
26
- import { isResource } from '../common/utils/misc' ;
27
24
import { getDebugpyPackagePath } from '../debugger/extension/adapter/remoteLaunchers' ;
28
25
import { IEnvironmentActivationService } from '../interpreter/activation/types' ;
29
26
import { IInterpreterQuickPickItem , IInterpreterSelector } from '../interpreter/configuration/types' ;
@@ -38,11 +35,6 @@ import {
38
35
import { PythonEnvironment } from '../pythonEnvironments/info' ;
39
36
import { IDataViewerDataProvider , IJupyterUriProvider } from './types' ;
40
37
41
- interface ILanguageServer extends Disposable {
42
- readonly connection : ILanguageServerConnection ;
43
- readonly capabilities : lsp . ServerCapabilities ;
44
- }
45
-
46
38
/**
47
39
* This allows Python extension to update Product enum without breaking Jupyter.
48
40
* I.e. we have a strict contract, else using numbers (in enums) is bound to break across products.
@@ -139,11 +131,6 @@ type PythonApiForJupyterExtension = {
139
131
* Retrieve interpreter path selected for Jupyter server from Python memento storage
140
132
*/
141
133
getInterpreterPathSelectedForJupyterServer ( ) : string | undefined ;
142
- /**
143
- * Returns a ILanguageServer that can be used for communicating with a language server process.
144
- * @param resource file that determines which connection to return
145
- */
146
- getLanguageServer ( resource ?: InterpreterUri ) : Promise < ILanguageServer | undefined > ;
147
134
/**
148
135
* Registers a visibility filter for the interpreter status bar.
149
136
*/
@@ -207,7 +194,6 @@ export class JupyterExtensionIntegration {
207
194
@inject ( IInterpreterSelector ) private readonly interpreterSelector : IInterpreterSelector ,
208
195
@inject ( IInstaller ) private readonly installer : IInstaller ,
209
196
@inject ( IEnvironmentActivationService ) private readonly envActivation : IEnvironmentActivationService ,
210
- @inject ( ILanguageServerCache ) private readonly languageServerCache : ILanguageServerCache ,
211
197
@inject ( IMemento ) @named ( GLOBAL_MEMENTO ) private globalState : Memento ,
212
198
@inject ( IInterpreterDisplay ) private interpreterDisplay : IInterpreterDisplay ,
213
199
@inject ( IComponentAdapter ) private pyenvs : IComponentAdapter ,
@@ -272,21 +258,6 @@ export class JupyterExtensionIntegration {
272
258
getDebuggerPath : async ( ) => dirname ( getDebugpyPackagePath ( ) ) ,
273
259
getInterpreterPathSelectedForJupyterServer : ( ) =>
274
260
this . globalState . get < string | undefined > ( 'INTERPRETER_PATH_SELECTED_FOR_JUPYTER_SERVER' ) ,
275
- getLanguageServer : async ( r ) => {
276
- const resource = isResource ( r ) ? r : undefined ;
277
- const interpreter = ! isResource ( r ) ? r : undefined ;
278
- const client = await this . languageServerCache . get ( resource , interpreter ) ;
279
-
280
- // Some language servers don't support the connection yet.
281
- if ( client && client . connection && client . capabilities ) {
282
- return {
283
- connection : client . connection ,
284
- capabilities : client . capabilities ,
285
- dispose : client . dispose ,
286
- } ;
287
- }
288
- return undefined ;
289
- } ,
290
261
registerInterpreterStatusFilter : this . interpreterDisplay . registerVisibilityFilter . bind (
291
262
this . interpreterDisplay ,
292
263
) ,
0 commit comments