2 /* --------------------------------------------------------------------------------------------
3 * Copyright (c) Microsoft Corporation. All rights reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
5 * ------------------------------------------------------------------------------------------ */
6 Object.defineProperty(exports, "__esModule", { value: true });
7 exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.SemanticTokensRegistrationType = exports.TokenFormat = exports.SemanticTokens = exports.SemanticTokenModifiers = exports.SemanticTokenTypes = void 0;
8 const messages_1 = require("./messages");
10 * A set of predefined token types. This set is not fixed
11 * an clients can specify additional token types via the
12 * corresponding client capabilities.
16 var SemanticTokenTypes;
17 (function (SemanticTokenTypes) {
18 SemanticTokenTypes["namespace"] = "namespace";
20 * Represents a generic type. Acts as a fallback for types which can't be mapped to
21 * a specific type like class or enum.
23 SemanticTokenTypes["type"] = "type";
24 SemanticTokenTypes["class"] = "class";
25 SemanticTokenTypes["enum"] = "enum";
26 SemanticTokenTypes["interface"] = "interface";
27 SemanticTokenTypes["struct"] = "struct";
28 SemanticTokenTypes["typeParameter"] = "typeParameter";
29 SemanticTokenTypes["parameter"] = "parameter";
30 SemanticTokenTypes["variable"] = "variable";
31 SemanticTokenTypes["property"] = "property";
32 SemanticTokenTypes["enumMember"] = "enumMember";
33 SemanticTokenTypes["event"] = "event";
34 SemanticTokenTypes["function"] = "function";
35 SemanticTokenTypes["method"] = "method";
36 SemanticTokenTypes["macro"] = "macro";
37 SemanticTokenTypes["keyword"] = "keyword";
38 SemanticTokenTypes["modifier"] = "modifier";
39 SemanticTokenTypes["comment"] = "comment";
40 SemanticTokenTypes["string"] = "string";
41 SemanticTokenTypes["number"] = "number";
42 SemanticTokenTypes["regexp"] = "regexp";
43 SemanticTokenTypes["operator"] = "operator";
44 })(SemanticTokenTypes = exports.SemanticTokenTypes || (exports.SemanticTokenTypes = {}));
46 * A set of predefined token modifiers. This set is not fixed
47 * an clients can specify additional token types via the
48 * corresponding client capabilities.
52 var SemanticTokenModifiers;
53 (function (SemanticTokenModifiers) {
54 SemanticTokenModifiers["declaration"] = "declaration";
55 SemanticTokenModifiers["definition"] = "definition";
56 SemanticTokenModifiers["readonly"] = "readonly";
57 SemanticTokenModifiers["static"] = "static";
58 SemanticTokenModifiers["deprecated"] = "deprecated";
59 SemanticTokenModifiers["abstract"] = "abstract";
60 SemanticTokenModifiers["async"] = "async";
61 SemanticTokenModifiers["modification"] = "modification";
62 SemanticTokenModifiers["documentation"] = "documentation";
63 SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
64 })(SemanticTokenModifiers = exports.SemanticTokenModifiers || (exports.SemanticTokenModifiers = {}));
69 (function (SemanticTokens) {
71 const candidate = value;
72 return candidate !== undefined && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&
73 Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
75 SemanticTokens.is = is;
76 })(SemanticTokens = exports.SemanticTokens || (exports.SemanticTokens = {}));
77 //------- 'textDocument/semanticTokens' -----
79 (function (TokenFormat) {
80 TokenFormat.Relative = 'relative';
81 })(TokenFormat = exports.TokenFormat || (exports.TokenFormat = {}));
82 var SemanticTokensRegistrationType;
83 (function (SemanticTokensRegistrationType) {
84 SemanticTokensRegistrationType.method = 'textDocument/semanticTokens';
85 SemanticTokensRegistrationType.type = new messages_1.RegistrationType(SemanticTokensRegistrationType.method);
86 })(SemanticTokensRegistrationType = exports.SemanticTokensRegistrationType || (exports.SemanticTokensRegistrationType = {}));
90 var SemanticTokensRequest;
91 (function (SemanticTokensRequest) {
92 SemanticTokensRequest.method = 'textDocument/semanticTokens/full';
93 SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);
94 })(SemanticTokensRequest = exports.SemanticTokensRequest || (exports.SemanticTokensRequest = {}));
98 var SemanticTokensDeltaRequest;
99 (function (SemanticTokensDeltaRequest) {
100 SemanticTokensDeltaRequest.method = 'textDocument/semanticTokens/full/delta';
101 SemanticTokensDeltaRequest.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest.method);
102 })(SemanticTokensDeltaRequest = exports.SemanticTokensDeltaRequest || (exports.SemanticTokensDeltaRequest = {}));
106 var SemanticTokensRangeRequest;
107 (function (SemanticTokensRangeRequest) {
108 SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';
109 SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);
110 })(SemanticTokensRangeRequest = exports.SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = {}));
114 var SemanticTokensRefreshRequest;
115 (function (SemanticTokensRefreshRequest) {
116 SemanticTokensRefreshRequest.method = `workspace/semanticTokens/refresh`;
117 SemanticTokensRefreshRequest.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest.method);
118 })(SemanticTokensRefreshRequest = exports.SemanticTokensRefreshRequest || (exports.SemanticTokensRefreshRequest = {}));
119 //# sourceMappingURL=protocol.semanticTokens.js.map