-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathworkspace.apis.ts
More file actions
74 lines (64 loc) · 2.15 KB
/
workspace.apis.ts
File metadata and controls
74 lines (64 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
70
71
72
73
74
/* eslint-disable @typescript-eslint/no-explicit-any */
import {
CancellationToken,
ConfigurationChangeEvent,
ConfigurationScope,
Disposable,
FileDeleteEvent,
FileRenameEvent,
FileSystemWatcher,
GlobPattern,
Uri,
workspace,
WorkspaceConfiguration,
WorkspaceFolder,
WorkspaceFoldersChangeEvent,
} from 'vscode';
export function getWorkspaceFolder(uri: Uri): WorkspaceFolder | undefined {
return workspace.getWorkspaceFolder(uri);
}
export function getWorkspaceFolders(): readonly WorkspaceFolder[] | undefined {
return workspace.workspaceFolders;
}
export function getWorkspaceFile(): Uri | undefined {
return workspace.workspaceFile;
}
export function getConfiguration(section?: string, scope?: ConfigurationScope | null): WorkspaceConfiguration {
return workspace.getConfiguration(section, scope);
}
export function onDidChangeConfiguration(listener: (e: ConfigurationChangeEvent) => any): Disposable {
return workspace.onDidChangeConfiguration(listener);
}
export function onDidChangeWorkspaceFolders(listener: (e: WorkspaceFoldersChangeEvent) => any): Disposable {
return workspace.onDidChangeWorkspaceFolders(listener);
}
export function findFiles(
include: GlobPattern,
exclude?: GlobPattern | null,
maxResults?: number,
token?: CancellationToken,
): Thenable<Uri[]> {
return workspace.findFiles(include, exclude, maxResults, token);
}
export function createFileSystemWatcher(
globPattern: GlobPattern,
ignoreCreateEvents?: boolean,
ignoreChangeEvents?: boolean,
ignoreDeleteEvents?: boolean,
): FileSystemWatcher {
return workspace.createFileSystemWatcher(globPattern, ignoreCreateEvents, ignoreChangeEvents, ignoreDeleteEvents);
}
export function onDidDeleteFiles(
listener: (e: FileDeleteEvent) => any,
thisArgs?: any,
disposables?: Disposable[],
): Disposable {
return workspace.onDidDeleteFiles(listener, thisArgs, disposables);
}
export function onDidRenameFiles(
listener: (e: FileRenameEvent) => any,
thisArgs?: any,
disposables?: Disposable[],
): Disposable {
return workspace.onDidRenameFiles(listener, thisArgs, disposables);
}