1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
// Copyright (c) Microsoft Corporation. All rights reserved.
2
3
// Licensed under the MIT License.
3
4
@@ -16,14 +17,15 @@ import { getDebugpyLauncherArgs, getDebugpyPackagePath } from './debugger/extens
16
17
import { IInterpreterService } from './interpreter/contracts' ;
17
18
import { IServiceContainer , IServiceManager } from './ioc/types' ;
18
19
import { JupyterExtensionIntegration } from './jupyter/jupyterIntegration' ;
20
+ import { IDataViewerDataProvider , IJupyterUriProvider } from './jupyter/types' ;
19
21
import { traceError } from './logging' ;
20
22
import { IDiscoveryAPI } from './pythonEnvironments/base/locator' ;
21
23
import { buildEnvironmentApi } from './environmentApi' ;
22
24
import { ApiForPylance } from './pylanceApi' ;
23
25
import { getTelemetryReporter } from './telemetry' ;
24
26
25
27
export function buildApi (
26
- ready : Promise < any > ,
28
+ ready : Promise < void > ,
27
29
serviceManager : IServiceManager ,
28
30
serviceContainer : IServiceContainer ,
29
31
discoveryApi : IDiscoveryAPI ,
@@ -89,7 +91,7 @@ export function buildApi(
89
91
async getRemoteLauncherCommand (
90
92
host : string ,
91
93
port : number ,
92
- waitUntilDebuggerAttaches : boolean = true ,
94
+ waitUntilDebuggerAttaches = true ,
93
95
) : Promise < string [ ] > {
94
96
return getDebugpyLauncherArgs ( {
95
97
host,
@@ -104,7 +106,7 @@ export function buildApi(
104
106
settings : {
105
107
onDidChangeExecutionDetails : interpreterService . onDidChangeInterpreterConfiguration ,
106
108
getExecutionDetails ( resource ?: Resource ) {
107
- const pythonPath = configurationService . getSettings ( resource ) . pythonPath ;
109
+ const { pythonPath } = configurationService . getSettings ( resource ) ;
108
110
// If pythonPath equals an empty string, no interpreter is set.
109
111
return { execCommand : pythonPath === '' ? undefined : [ pythonPath ] } ;
110
112
} ,
@@ -114,10 +116,10 @@ export function buildApi(
114
116
datascience : {
115
117
registerRemoteServerProvider : jupyterIntegration
116
118
? jupyterIntegration . registerRemoteServerProvider . bind ( jupyterIntegration )
117
- : ( noop as any ) ,
119
+ : ( ( noop as unknown ) as ( serverProvider : IJupyterUriProvider ) => void ) ,
118
120
showDataViewer : jupyterIntegration
119
121
? jupyterIntegration . showDataViewer . bind ( jupyterIntegration )
120
- : ( noop as any ) ,
122
+ : ( ( noop as unknown ) as ( dataProvider : IDataViewerDataProvider , title : string ) => Promise < void > ) ,
121
123
} ,
122
124
pylance : {
123
125
createClient : ( ...args : any [ ] ) : BaseLanguageClient => {
0 commit comments