119 lines
5.8 KiB
JavaScript
119 lines
5.8 KiB
JavaScript
"use strict";
|
|
/* --------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
* ------------------------------------------------------------------------------------------ */
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.SemanticTokensRegistrationType = exports.TokenFormat = exports.SemanticTokens = exports.SemanticTokenModifiers = exports.SemanticTokenTypes = void 0;
|
|
const messages_1 = require("./messages");
|
|
/**
|
|
* A set of predefined token types. This set is not fixed
|
|
* an clients can specify additional token types via the
|
|
* corresponding client capabilities.
|
|
*
|
|
* @since 3.16.0
|
|
*/
|
|
var SemanticTokenTypes;
|
|
(function (SemanticTokenTypes) {
|
|
SemanticTokenTypes["namespace"] = "namespace";
|
|
/**
|
|
* Represents a generic type. Acts as a fallback for types which can't be mapped to
|
|
* a specific type like class or enum.
|
|
*/
|
|
SemanticTokenTypes["type"] = "type";
|
|
SemanticTokenTypes["class"] = "class";
|
|
SemanticTokenTypes["enum"] = "enum";
|
|
SemanticTokenTypes["interface"] = "interface";
|
|
SemanticTokenTypes["struct"] = "struct";
|
|
SemanticTokenTypes["typeParameter"] = "typeParameter";
|
|
SemanticTokenTypes["parameter"] = "parameter";
|
|
SemanticTokenTypes["variable"] = "variable";
|
|
SemanticTokenTypes["property"] = "property";
|
|
SemanticTokenTypes["enumMember"] = "enumMember";
|
|
SemanticTokenTypes["event"] = "event";
|
|
SemanticTokenTypes["function"] = "function";
|
|
SemanticTokenTypes["method"] = "method";
|
|
SemanticTokenTypes["macro"] = "macro";
|
|
SemanticTokenTypes["keyword"] = "keyword";
|
|
SemanticTokenTypes["modifier"] = "modifier";
|
|
SemanticTokenTypes["comment"] = "comment";
|
|
SemanticTokenTypes["string"] = "string";
|
|
SemanticTokenTypes["number"] = "number";
|
|
SemanticTokenTypes["regexp"] = "regexp";
|
|
SemanticTokenTypes["operator"] = "operator";
|
|
})(SemanticTokenTypes = exports.SemanticTokenTypes || (exports.SemanticTokenTypes = {}));
|
|
/**
|
|
* A set of predefined token modifiers. This set is not fixed
|
|
* an clients can specify additional token types via the
|
|
* corresponding client capabilities.
|
|
*
|
|
* @since 3.16.0
|
|
*/
|
|
var SemanticTokenModifiers;
|
|
(function (SemanticTokenModifiers) {
|
|
SemanticTokenModifiers["declaration"] = "declaration";
|
|
SemanticTokenModifiers["definition"] = "definition";
|
|
SemanticTokenModifiers["readonly"] = "readonly";
|
|
SemanticTokenModifiers["static"] = "static";
|
|
SemanticTokenModifiers["deprecated"] = "deprecated";
|
|
SemanticTokenModifiers["abstract"] = "abstract";
|
|
SemanticTokenModifiers["async"] = "async";
|
|
SemanticTokenModifiers["modification"] = "modification";
|
|
SemanticTokenModifiers["documentation"] = "documentation";
|
|
SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
|
|
})(SemanticTokenModifiers = exports.SemanticTokenModifiers || (exports.SemanticTokenModifiers = {}));
|
|
/**
|
|
* @since 3.16.0
|
|
*/
|
|
var SemanticTokens;
|
|
(function (SemanticTokens) {
|
|
function is(value) {
|
|
const candidate = value;
|
|
return candidate !== undefined && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&
|
|
Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
|
|
}
|
|
SemanticTokens.is = is;
|
|
})(SemanticTokens = exports.SemanticTokens || (exports.SemanticTokens = {}));
|
|
//------- 'textDocument/semanticTokens' -----
|
|
var TokenFormat;
|
|
(function (TokenFormat) {
|
|
TokenFormat.Relative = 'relative';
|
|
})(TokenFormat = exports.TokenFormat || (exports.TokenFormat = {}));
|
|
var SemanticTokensRegistrationType;
|
|
(function (SemanticTokensRegistrationType) {
|
|
SemanticTokensRegistrationType.method = 'textDocument/semanticTokens';
|
|
SemanticTokensRegistrationType.type = new messages_1.RegistrationType(SemanticTokensRegistrationType.method);
|
|
})(SemanticTokensRegistrationType = exports.SemanticTokensRegistrationType || (exports.SemanticTokensRegistrationType = {}));
|
|
/**
|
|
* @since 3.16.0
|
|
*/
|
|
var SemanticTokensRequest;
|
|
(function (SemanticTokensRequest) {
|
|
SemanticTokensRequest.method = 'textDocument/semanticTokens/full';
|
|
SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);
|
|
})(SemanticTokensRequest = exports.SemanticTokensRequest || (exports.SemanticTokensRequest = {}));
|
|
/**
|
|
* @since 3.16.0
|
|
*/
|
|
var SemanticTokensDeltaRequest;
|
|
(function (SemanticTokensDeltaRequest) {
|
|
SemanticTokensDeltaRequest.method = 'textDocument/semanticTokens/full/delta';
|
|
SemanticTokensDeltaRequest.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest.method);
|
|
})(SemanticTokensDeltaRequest = exports.SemanticTokensDeltaRequest || (exports.SemanticTokensDeltaRequest = {}));
|
|
/**
|
|
* @since 3.16.0
|
|
*/
|
|
var SemanticTokensRangeRequest;
|
|
(function (SemanticTokensRangeRequest) {
|
|
SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';
|
|
SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);
|
|
})(SemanticTokensRangeRequest = exports.SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = {}));
|
|
/**
|
|
* @since 3.16.0
|
|
*/
|
|
var SemanticTokensRefreshRequest;
|
|
(function (SemanticTokensRefreshRequest) {
|
|
SemanticTokensRefreshRequest.method = `workspace/semanticTokens/refresh`;
|
|
SemanticTokensRefreshRequest.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest.method);
|
|
})(SemanticTokensRefreshRequest = exports.SemanticTokensRefreshRequest || (exports.SemanticTokensRefreshRequest = {}));
|
|
//# sourceMappingURL=protocol.semanticTokens.js.map
|