forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
69 lines (62 loc) · 2.15 KB
/
types.ts
File metadata and controls
69 lines (62 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { Uri } from 'vscode';
import { PythonInterpreter } from '../contracts';
export const IPythonInPathCommandProvider = Symbol('IPythonInPathCommandProvider');
export interface IPythonInPathCommandProvider {
getCommands(): { command: string; args?: string[] }[];
}
export const IPipEnvServiceHelper = Symbol('IPipEnvServiceHelper');
export interface IPipEnvServiceHelper {
getPipEnvInfo(pythonPath: string): Promise<{ workspaceFolder: Uri; envName: string } | undefined>;
trackWorkspaceFolder(pythonPath: string, workspaceFolder: Uri): Promise<void>;
}
/**
* Factory to create a hash provider.
* Getting the hash of an interpreter can vary based on the type of the interpreter.
*
* @export
* @interface IInterpreterHashProviderFactory
*/
export interface IInterpreterHashProviderFactory {
create(options: { pythonPath: string } | { resource: Uri }): Promise<IInterpreterHashProvider>;
}
/**
* Provides the ability to get the has of a given interpreter.
*
* @export
* @interface IInterpreterHashProvider
*/
export interface IInterpreterHashProvider {
/**
* Gets the hash of a given Python Interpreter.
* (hash is calculated based on last modified timestamp of executable)
*
* @param {string} pythonPath
* @returns {Promise<string>}
* @memberof IInterpreterHashProvider
*/
getInterpreterHash(pythonPath: string): Promise<string>;
}
export interface IWindowsStoreInterpreter {
/**
* Whether this is a Windows Store/App Interpreter.
*
* @param {string} pythonPath
* @returns {boolean}
* @memberof WindowsStoreInterpreter
*/
isWindowsStoreInterpreter(pythonPath: string): boolean;
/**
* Whether this is a python executable in a windows app store folder that is internal and can be hidden from users.
*
* @param {string} pythonPath
* @returns {boolean}
* @memberof IInterpreterHelper
*/
isHiddenInterpreter(pythonPath: string): boolean;
}
export interface IInterpreterFilter {
isHiddenInterpreter(interpreter: PythonInterpreter): boolean;
}