forked from microsoft/vscode-languageserver-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommonClient.ts
More file actions
68 lines (59 loc) · 3.1 KB
/
commonClient.ts
File metadata and controls
68 lines (59 loc) · 3.1 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
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { BaseLanguageClient, LanguageClientOptions, StaticFeature, DynamicFeature } from './client';
import { ColorProviderFeature } from './colorProvider';
import { ConfigurationFeature as PullConfigurationFeature } from './configuration';
import { ImplementationFeature } from './implementation';
import { TypeDefinitionFeature } from './typeDefinition';
import { WorkspaceFoldersFeature } from './workspaceFolders';
import { FoldingRangeFeature } from './foldingRange';
import { DeclarationFeature } from './declaration';
import { SelectionRangeFeature } from './selectionRange';
import { ProgressFeature } from './progress';
import { CallHierarchyFeature } from './callHierarchy';
import { SemanticTokensFeature } from './semanticTokens';
import { DidCreateFilesFeature, DidDeleteFilesFeature, DidRenameFilesFeature, WillCreateFilesFeature, WillDeleteFilesFeature, WillRenameFilesFeature } from './fileOperations';
import { LinkedEditingFeature } from './linkedEditingRange';
export abstract class CommonLanguageClient extends BaseLanguageClient {
public constructor(id: string, name: string, clientOptions: LanguageClientOptions) {
super(id, name, clientOptions);
}
public registerProposedFeatures() {
this.registerFeatures(ProposedFeatures.createAll(this));
}
protected registerBuiltinFeatures() {
super.registerBuiltinFeatures();
this.registerFeature(new PullConfigurationFeature(this));
this.registerFeature(new TypeDefinitionFeature(this));
this.registerFeature(new ImplementationFeature(this));
this.registerFeature(new ColorProviderFeature(this));
this.registerFeature(new WorkspaceFoldersFeature(this));
this.registerFeature(new FoldingRangeFeature(this));
this.registerFeature(new DeclarationFeature(this));
this.registerFeature(new SelectionRangeFeature(this));
this.registerFeature(new ProgressFeature(this));
this.registerFeature(new CallHierarchyFeature(this));
this.registerFeature(new SemanticTokensFeature(this));
this.registerFeature(new LinkedEditingFeature(this));
this.registerFeature(new DidCreateFilesFeature(this));
this.registerFeature(new DidRenameFilesFeature(this));
this.registerFeature(new DidDeleteFilesFeature(this));
this.registerFeature(new WillCreateFilesFeature(this));
this.registerFeature(new WillRenameFilesFeature(this));
this.registerFeature(new WillDeleteFilesFeature(this));
}
}
// Exporting proposed protocol.
import { DiagnosticFeature } from './proposed.diagnostic';
import { InlayHintsFeature } from './proposed.inlayHints';
export namespace ProposedFeatures {
export function createAll(_client: BaseLanguageClient): (StaticFeature | DynamicFeature<any>)[] {
let result: (StaticFeature | DynamicFeature<any>)[] = [
new DiagnosticFeature(_client),
new InlayHintsFeature(_client),
];
return result;
}
}