@codingame/monaco-vscode-api 5.1.2-segmenter.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/extensions.d.ts +1 -0
- package/extensions.js +7 -18
- package/package.json +8 -8
- package/service-override/files.d.ts +83 -33
- package/vscode/src/vs/editor/common/core/wordCharacterClassifier.d.ts +6 -11
- package/vscode/src/vs/editor/common/core/wordCharacterClassifier.js +33 -1
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +281 -1
package/README.md
CHANGED
|
@@ -250,7 +250,7 @@ await initialize({
|
|
|
250
250
|
// Open a new editor here and return it
|
|
251
251
|
// It will be called when for instance the user ctrl+click on an import
|
|
252
252
|
}),
|
|
253
|
-
...getConfigurationServiceOverride(
|
|
253
|
+
...getConfigurationServiceOverride()
|
|
254
254
|
})
|
|
255
255
|
|
|
256
256
|
updateUserConfiguration(`{
|
package/extensions.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export { IExtensionContributions } from './vscode/src/vs/platform/extensions/com
|
|
|
100
100
|
import { IDisposable } from './vscode/src/vs/base/common/lifecycle.js';
|
|
101
101
|
export { ITranslations } from './vscode/src/vs/platform/extensionManagement/common/extensionNls.js';
|
|
102
102
|
import { ExtensionHostKind } from './vscode/src/vs/workbench/services/extensions/common/extensionHostKind.js';
|
|
103
|
+
export { ExtensionFileMetadata } from './service-override/files.js';
|
|
103
104
|
|
|
104
105
|
type ApiFactory = (extensionId?: string) => Promise<typeof vscode>;
|
|
105
106
|
declare function registerLocalApiFactory(_apiFactory: ApiFactory): void;
|
package/extensions.js
CHANGED
|
@@ -13,31 +13,20 @@ import { IWorkbenchExtensionEnablementService } from './vscode/src/vs/workbench/
|
|
|
13
13
|
import { StandaloneServices } from './vscode/src/vs/editor/standalone/browser/standaloneServices.js';
|
|
14
14
|
import { ExtensionManifestTranslator } from './vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js';
|
|
15
15
|
import { language } from './vscode/src/vs/base/common/platform.js';
|
|
16
|
-
import { CustomSchemas, registerExtensionFile } from '@codingame/monaco-vscode-files-service-override';
|
|
16
|
+
import { CustomSchemas, registerExtensionFile, RegisteredUriFile } from '@codingame/monaco-vscode-files-service-override';
|
|
17
17
|
import { waitServicesReady } from './lifecycle.js';
|
|
18
|
-
import { throttle
|
|
18
|
+
import { throttle } from './tools.js';
|
|
19
19
|
import { setDefaultApi } from './api.js';
|
|
20
20
|
import { getBuiltInExtensionTranslationsUris } from './l10n.js';
|
|
21
21
|
let apiFactory;
|
|
22
22
|
function registerLocalApiFactory(_apiFactory) {
|
|
23
23
|
apiFactory = _apiFactory;
|
|
24
24
|
}
|
|
25
|
-
function registerExtensionFileUrl(extensionLocation, filePath, url,
|
|
25
|
+
function registerExtensionFileUrl(extensionLocation, filePath, url, metadataOrMimeType) {
|
|
26
26
|
const fileDisposable = new DisposableStore();
|
|
27
27
|
fileDisposable.add(FileAccess.registerStaticBrowserUri(joinPath(extensionLocation, filePath), ( URI.parse(url))));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
headers: mimeType != null
|
|
31
|
-
? {
|
|
32
|
-
Accept: mimeType
|
|
33
|
-
}
|
|
34
|
-
: {}
|
|
35
|
-
});
|
|
36
|
-
if (response.status !== 200) {
|
|
37
|
-
throw new Error(response.statusText);
|
|
38
|
-
}
|
|
39
|
-
return new Uint8Array(await response.arrayBuffer());
|
|
40
|
-
})));
|
|
28
|
+
const metadata = typeof metadataOrMimeType === 'string' ? { mimeType: metadataOrMimeType } : metadataOrMimeType;
|
|
29
|
+
fileDisposable.add(registerExtensionFile(new RegisteredUriFile(joinPath(extensionLocation, filePath), url, metadata)));
|
|
41
30
|
return fileDisposable;
|
|
42
31
|
}
|
|
43
32
|
const deltaExtensions = throttle(async ({ toAdd, toRemove }) => {
|
|
@@ -129,8 +118,8 @@ function registerExtension(manifest, extHostKind, { path = '/', system = false,
|
|
|
129
118
|
}
|
|
130
119
|
};
|
|
131
120
|
if (extHostKind !== 3 ) {
|
|
132
|
-
function registerFileUrl(path, url,
|
|
133
|
-
return registerExtensionFileUrl(location, path, url,
|
|
121
|
+
function registerFileUrl(path, url, metadataOrMimeType) {
|
|
122
|
+
return registerExtensionFileUrl(location, path, url, metadataOrMimeType);
|
|
134
123
|
}
|
|
135
124
|
api = {
|
|
136
125
|
...api,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "VSCode public API plugged on the monaco editor",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": {
|
|
@@ -99,12 +99,12 @@
|
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"@vscode/iconv-lite-umd": "0.7.0",
|
|
101
101
|
"jschardet": "3.0.0",
|
|
102
|
-
"@codingame/monaco-vscode-
|
|
103
|
-
"@codingame/monaco-vscode-files-service-override": "5.
|
|
104
|
-
"@codingame/monaco-vscode-
|
|
105
|
-
"@codingame/monaco-vscode-environment-service-override": "5.
|
|
106
|
-
"@codingame/monaco-vscode-layout-service-override": "5.
|
|
107
|
-
"@codingame/monaco-vscode-host-service-override": "5.
|
|
108
|
-
"@codingame/monaco-vscode-base-service-override": "5.
|
|
102
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "5.2.0",
|
|
103
|
+
"@codingame/monaco-vscode-files-service-override": "5.2.0",
|
|
104
|
+
"@codingame/monaco-vscode-extensions-service-override": "5.2.0",
|
|
105
|
+
"@codingame/monaco-vscode-environment-service-override": "5.2.0",
|
|
106
|
+
"@codingame/monaco-vscode-layout-service-override": "5.2.0",
|
|
107
|
+
"@codingame/monaco-vscode-host-service-override": "5.2.0",
|
|
108
|
+
"@codingame/monaco-vscode-base-service-override": "5.2.0"
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -1,72 +1,120 @@
|
|
|
1
1
|
import { IEditorOverrideServices } from '../vscode/src/vs/editor/standalone/browser/standaloneServices.js';
|
|
2
2
|
export { InMemoryFileSystemProvider } from '../vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js';
|
|
3
3
|
import { URI } from '../vscode/src/vs/base/common/uri.js';
|
|
4
|
-
import { FileType, IStat, IFileSystemProviderWithFileReadWriteCapability, IFileChange,
|
|
4
|
+
import { FileType, IStat, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileChange, IFileReadStreamOptions, IFileWriteOptions, IWatchOptions, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProvider, FileSystemProviderCapabilities, FileChangeType } from '../vscode/src/vs/platform/files/common/files.js';
|
|
5
5
|
export { FilePermission, FileSystemProviderError, FileSystemProviderErrorCode } from '../vscode/src/vs/platform/files/common/files.js';
|
|
6
6
|
import { Disposable, IDisposable } from '../vscode/src/vs/base/common/lifecycle.js';
|
|
7
7
|
import { Emitter, Event } from '../vscode/src/vs/base/common/event.js';
|
|
8
8
|
export { HTMLFileSystemProvider } from '../vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js';
|
|
9
9
|
import { IndexedDBFileSystemProvider } from '../vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js';
|
|
10
10
|
export { IndexedDB } from '../vscode/src/vs/base/browser/indexedDB.js';
|
|
11
|
+
import { ReadableStreamEvents } from '../vscode/src/vs/base/common/stream.js';
|
|
12
|
+
import { CancellationToken } from '../vscode/src/vs/base/common/cancellation.js';
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
interface _RegisteredNode {
|
|
15
|
+
type: FileType;
|
|
16
|
+
stats(): Promise<IStat>;
|
|
17
|
+
onDidDelete: Event<void>;
|
|
18
|
+
onDidChange: Event<void>;
|
|
19
|
+
}
|
|
20
|
+
interface RegisteredFileNode extends _RegisteredNode {
|
|
21
|
+
type: FileType.File;
|
|
22
|
+
uri: URI;
|
|
23
|
+
read(): Promise<Uint8Array>;
|
|
24
|
+
readStream?(): Promise<ReadableStream<Uint8Array>>;
|
|
25
|
+
write(content: Uint8Array): Promise<void>;
|
|
26
|
+
delete(): void;
|
|
27
|
+
}
|
|
28
|
+
interface RegisteredDirectoryNode extends _RegisteredNode {
|
|
29
|
+
type: FileType.Directory;
|
|
30
|
+
addChild(name: string, node: RegisteredNode): IDisposable;
|
|
31
|
+
deleteChild(name: string): boolean;
|
|
32
|
+
getChildren(name: string): RegisteredNode | undefined;
|
|
33
|
+
read(): [string, FileType][];
|
|
34
|
+
}
|
|
35
|
+
type RegisteredNode = RegisteredFileNode | RegisteredDirectoryNode;
|
|
36
|
+
declare abstract class RegisteredFile implements RegisteredFileNode {
|
|
13
37
|
uri: URI;
|
|
14
38
|
private readonly;
|
|
15
39
|
protected ctime: number;
|
|
16
40
|
protected mtime: number;
|
|
17
|
-
readonly type
|
|
41
|
+
readonly type = FileType.File;
|
|
18
42
|
protected _onDidChange: Emitter<void>;
|
|
19
43
|
onDidChange: Event<void>;
|
|
20
44
|
protected _onDidDelete: Emitter<void>;
|
|
21
45
|
onDidDelete: Event<void>;
|
|
22
|
-
protected _onDidRename: Emitter<{
|
|
23
|
-
from: URI;
|
|
24
|
-
to: URI;
|
|
25
|
-
}>;
|
|
26
|
-
onDidRename: Event<{
|
|
27
|
-
from: URI;
|
|
28
|
-
to: URI;
|
|
29
|
-
}>;
|
|
30
46
|
constructor(uri: URI, readonly: boolean);
|
|
31
47
|
stats(): Promise<IStat>;
|
|
32
|
-
getSize(): Promise<number>;
|
|
33
|
-
abstract read(): Promise<string | Uint8Array>;
|
|
34
|
-
abstract write(content: string): Promise<void>;
|
|
48
|
+
abstract getSize(): Promise<number>;
|
|
35
49
|
delete(): Promise<void>;
|
|
36
|
-
|
|
50
|
+
abstract read(): Promise<Uint8Array>;
|
|
51
|
+
abstract write(content: Uint8Array): Promise<void>;
|
|
37
52
|
}
|
|
38
53
|
declare class RegisteredReadOnlyFile extends RegisteredFile {
|
|
39
|
-
read: () => Promise<
|
|
40
|
-
|
|
54
|
+
read: () => Promise<Uint8Array>;
|
|
55
|
+
private size;
|
|
56
|
+
constructor(uri: URI, read: () => Promise<Uint8Array>, size: number);
|
|
57
|
+
getSize(): Promise<number>;
|
|
58
|
+
write(): Promise<void>;
|
|
59
|
+
delete(): Promise<void>;
|
|
60
|
+
}
|
|
61
|
+
interface ExtensionFileMetadata {
|
|
62
|
+
mimeType?: string;
|
|
63
|
+
size?: number;
|
|
64
|
+
}
|
|
65
|
+
declare class RegisteredUriFile extends RegisteredFile {
|
|
66
|
+
private url;
|
|
67
|
+
private metadata?;
|
|
68
|
+
constructor(location: URI, url: string, metadata?: ExtensionFileMetadata | undefined);
|
|
69
|
+
private fetch;
|
|
70
|
+
getSize(): Promise<number>;
|
|
71
|
+
read(): Promise<Uint8Array>;
|
|
72
|
+
readStream(): Promise<ReadableStream<Uint8Array>>;
|
|
41
73
|
write(): Promise<void>;
|
|
42
74
|
delete(): Promise<void>;
|
|
43
|
-
rename(): Promise<void>;
|
|
44
75
|
}
|
|
45
76
|
declare class RegisteredMemoryFile extends RegisteredFile {
|
|
46
77
|
private content;
|
|
47
|
-
constructor(uri: URI, content: string);
|
|
48
|
-
|
|
49
|
-
|
|
78
|
+
constructor(uri: URI, content: string | Uint8Array);
|
|
79
|
+
getSize(): Promise<number>;
|
|
80
|
+
read(): Promise<Uint8Array>;
|
|
81
|
+
write(content: Uint8Array): Promise<void>;
|
|
50
82
|
}
|
|
51
|
-
declare class RegisteredFileSystemProvider extends Disposable implements IFileSystemProviderWithFileReadWriteCapability {
|
|
52
|
-
private
|
|
53
|
-
|
|
54
|
-
|
|
83
|
+
declare class RegisteredFileSystemProvider extends Disposable implements IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability {
|
|
84
|
+
private memoryFdCounter;
|
|
85
|
+
private readonly fdMemory;
|
|
86
|
+
private rootByAuthority;
|
|
55
87
|
onDidChangeCapabilities: Event<any>;
|
|
56
88
|
_onDidChangeFile: Emitter<readonly IFileChange[]>;
|
|
57
89
|
onDidChangeFile: Event<readonly IFileChange[]>;
|
|
58
|
-
|
|
59
|
-
|
|
90
|
+
capabilities: number;
|
|
91
|
+
constructor(readonly: boolean);
|
|
92
|
+
open(resource: URI): Promise<number>;
|
|
93
|
+
close(fd: number): Promise<void>;
|
|
94
|
+
read(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
|
|
95
|
+
write(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
|
|
96
|
+
private _lookupRoot;
|
|
97
|
+
private _lookup;
|
|
98
|
+
private _lookupAsDirectory;
|
|
99
|
+
private _lookupAsFile;
|
|
100
|
+
registerFile(file: RegisteredFileNode): IDisposable;
|
|
60
101
|
stat(resource: URI): Promise<IStat>;
|
|
102
|
+
readdirSync(resource: URI): [string, FileType][];
|
|
61
103
|
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
62
104
|
readFile(resource: URI): Promise<Uint8Array>;
|
|
105
|
+
readFileStream(resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array>;
|
|
63
106
|
watch(): IDisposable;
|
|
64
|
-
writeFile(resource: URI, content: Uint8Array): Promise<void>;
|
|
107
|
+
writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
|
|
108
|
+
rename(): Promise<void>;
|
|
109
|
+
mkdirSync(resource: URI): RegisteredDirectoryNode;
|
|
110
|
+
mkdir(): Promise<void>;
|
|
111
|
+
private deleteSync;
|
|
65
112
|
delete(resource: URI): Promise<void>;
|
|
66
|
-
|
|
67
|
-
|
|
113
|
+
private _bufferedChanges;
|
|
114
|
+
private _fireSoonHandle?;
|
|
115
|
+
private _fireSoon;
|
|
68
116
|
}
|
|
69
|
-
declare class OverlayFileSystemProvider implements IFileSystemProviderWithFileReadWriteCapability {
|
|
117
|
+
declare class OverlayFileSystemProvider implements IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability {
|
|
70
118
|
private providers;
|
|
71
119
|
register(priority: number, provider: IFileSystemProviderWithFileReadWriteCapability): IDisposable;
|
|
72
120
|
get delegates(): IFileSystemProviderWithFileReadWriteCapability[];
|
|
@@ -77,9 +125,11 @@ declare class OverlayFileSystemProvider implements IFileSystemProviderWithFileRe
|
|
|
77
125
|
onDidChangeOverlays: Event<void>;
|
|
78
126
|
capabilities: number;
|
|
79
127
|
private readFromDelegates;
|
|
128
|
+
private readFromDelegatesSync;
|
|
80
129
|
private writeToDelegates;
|
|
81
130
|
stat(resource: URI): Promise<IStat>;
|
|
82
131
|
readFile(resource: URI): Promise<Uint8Array>;
|
|
132
|
+
readFileStream(resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array>;
|
|
83
133
|
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
84
134
|
watch(resource: URI, opts: IWatchOptions): IDisposable;
|
|
85
135
|
writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
|
|
@@ -135,7 +185,7 @@ declare function getServiceOverride(): IEditorOverrideServices;
|
|
|
135
185
|
* the default file system provider for a given scheme.
|
|
136
186
|
*/
|
|
137
187
|
declare function registerCustomProvider(scheme: string, provider: IFileSystemProvider): void;
|
|
138
|
-
declare function registerExtensionFile(
|
|
188
|
+
declare function registerExtensionFile(file: RegisteredFileNode): IDisposable;
|
|
139
189
|
/**
|
|
140
190
|
* Can be used to create a file before the fileService is initialized
|
|
141
191
|
*/
|
|
@@ -162,4 +212,4 @@ declare function registerHTMLFileSystemProvider(): void;
|
|
|
162
212
|
*/
|
|
163
213
|
declare function registerFileSystemOverlay(priority: number, provider: IFileSystemProviderWithFileReadWriteCapability): IDisposable;
|
|
164
214
|
|
|
165
|
-
export { CustomSchemas, DelegateFileSystemProvider, EmptyFileSystemProvider, FileChangeType, FileSystemProviderCapabilities, FileType, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions, IndexedDBFileSystemProvider, OverlayFileSystemProvider, RegisteredFile, RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, createIndexedDBProviders, getServiceOverride as default, initFile, registerCustomProvider, registerExtensionFile, registerFileSystemOverlay, registerHTMLFileSystemProvider };
|
|
215
|
+
export { CustomSchemas, DelegateFileSystemProvider, EmptyFileSystemProvider, type ExtensionFileMetadata, FileChangeType, FileSystemProviderCapabilities, FileType, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions, IndexedDBFileSystemProvider, OverlayFileSystemProvider, RegisteredFile, RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, RegisteredUriFile, createIndexedDBProviders, getServiceOverride as default, initFile, registerCustomProvider, registerExtensionFile, registerFileSystemOverlay, registerHTMLFileSystemProvider };
|
|
@@ -7,22 +7,17 @@ declare const enum WordCharacterClass {
|
|
|
7
7
|
}
|
|
8
8
|
declare class WordCharacterClassifier extends CharacterClassifier<WordCharacterClass> {
|
|
9
9
|
readonly intlSegmenterLocales: Intl.UnicodeBCP47LocaleIdentifier[];
|
|
10
|
+
private readonly _segmenter;
|
|
11
|
+
private _cachedLine;
|
|
12
|
+
private _cachedSegments;
|
|
10
13
|
constructor(wordSeparators: string, intlSegmenterLocales: Intl.UnicodeBCP47LocaleIdentifier[]);
|
|
11
14
|
findPrevIntlWordBeforeOrAtOffset(line: string, offset: number): IntlWordSegmentData | null;
|
|
12
15
|
findNextIntlWordAtOrAfterOffset(lineContent: string, offset: number): IntlWordSegmentData | null;
|
|
13
16
|
private _getIntlSegmenterWordsOnLine;
|
|
17
|
+
private _filterWordSegments;
|
|
18
|
+
private _isWordLike;
|
|
14
19
|
}
|
|
15
|
-
interface IntlWordSegmentData {
|
|
16
|
-
/** A string containing the segment extracted from the original input string. */
|
|
17
|
-
segment: string;
|
|
18
|
-
/** The code unit index in the original input string at which the segment begins. */
|
|
19
|
-
index: number;
|
|
20
|
-
/** The complete input string that was segmented. */
|
|
21
|
-
input: string;
|
|
22
|
-
/**
|
|
23
|
-
* A boolean value only if granularity is "word"; otherwise, undefined.
|
|
24
|
-
* If granularity is "word", then isWordLike is true when the segment is word-like (i.e., consists of letters/numbers/ideographs/etc.); otherwise, false.
|
|
25
|
-
*/
|
|
20
|
+
interface IntlWordSegmentData extends Intl.SegmentData {
|
|
26
21
|
isWordLike: true;
|
|
27
22
|
}
|
|
28
23
|
|
|
@@ -3,7 +3,16 @@ import { CharacterClassifier } from './characterClassifier.js';
|
|
|
3
3
|
class WordCharacterClassifier extends CharacterClassifier {
|
|
4
4
|
constructor(wordSeparators, intlSegmenterLocales) {
|
|
5
5
|
super(0 );
|
|
6
|
+
this._segmenter = null;
|
|
7
|
+
this._cachedLine = null;
|
|
8
|
+
this._cachedSegments = [];
|
|
6
9
|
this.intlSegmenterLocales = intlSegmenterLocales;
|
|
10
|
+
if (this.intlSegmenterLocales.length > 0) {
|
|
11
|
+
this._segmenter = new Intl.Segmenter(this.intlSegmenterLocales, { granularity: 'word' });
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
this._segmenter = null;
|
|
15
|
+
}
|
|
7
16
|
for (let i = 0, len = wordSeparators.length; i < len; i++) {
|
|
8
17
|
this.set(wordSeparators.charCodeAt(i), 2 );
|
|
9
18
|
}
|
|
@@ -30,7 +39,30 @@ class WordCharacterClassifier extends CharacterClassifier {
|
|
|
30
39
|
return null;
|
|
31
40
|
}
|
|
32
41
|
_getIntlSegmenterWordsOnLine(line) {
|
|
33
|
-
|
|
42
|
+
if (!this._segmenter) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
if (this._cachedLine === line) {
|
|
46
|
+
return this._cachedSegments;
|
|
47
|
+
}
|
|
48
|
+
this._cachedLine = line;
|
|
49
|
+
this._cachedSegments = this._filterWordSegments(this._segmenter.segment(line));
|
|
50
|
+
return this._cachedSegments;
|
|
51
|
+
}
|
|
52
|
+
_filterWordSegments(segments) {
|
|
53
|
+
const result = [];
|
|
54
|
+
for (const segment of segments) {
|
|
55
|
+
if (this._isWordLike(segment)) {
|
|
56
|
+
result.push(segment);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
_isWordLike(segment) {
|
|
62
|
+
if (segment.isWordLike) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
34
66
|
}
|
|
35
67
|
}
|
|
36
68
|
const wordClassifierCache = ( new LRUCache(10));
|
|
@@ -1004,6 +1004,264 @@ interface IViewsWelcome {
|
|
|
1004
1004
|
*/
|
|
1005
1005
|
readonly enablement?: string;
|
|
1006
1006
|
}
|
|
1007
|
+
interface INamedProblemPattern extends IProblemPattern {
|
|
1008
|
+
/**
|
|
1009
|
+
* The name of the problem pattern.
|
|
1010
|
+
*/
|
|
1011
|
+
name: string;
|
|
1012
|
+
/**
|
|
1013
|
+
* A human readable label
|
|
1014
|
+
*/
|
|
1015
|
+
label?: string;
|
|
1016
|
+
}
|
|
1017
|
+
interface ICheckedProblemPattern extends IProblemPattern {
|
|
1018
|
+
/**
|
|
1019
|
+
* The regular expression to find a problem in the console output of an
|
|
1020
|
+
* executed task.
|
|
1021
|
+
*/
|
|
1022
|
+
regexp: string;
|
|
1023
|
+
}
|
|
1024
|
+
type MultiLineCheckedProblemPattern = ICheckedProblemPattern[];
|
|
1025
|
+
interface INamedMultiLineCheckedProblemPattern {
|
|
1026
|
+
/**
|
|
1027
|
+
* The name of the problem pattern.
|
|
1028
|
+
*/
|
|
1029
|
+
name: string;
|
|
1030
|
+
/**
|
|
1031
|
+
* A human readable label
|
|
1032
|
+
*/
|
|
1033
|
+
label?: string;
|
|
1034
|
+
/**
|
|
1035
|
+
* The actual patterns
|
|
1036
|
+
*/
|
|
1037
|
+
patterns: MultiLineCheckedProblemPattern;
|
|
1038
|
+
}
|
|
1039
|
+
type NamedProblemPatterns = (INamedProblemPattern | INamedMultiLineCheckedProblemPattern)[];
|
|
1040
|
+
interface IProblemPattern {
|
|
1041
|
+
/**
|
|
1042
|
+
* The regular expression to find a problem in the console output of an
|
|
1043
|
+
* executed task.
|
|
1044
|
+
*/
|
|
1045
|
+
regexp?: string;
|
|
1046
|
+
/**
|
|
1047
|
+
* Whether the pattern matches a whole file, or a location (file/line)
|
|
1048
|
+
*
|
|
1049
|
+
* The default is to match for a location. Only valid on the
|
|
1050
|
+
* first problem pattern in a multi line problem matcher.
|
|
1051
|
+
*/
|
|
1052
|
+
kind?: string;
|
|
1053
|
+
/**
|
|
1054
|
+
* The match group index of the filename.
|
|
1055
|
+
* If omitted 1 is used.
|
|
1056
|
+
*/
|
|
1057
|
+
file?: number;
|
|
1058
|
+
/**
|
|
1059
|
+
* The match group index of the problem's location. Valid location
|
|
1060
|
+
* patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn).
|
|
1061
|
+
* If omitted the line and column properties are used.
|
|
1062
|
+
*/
|
|
1063
|
+
location?: number;
|
|
1064
|
+
/**
|
|
1065
|
+
* The match group index of the problem's line in the source file.
|
|
1066
|
+
*
|
|
1067
|
+
* Defaults to 2.
|
|
1068
|
+
*/
|
|
1069
|
+
line?: number;
|
|
1070
|
+
/**
|
|
1071
|
+
* The match group index of the problem's column in the source file.
|
|
1072
|
+
*
|
|
1073
|
+
* Defaults to 3.
|
|
1074
|
+
*/
|
|
1075
|
+
column?: number;
|
|
1076
|
+
/**
|
|
1077
|
+
* The match group index of the problem's end line in the source file.
|
|
1078
|
+
*
|
|
1079
|
+
* Defaults to undefined. No end line is captured.
|
|
1080
|
+
*/
|
|
1081
|
+
endLine?: number;
|
|
1082
|
+
/**
|
|
1083
|
+
* The match group index of the problem's end column in the source file.
|
|
1084
|
+
*
|
|
1085
|
+
* Defaults to undefined. No end column is captured.
|
|
1086
|
+
*/
|
|
1087
|
+
endColumn?: number;
|
|
1088
|
+
/**
|
|
1089
|
+
* The match group index of the problem's severity.
|
|
1090
|
+
*
|
|
1091
|
+
* Defaults to undefined. In this case the problem matcher's severity
|
|
1092
|
+
* is used.
|
|
1093
|
+
*/
|
|
1094
|
+
severity?: number;
|
|
1095
|
+
/**
|
|
1096
|
+
* The match group index of the problem's code.
|
|
1097
|
+
*
|
|
1098
|
+
* Defaults to undefined. No code is captured.
|
|
1099
|
+
*/
|
|
1100
|
+
code?: number;
|
|
1101
|
+
/**
|
|
1102
|
+
* The match group index of the message. If omitted it defaults
|
|
1103
|
+
* to 4 if location is specified. Otherwise it defaults to 5.
|
|
1104
|
+
*/
|
|
1105
|
+
message?: number;
|
|
1106
|
+
/**
|
|
1107
|
+
* Specifies if the last pattern in a multi line problem matcher should
|
|
1108
|
+
* loop as long as it does match a line consequently. Only valid on the
|
|
1109
|
+
* last problem pattern in a multi line problem matcher.
|
|
1110
|
+
*/
|
|
1111
|
+
loop?: boolean;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* A watching pattern
|
|
1115
|
+
*/
|
|
1116
|
+
interface IWatchingPattern {
|
|
1117
|
+
/**
|
|
1118
|
+
* The actual regular expression
|
|
1119
|
+
*/
|
|
1120
|
+
regexp?: string;
|
|
1121
|
+
/**
|
|
1122
|
+
* The match group index of the filename. If provided the expression
|
|
1123
|
+
* is matched for that file only.
|
|
1124
|
+
*/
|
|
1125
|
+
file?: number;
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* A description to track the start and end of a watching task.
|
|
1129
|
+
*/
|
|
1130
|
+
interface IBackgroundMonitor {
|
|
1131
|
+
/**
|
|
1132
|
+
* If set to true the watcher is in active mode when the task
|
|
1133
|
+
* starts. This is equals of issuing a line that matches the
|
|
1134
|
+
* beginsPattern.
|
|
1135
|
+
*/
|
|
1136
|
+
activeOnStart?: boolean;
|
|
1137
|
+
/**
|
|
1138
|
+
* If matched in the output the start of a watching task is signaled.
|
|
1139
|
+
*/
|
|
1140
|
+
beginsPattern?: string | IWatchingPattern;
|
|
1141
|
+
/**
|
|
1142
|
+
* If matched in the output the end of a watching task is signaled.
|
|
1143
|
+
*/
|
|
1144
|
+
endsPattern?: string | IWatchingPattern;
|
|
1145
|
+
}
|
|
1146
|
+
interface INamedProblemMatcher {
|
|
1147
|
+
/**
|
|
1148
|
+
* This name can be used to refer to the
|
|
1149
|
+
* problem matcher from within a task.
|
|
1150
|
+
*/
|
|
1151
|
+
name: string;
|
|
1152
|
+
/**
|
|
1153
|
+
* A human readable label.
|
|
1154
|
+
*/
|
|
1155
|
+
label?: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* The name of a base problem matcher to use. If specified the
|
|
1158
|
+
* base problem matcher will be used as a template and properties
|
|
1159
|
+
* specified here will replace properties of the base problem
|
|
1160
|
+
* matcher
|
|
1161
|
+
*/
|
|
1162
|
+
base?: string;
|
|
1163
|
+
/**
|
|
1164
|
+
* The owner of the produced VSCode problem. This is typically
|
|
1165
|
+
* the identifier of a VSCode language service if the problems are
|
|
1166
|
+
* to be merged with the one produced by the language service
|
|
1167
|
+
* or a generated internal id. Defaults to the generated internal id.
|
|
1168
|
+
*/
|
|
1169
|
+
owner?: string;
|
|
1170
|
+
/**
|
|
1171
|
+
* A human-readable string describing the source of this problem.
|
|
1172
|
+
* E.g. 'typescript' or 'super lint'.
|
|
1173
|
+
*/
|
|
1174
|
+
source?: string;
|
|
1175
|
+
/**
|
|
1176
|
+
* Specifies to which kind of documents the problems found by this
|
|
1177
|
+
* matcher are applied. Valid values are:
|
|
1178
|
+
*
|
|
1179
|
+
* "allDocuments": problems found in all documents are applied.
|
|
1180
|
+
* "openDocuments": problems found in documents that are open
|
|
1181
|
+
* are applied.
|
|
1182
|
+
* "closedDocuments": problems found in closed documents are
|
|
1183
|
+
* applied.
|
|
1184
|
+
*/
|
|
1185
|
+
applyTo?: string;
|
|
1186
|
+
/**
|
|
1187
|
+
* The severity of the VSCode problem produced by this problem matcher.
|
|
1188
|
+
*
|
|
1189
|
+
* Valid values are:
|
|
1190
|
+
* "error": to produce errors.
|
|
1191
|
+
* "warning": to produce warnings.
|
|
1192
|
+
* "info": to produce infos.
|
|
1193
|
+
*
|
|
1194
|
+
* The value is used if a pattern doesn't specify a severity match group.
|
|
1195
|
+
* Defaults to "error" if omitted.
|
|
1196
|
+
*/
|
|
1197
|
+
severity?: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* Defines how filename reported in a problem pattern
|
|
1200
|
+
* should be read. Valid values are:
|
|
1201
|
+
* - "absolute": the filename is always treated absolute.
|
|
1202
|
+
* - "relative": the filename is always treated relative to
|
|
1203
|
+
* the current working directory. This is the default.
|
|
1204
|
+
* - ["relative", "path value"]: the filename is always
|
|
1205
|
+
* treated relative to the given path value.
|
|
1206
|
+
* - "autodetect": the filename is treated relative to
|
|
1207
|
+
* the current workspace directory, and if the file
|
|
1208
|
+
* does not exist, it is treated as absolute.
|
|
1209
|
+
* - ["autodetect", "path value"]: the filename is treated
|
|
1210
|
+
* relative to the given path value, and if it does not
|
|
1211
|
+
* exist, it is treated as absolute.
|
|
1212
|
+
* - ["search", { include?: "" | []; exclude?: "" | [] }]: The filename
|
|
1213
|
+
* needs to be searched under the directories named by the "include"
|
|
1214
|
+
* property and their nested subdirectories. With "exclude" property
|
|
1215
|
+
* present, the directories should be removed from the search. When
|
|
1216
|
+
* `include` is not unprovided, the current workspace directory should
|
|
1217
|
+
* be used as the default.
|
|
1218
|
+
*/
|
|
1219
|
+
fileLocation?: string | string[] | ['search', ISearchFileLocationArgs];
|
|
1220
|
+
/**
|
|
1221
|
+
* The name of a predefined problem pattern, the inline definition
|
|
1222
|
+
* of a problem pattern or an array of problem patterns to match
|
|
1223
|
+
* problems spread over multiple lines.
|
|
1224
|
+
*/
|
|
1225
|
+
pattern?: string | IProblemPattern | IProblemPattern[];
|
|
1226
|
+
/**
|
|
1227
|
+
* A regular expression signaling that a watched tasks begins executing
|
|
1228
|
+
* triggered through file watching.
|
|
1229
|
+
*/
|
|
1230
|
+
watchedTaskBeginsRegExp?: string;
|
|
1231
|
+
/**
|
|
1232
|
+
* A regular expression signaling that a watched tasks ends executing.
|
|
1233
|
+
*/
|
|
1234
|
+
watchedTaskEndsRegExp?: string;
|
|
1235
|
+
/**
|
|
1236
|
+
* @deprecated Use background instead.
|
|
1237
|
+
*/
|
|
1238
|
+
watching?: IBackgroundMonitor;
|
|
1239
|
+
background?: IBackgroundMonitor;
|
|
1240
|
+
}
|
|
1241
|
+
type ISearchFileLocationArgs = {
|
|
1242
|
+
include?: string | string[];
|
|
1243
|
+
exclude?: string | string[];
|
|
1244
|
+
};
|
|
1245
|
+
interface ITypescriptServerPlugin {
|
|
1246
|
+
/**
|
|
1247
|
+
* Name of the plugin as listed in the package.json.
|
|
1248
|
+
*/
|
|
1249
|
+
name: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* Should the plugin be loaded when using workspace versions of TypeScript?
|
|
1252
|
+
*/
|
|
1253
|
+
enableForWorkspaceTypeScriptVersions: boolean;
|
|
1254
|
+
}
|
|
1255
|
+
interface IHtmlLanguageParticipant {
|
|
1256
|
+
/**
|
|
1257
|
+
* The id of the language that participates with HTML language server.
|
|
1258
|
+
*/
|
|
1259
|
+
languageId: string;
|
|
1260
|
+
/**
|
|
1261
|
+
* Whether the language participates with HTML auto insertions. If not specified, defaults to <code>true</code>.
|
|
1262
|
+
*/
|
|
1263
|
+
autoInsert: boolean;
|
|
1264
|
+
}
|
|
1007
1265
|
interface IExtensionContributions {
|
|
1008
1266
|
/**
|
|
1009
1267
|
* Contributes terminal functionality.
|
|
@@ -1170,6 +1428,28 @@ interface IExtensionContributions {
|
|
|
1170
1428
|
* Contributed views welcome content. Welcome content will be rendered in tree based views whenever they have no meaningful content to display, ie. the File Explorer when no folder is open. Such content is useful as in-product documentation to drive users to use certain features before they are available. A good example would be a `Clone Repository` button in the File Explorer welcome view.
|
|
1171
1429
|
*/
|
|
1172
1430
|
readonly viewsWelcome?: IViewsWelcome[];
|
|
1431
|
+
/**
|
|
1432
|
+
* Contributes problem matchers
|
|
1433
|
+
*/
|
|
1434
|
+
readonly problemMatchers?: INamedProblemMatcher[];
|
|
1435
|
+
/**
|
|
1436
|
+
* Contributes problem patterns
|
|
1437
|
+
*/
|
|
1438
|
+
readonly problemPatterns?: NamedProblemPatterns;
|
|
1439
|
+
/**
|
|
1440
|
+
* Contributed TypeScript server plugins.
|
|
1441
|
+
*/
|
|
1442
|
+
readonly typescriptServerPlugins?: ITypescriptServerPlugin[];
|
|
1443
|
+
/**
|
|
1444
|
+
* A list of languages that participate with the HTML language server.
|
|
1445
|
+
*/
|
|
1446
|
+
readonly htmlLanguageParticipants?: IHtmlLanguageParticipant[];
|
|
1447
|
+
readonly html?: {
|
|
1448
|
+
customData?: string[];
|
|
1449
|
+
};
|
|
1450
|
+
readonly css?: {
|
|
1451
|
+
customData?: string[];
|
|
1452
|
+
};
|
|
1173
1453
|
}
|
|
1174
1454
|
interface IExtensionCapabilities {
|
|
1175
1455
|
readonly virtualWorkspaces?: ExtensionVirtualWorkspaceSupport;
|
|
@@ -1319,4 +1599,4 @@ interface IRelaxedExtensionDescription extends IRelaxedExtensionManifest {
|
|
|
1319
1599
|
}
|
|
1320
1600
|
type IExtensionDescription = Readonly<IRelaxedExtensionDescription>;
|
|
1321
1601
|
|
|
1322
|
-
export { ExtensionIdentifier, ExtensionIdentifierMap, ExtensionType, type ExtensionUntrustedWorkspaceSupport, type ExtensionUntrustedWorkspaceSupportType, type ExtensionVirtualWorkspaceSupport, type ExtensionVirtualWorkspaceSupportType, type IAuthenticationContribution, type IBreakpoint, type ICodeActionContribution, type ICodeActionContributionAction, type IColor, type IColorTheme, type ICommand, type IConfiguration, type IDebugVisualizationContribution, type IDebugger, type IDocumentation, type IDocumentationRefactoring, type IExtension, type IExtensionCapabilities, type IExtensionContributions, type IExtensionDescription, type IExtensionIdentifier, type IExtensionManifest, type IGrammar, type IIcon, type IIconTheme, type IInteractiveSession, type IJSONValidation, type IKeyBinding, type ILanguage, type ILocalizationContribution, type IMenu, type INotebookEntry, type INotebookRendererContribution, type IProductTheme, type IRelaxedExtensionDescription, type IRelaxedExtensionManifest, type IRemoteHelp, type ISemanticTokenModifiers, type ISemanticTokenScopes, type ISemanticTokenTypes, type ISnippet, type IStartEntry, type IStatusBarItem, type ISubMenu, type ITaskDefinitions, type ITerminal, type ITerminalQuickFix, type ITranslation, type IView, type IViewContainer, type IViewsWelcome, type IWalkthrough, type IWalkthroughStep, type LimitedWorkspaceSupportType, type NotebookPreload, TargetPlatform };
|
|
1602
|
+
export { ExtensionIdentifier, ExtensionIdentifierMap, ExtensionType, type ExtensionUntrustedWorkspaceSupport, type ExtensionUntrustedWorkspaceSupportType, type ExtensionVirtualWorkspaceSupport, type ExtensionVirtualWorkspaceSupportType, type IAuthenticationContribution, type IBackgroundMonitor, type IBreakpoint, type ICheckedProblemPattern, type ICodeActionContribution, type ICodeActionContributionAction, type IColor, type IColorTheme, type ICommand, type IConfiguration, type IDebugVisualizationContribution, type IDebugger, type IDocumentation, type IDocumentationRefactoring, type IExtension, type IExtensionCapabilities, type IExtensionContributions, type IExtensionDescription, type IExtensionIdentifier, type IExtensionManifest, type IGrammar, type IHtmlLanguageParticipant, type IIcon, type IIconTheme, type IInteractiveSession, type IJSONValidation, type IKeyBinding, type ILanguage, type ILocalizationContribution, type IMenu, type INamedMultiLineCheckedProblemPattern, type INamedProblemMatcher, type INamedProblemPattern, type INotebookEntry, type INotebookRendererContribution, type IProblemPattern, type IProductTheme, type IRelaxedExtensionDescription, type IRelaxedExtensionManifest, type IRemoteHelp, type ISearchFileLocationArgs, type ISemanticTokenModifiers, type ISemanticTokenScopes, type ISemanticTokenTypes, type ISnippet, type IStartEntry, type IStatusBarItem, type ISubMenu, type ITaskDefinitions, type ITerminal, type ITerminalQuickFix, type ITranslation, type ITypescriptServerPlugin, type IView, type IViewContainer, type IViewsWelcome, type IWalkthrough, type IWalkthroughStep, type IWatchingPattern, type LimitedWorkspaceSupportType, type MultiLineCheckedProblemPattern, type NamedProblemPatterns, type NotebookPreload, TargetPlatform };
|