This commit is contained in:
10
node_modules/yaml-language-server/lib/esm/languageserver/commandExecutor.d.ts
generated
vendored
Normal file
10
node_modules/yaml-language-server/lib/esm/languageserver/commandExecutor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ExecuteCommandParams } from 'vscode-languageserver-protocol';
|
||||
export interface CommandHandler {
|
||||
(...args: unknown[]): void;
|
||||
}
|
||||
export declare class CommandExecutor {
|
||||
private commands;
|
||||
executeCommand(params: ExecuteCommandParams): void;
|
||||
registerCommand(commandId: string, handler: CommandHandler): void;
|
||||
}
|
||||
export declare const commandExecutor: CommandExecutor;
|
||||
21
node_modules/yaml-language-server/lib/esm/languageserver/commandExecutor.js
generated
vendored
Normal file
21
node_modules/yaml-language-server/lib/esm/languageserver/commandExecutor.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
export class CommandExecutor {
|
||||
constructor() {
|
||||
this.commands = new Map();
|
||||
}
|
||||
executeCommand(params) {
|
||||
if (this.commands.has(params.command)) {
|
||||
const handler = this.commands.get(params.command);
|
||||
return handler(...params.arguments);
|
||||
}
|
||||
throw new Error(`Command '${params.command}' not found`);
|
||||
}
|
||||
registerCommand(commandId, handler) {
|
||||
this.commands.set(commandId, handler);
|
||||
}
|
||||
}
|
||||
export const commandExecutor = new CommandExecutor();
|
||||
//# sourceMappingURL=commandExecutor.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/commandExecutor.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/commandExecutor.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"commandExecutor.js","sourceRoot":"","sources":["../../../src/languageserver/commandExecutor.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAQhG,MAAM,OAAO,eAAe;IAA5B;QACU,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;IAYvD,CAAC;IAXC,cAAc,CAAC,MAA4B;QACzC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;YACrC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAClD,OAAO,OAAO,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;SACrC;QACD,MAAM,IAAI,KAAK,CAAC,YAAY,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;IAC3D,CAAC;IAED,eAAe,CAAC,SAAiB,EAAE,OAAuB;QACxD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC"}
|
||||
58
node_modules/yaml-language-server/lib/esm/languageserver/handlers/languageHandlers.d.ts
generated
vendored
Normal file
58
node_modules/yaml-language-server/lib/esm/languageserver/handlers/languageHandlers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/// <reference types="node" />
|
||||
import { Connection } from 'vscode-languageserver';
|
||||
import { CodeActionParams, DidChangeWatchedFilesParams, DocumentFormattingParams, DocumentLinkParams, DocumentOnTypeFormattingParams, DocumentSymbolParams, FoldingRangeParams, SelectionRangeParams, TextDocumentPositionParams, CodeLensParams, DefinitionParams } from 'vscode-languageserver-protocol';
|
||||
import { CodeAction, CodeLens, CompletionList, DefinitionLink, DocumentLink, DocumentSymbol, Hover, FoldingRange, SelectionRange, SymbolInformation, TextEdit } from 'vscode-languageserver-types';
|
||||
import { LanguageService } from '../../languageservice/yamlLanguageService';
|
||||
import { SettingsState } from '../../yamlSettings';
|
||||
import { ValidationHandler } from './validationHandlers';
|
||||
export declare class LanguageHandlers {
|
||||
private readonly connection;
|
||||
private languageService;
|
||||
private yamlSettings;
|
||||
private validationHandler;
|
||||
pendingLimitExceededWarnings: {
|
||||
[uri: string]: {
|
||||
features: {
|
||||
[name: string]: string;
|
||||
};
|
||||
timeout?: NodeJS.Timeout;
|
||||
};
|
||||
};
|
||||
constructor(connection: Connection, languageService: LanguageService, yamlSettings: SettingsState, validationHandler: ValidationHandler);
|
||||
registerHandlers(): void;
|
||||
documentLinkHandler(params: DocumentLinkParams): Promise<DocumentLink[]>;
|
||||
/**
|
||||
* Called when the code outline in an editor needs to be populated
|
||||
* Returns a list of symbols that is then shown in the code outline
|
||||
*/
|
||||
documentSymbolHandler(documentSymbolParams: DocumentSymbolParams): DocumentSymbol[] | SymbolInformation[];
|
||||
/**
|
||||
* Called when the formatter is invoked
|
||||
* Returns the formatted document content using prettier
|
||||
*/
|
||||
formatterHandler(formatParams: DocumentFormattingParams): TextEdit[];
|
||||
formatOnTypeHandler(params: DocumentOnTypeFormattingParams): Promise<TextEdit[] | undefined> | TextEdit[] | undefined;
|
||||
/**
|
||||
* Called when the user hovers with their mouse over a keyword
|
||||
* Returns an informational tooltip
|
||||
*/
|
||||
hoverHandler(textDocumentPositionParams: TextDocumentPositionParams): Promise<Hover>;
|
||||
/**
|
||||
* Called when auto-complete is triggered in an editor
|
||||
* Returns a list of valid completion items
|
||||
*/
|
||||
completionHandler(textDocumentPosition: TextDocumentPositionParams): Promise<CompletionList>;
|
||||
/**
|
||||
* Called when a monitored file is changed in an editor
|
||||
* Re-validates the entire document
|
||||
*/
|
||||
watchedFilesHandler(change: DidChangeWatchedFilesParams): void;
|
||||
foldingRangeHandler(params: FoldingRangeParams): Promise<FoldingRange[] | undefined> | FoldingRange[] | undefined;
|
||||
selectionRangeHandler(params: SelectionRangeParams): SelectionRange[] | undefined;
|
||||
codeActionHandler(params: CodeActionParams): CodeAction[] | undefined;
|
||||
codeLensHandler(params: CodeLensParams): PromiseLike<CodeLens[] | undefined> | CodeLens[] | undefined;
|
||||
codeLensResolveHandler(param: CodeLens): PromiseLike<CodeLens> | CodeLens;
|
||||
definitionHandler(params: DefinitionParams): DefinitionLink[];
|
||||
private cancelLimitExceededWarnings;
|
||||
private onResultLimitExceeded;
|
||||
}
|
||||
198
node_modules/yaml-language-server/lib/esm/languageserver/handlers/languageHandlers.js
generated
vendored
Normal file
198
node_modules/yaml-language-server/lib/esm/languageserver/handlers/languageHandlers.js
generated
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { isKubernetesAssociatedDocument } from '../../languageservice/parser/isKubernetes';
|
||||
import { ResultLimitReachedNotification } from '../../requestTypes';
|
||||
import * as path from 'path';
|
||||
export class LanguageHandlers {
|
||||
constructor(connection, languageService, yamlSettings, validationHandler) {
|
||||
this.connection = connection;
|
||||
this.languageService = languageService;
|
||||
this.yamlSettings = yamlSettings;
|
||||
this.validationHandler = validationHandler;
|
||||
this.pendingLimitExceededWarnings = {};
|
||||
}
|
||||
registerHandlers() {
|
||||
this.connection.onDocumentLinks((params) => this.documentLinkHandler(params));
|
||||
this.connection.onDocumentSymbol((documentSymbolParams) => this.documentSymbolHandler(documentSymbolParams));
|
||||
this.connection.onDocumentFormatting((formatParams) => this.formatterHandler(formatParams));
|
||||
this.connection.onHover((textDocumentPositionParams) => this.hoverHandler(textDocumentPositionParams));
|
||||
this.connection.onCompletion((textDocumentPosition) => this.completionHandler(textDocumentPosition));
|
||||
this.connection.onDidChangeWatchedFiles((change) => this.watchedFilesHandler(change));
|
||||
this.connection.onFoldingRanges((params) => this.foldingRangeHandler(params));
|
||||
this.connection.onSelectionRanges((params) => this.selectionRangeHandler(params));
|
||||
this.connection.onCodeAction((params) => this.codeActionHandler(params));
|
||||
this.connection.onDocumentOnTypeFormatting((params) => this.formatOnTypeHandler(params));
|
||||
this.connection.onCodeLens((params) => this.codeLensHandler(params));
|
||||
this.connection.onCodeLensResolve((params) => this.codeLensResolveHandler(params));
|
||||
this.connection.onDefinition((params) => this.definitionHandler(params));
|
||||
this.yamlSettings.documents.onDidChangeContent((change) => this.cancelLimitExceededWarnings(change.document.uri));
|
||||
this.yamlSettings.documents.onDidClose((event) => this.cancelLimitExceededWarnings(event.document.uri));
|
||||
}
|
||||
documentLinkHandler(params) {
|
||||
const document = this.yamlSettings.documents.get(params.textDocument.uri);
|
||||
if (!document) {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
return this.languageService.findLinks(document);
|
||||
}
|
||||
/**
|
||||
* Called when the code outline in an editor needs to be populated
|
||||
* Returns a list of symbols that is then shown in the code outline
|
||||
*/
|
||||
documentSymbolHandler(documentSymbolParams) {
|
||||
const document = this.yamlSettings.documents.get(documentSymbolParams.textDocument.uri);
|
||||
if (!document) {
|
||||
return;
|
||||
}
|
||||
const onResultLimitExceeded = this.onResultLimitExceeded(document.uri, this.yamlSettings.maxItemsComputed, 'document symbols');
|
||||
const context = { resultLimit: this.yamlSettings.maxItemsComputed, onResultLimitExceeded };
|
||||
if (this.yamlSettings.hierarchicalDocumentSymbolSupport) {
|
||||
return this.languageService.findDocumentSymbols2(document, context);
|
||||
}
|
||||
else {
|
||||
return this.languageService.findDocumentSymbols(document, context);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Called when the formatter is invoked
|
||||
* Returns the formatted document content using prettier
|
||||
*/
|
||||
formatterHandler(formatParams) {
|
||||
const document = this.yamlSettings.documents.get(formatParams.textDocument.uri);
|
||||
if (!document) {
|
||||
return;
|
||||
}
|
||||
const customFormatterSettings = {
|
||||
tabWidth: formatParams.options.tabSize,
|
||||
...this.yamlSettings.yamlFormatterSettings,
|
||||
};
|
||||
return this.languageService.doFormat(document, customFormatterSettings);
|
||||
}
|
||||
formatOnTypeHandler(params) {
|
||||
const document = this.yamlSettings.documents.get(params.textDocument.uri);
|
||||
if (!document) {
|
||||
return;
|
||||
}
|
||||
return this.languageService.doDocumentOnTypeFormatting(document, params);
|
||||
}
|
||||
/**
|
||||
* Called when the user hovers with their mouse over a keyword
|
||||
* Returns an informational tooltip
|
||||
*/
|
||||
hoverHandler(textDocumentPositionParams) {
|
||||
const document = this.yamlSettings.documents.get(textDocumentPositionParams.textDocument.uri);
|
||||
if (!document) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
return this.languageService.doHover(document, textDocumentPositionParams.position);
|
||||
}
|
||||
/**
|
||||
* Called when auto-complete is triggered in an editor
|
||||
* Returns a list of valid completion items
|
||||
*/
|
||||
completionHandler(textDocumentPosition) {
|
||||
const textDocument = this.yamlSettings.documents.get(textDocumentPosition.textDocument.uri);
|
||||
const result = {
|
||||
items: [],
|
||||
isIncomplete: false,
|
||||
};
|
||||
if (!textDocument) {
|
||||
return Promise.resolve(result);
|
||||
}
|
||||
return this.languageService.doComplete(textDocument, textDocumentPosition.position, isKubernetesAssociatedDocument(textDocument, this.yamlSettings.specificValidatorPaths));
|
||||
}
|
||||
/**
|
||||
* Called when a monitored file is changed in an editor
|
||||
* Re-validates the entire document
|
||||
*/
|
||||
watchedFilesHandler(change) {
|
||||
let hasChanges = false;
|
||||
change.changes.forEach((c) => {
|
||||
if (this.languageService.resetSchema(c.uri)) {
|
||||
hasChanges = true;
|
||||
}
|
||||
});
|
||||
if (hasChanges) {
|
||||
this.yamlSettings.documents.all().forEach((document) => this.validationHandler.validate(document));
|
||||
}
|
||||
}
|
||||
foldingRangeHandler(params) {
|
||||
const textDocument = this.yamlSettings.documents.get(params.textDocument.uri);
|
||||
if (!textDocument) {
|
||||
return;
|
||||
}
|
||||
const capabilities = this.yamlSettings.capabilities.textDocument.foldingRange;
|
||||
const rangeLimit = this.yamlSettings.maxItemsComputed || capabilities.rangeLimit;
|
||||
const onRangeLimitExceeded = this.onResultLimitExceeded(textDocument.uri, rangeLimit, 'folding ranges');
|
||||
const context = {
|
||||
rangeLimit,
|
||||
onRangeLimitExceeded,
|
||||
lineFoldingOnly: capabilities.lineFoldingOnly,
|
||||
};
|
||||
return this.languageService.getFoldingRanges(textDocument, context);
|
||||
}
|
||||
selectionRangeHandler(params) {
|
||||
const textDocument = this.yamlSettings.documents.get(params.textDocument.uri);
|
||||
if (!textDocument) {
|
||||
return;
|
||||
}
|
||||
return this.languageService.getSelectionRanges(textDocument, params.positions);
|
||||
}
|
||||
codeActionHandler(params) {
|
||||
const textDocument = this.yamlSettings.documents.get(params.textDocument.uri);
|
||||
if (!textDocument) {
|
||||
return;
|
||||
}
|
||||
return this.languageService.getCodeAction(textDocument, params);
|
||||
}
|
||||
codeLensHandler(params) {
|
||||
const textDocument = this.yamlSettings.documents.get(params.textDocument.uri);
|
||||
if (!textDocument) {
|
||||
return;
|
||||
}
|
||||
return this.languageService.getCodeLens(textDocument);
|
||||
}
|
||||
codeLensResolveHandler(param) {
|
||||
return this.languageService.resolveCodeLens(param);
|
||||
}
|
||||
definitionHandler(params) {
|
||||
const textDocument = this.yamlSettings.documents.get(params.textDocument.uri);
|
||||
if (!textDocument) {
|
||||
return;
|
||||
}
|
||||
return this.languageService.doDefinition(textDocument, params);
|
||||
}
|
||||
// Adapted from:
|
||||
// https://github.com/microsoft/vscode/blob/94c9ea46838a9a619aeafb7e8afd1170c967bb55/extensions/json-language-features/server/src/jsonServer.ts#L172
|
||||
cancelLimitExceededWarnings(uri) {
|
||||
const warning = this.pendingLimitExceededWarnings[uri];
|
||||
if (warning && warning.timeout) {
|
||||
clearTimeout(warning.timeout);
|
||||
delete this.pendingLimitExceededWarnings[uri];
|
||||
}
|
||||
}
|
||||
onResultLimitExceeded(uri, resultLimit, name) {
|
||||
return () => {
|
||||
let warning = this.pendingLimitExceededWarnings[uri];
|
||||
if (warning) {
|
||||
if (!warning.timeout) {
|
||||
// already shown
|
||||
return;
|
||||
}
|
||||
warning.features[name] = name;
|
||||
warning.timeout.refresh();
|
||||
}
|
||||
else {
|
||||
warning = { features: { [name]: name } };
|
||||
warning.timeout = setTimeout(() => {
|
||||
this.connection.sendNotification(ResultLimitReachedNotification.type, `${path.basename(uri)}: For performance reasons, ${Object.keys(warning.features).join(' and ')} have been limited to ${resultLimit} items.`);
|
||||
warning.timeout = undefined;
|
||||
}, 2000);
|
||||
this.pendingLimitExceededWarnings[uri] = warning;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=languageHandlers.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/languageHandlers.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/languageHandlers.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
29
node_modules/yaml-language-server/lib/esm/languageserver/handlers/notificationHandlers.d.ts
generated
vendored
Normal file
29
node_modules/yaml-language-server/lib/esm/languageserver/handlers/notificationHandlers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Connection } from 'vscode-languageserver';
|
||||
import { LanguageService } from '../../languageservice/yamlLanguageService';
|
||||
import { SettingsState } from '../../yamlSettings';
|
||||
import { SettingsHandler } from './settingsHandlers';
|
||||
export declare class NotificationHandlers {
|
||||
private readonly connection;
|
||||
private languageService;
|
||||
private yamlSettings;
|
||||
private settingsHandler;
|
||||
constructor(connection: Connection, languageService: LanguageService, yamlSettings: SettingsState, settingsHandler: SettingsHandler);
|
||||
registerHandlers(): void;
|
||||
/**
|
||||
* Received a notification from the client with schema associations from other extensions
|
||||
* Update the associations in the server
|
||||
*/
|
||||
private schemaAssociationNotificationHandler;
|
||||
/**
|
||||
* Received a notification from the client that it can accept custom schema requests
|
||||
* Register the custom schema provider and use it for requests of unknown scheme
|
||||
*/
|
||||
private dynamicSchemaRequestHandler;
|
||||
/**
|
||||
* Received a notification from the client that it can accept content requests
|
||||
* This means that the server sends schemas back to the client side to get resolved rather
|
||||
* than resolving them on the extension side
|
||||
*/
|
||||
private vscodeContentRequestHandler;
|
||||
private schemaSelectionRequestHandler;
|
||||
}
|
||||
46
node_modules/yaml-language-server/lib/esm/languageserver/handlers/notificationHandlers.js
generated
vendored
Normal file
46
node_modules/yaml-language-server/lib/esm/languageserver/handlers/notificationHandlers.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import { CustomSchemaRequest, DynamicCustomSchemaRequestRegistration, SchemaAssociationNotification, SchemaSelectionRequests, VSCodeContentRequestRegistration, } from '../../requestTypes';
|
||||
export class NotificationHandlers {
|
||||
constructor(connection, languageService, yamlSettings, settingsHandler) {
|
||||
this.connection = connection;
|
||||
this.languageService = languageService;
|
||||
this.yamlSettings = yamlSettings;
|
||||
this.settingsHandler = settingsHandler;
|
||||
}
|
||||
registerHandlers() {
|
||||
this.connection.onNotification(SchemaAssociationNotification.type, (associations) => this.schemaAssociationNotificationHandler(associations));
|
||||
this.connection.onNotification(DynamicCustomSchemaRequestRegistration.type, () => this.dynamicSchemaRequestHandler());
|
||||
this.connection.onNotification(VSCodeContentRequestRegistration.type, () => this.vscodeContentRequestHandler());
|
||||
this.connection.onNotification(SchemaSelectionRequests.type, () => this.schemaSelectionRequestHandler());
|
||||
}
|
||||
/**
|
||||
* Received a notification from the client with schema associations from other extensions
|
||||
* Update the associations in the server
|
||||
*/
|
||||
schemaAssociationNotificationHandler(associations) {
|
||||
this.yamlSettings.schemaAssociations = associations;
|
||||
this.yamlSettings.specificValidatorPaths = [];
|
||||
this.settingsHandler.pullConfiguration().catch((error) => console.log(error));
|
||||
}
|
||||
/**
|
||||
* Received a notification from the client that it can accept custom schema requests
|
||||
* Register the custom schema provider and use it for requests of unknown scheme
|
||||
*/
|
||||
dynamicSchemaRequestHandler() {
|
||||
const schemaProvider = ((resource) => {
|
||||
return this.connection.sendRequest(CustomSchemaRequest.type, resource);
|
||||
});
|
||||
this.languageService.registerCustomSchemaProvider(schemaProvider);
|
||||
}
|
||||
/**
|
||||
* Received a notification from the client that it can accept content requests
|
||||
* This means that the server sends schemas back to the client side to get resolved rather
|
||||
* than resolving them on the extension side
|
||||
*/
|
||||
vscodeContentRequestHandler() {
|
||||
this.yamlSettings.useVSCodeContentRequest = true;
|
||||
}
|
||||
schemaSelectionRequestHandler() {
|
||||
this.yamlSettings.useSchemaSelectionRequests = true;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=notificationHandlers.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/notificationHandlers.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/notificationHandlers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"notificationHandlers.js","sourceRoot":"","sources":["../../../../src/languageserver/handlers/notificationHandlers.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EACtC,6BAA6B,EAC7B,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,oBAAoB,CAAC;AAI5B,MAAM,OAAO,oBAAoB;IAK/B,YACmB,UAAsB,EACvC,eAAgC,EAChC,YAA2B,EAC3B,eAAgC;QAHf,eAAU,GAAV,UAAU,CAAY;QAKvC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAEM,gBAAgB;QACrB,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,6BAA6B,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE,CAClF,IAAI,CAAC,oCAAoC,CAAC,YAAY,CAAC,CACxD,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,sCAAsC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,CAAC;QACtH,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,gCAAgC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,CAAC;QAChH,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,uBAAuB,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,6BAA6B,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACK,oCAAoC,CAAC,YAA8D;QACzG,IAAI,CAAC,YAAY,CAAC,kBAAkB,GAAG,YAAY,CAAC;QACpD,IAAI,CAAC,YAAY,CAAC,sBAAsB,GAAG,EAAE,CAAC;QAC9C,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;;OAGG;IACK,2BAA2B;QACjC,MAAM,cAAc,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;YACnC,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACzE,CAAC,CAAyB,CAAC;QAC3B,IAAI,CAAC,eAAe,CAAC,4BAA4B,CAAC,cAAc,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACK,2BAA2B;QACjC,IAAI,CAAC,YAAY,CAAC,uBAAuB,GAAG,IAAI,CAAC;IACnD,CAAC;IAEO,6BAA6B;QACnC,IAAI,CAAC,YAAY,CAAC,0BAA0B,GAAG,IAAI,CAAC;IACtD,CAAC;CACF"}
|
||||
9
node_modules/yaml-language-server/lib/esm/languageserver/handlers/requestHandlers.d.ts
generated
vendored
Normal file
9
node_modules/yaml-language-server/lib/esm/languageserver/handlers/requestHandlers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Connection } from 'vscode-languageserver';
|
||||
import { LanguageService } from '../../languageservice/yamlLanguageService';
|
||||
export declare class RequestHandlers {
|
||||
private readonly connection;
|
||||
private languageService;
|
||||
constructor(connection: Connection, languageService: LanguageService);
|
||||
registerHandlers(): void;
|
||||
private registerSchemaModificationNotificationHandler;
|
||||
}
|
||||
23
node_modules/yaml-language-server/lib/esm/languageserver/handlers/requestHandlers.js
generated
vendored
Normal file
23
node_modules/yaml-language-server/lib/esm/languageserver/handlers/requestHandlers.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { MODIFICATION_ACTIONS, } from '../../languageservice/services/yamlSchemaService';
|
||||
import { SchemaModificationNotification } from '../../requestTypes';
|
||||
export class RequestHandlers {
|
||||
constructor(connection, languageService) {
|
||||
this.connection = connection;
|
||||
this.languageService = languageService;
|
||||
}
|
||||
registerHandlers() {
|
||||
this.connection.onRequest(SchemaModificationNotification.type, (modifications) => this.registerSchemaModificationNotificationHandler(modifications));
|
||||
}
|
||||
registerSchemaModificationNotificationHandler(modifications) {
|
||||
if (modifications.action === MODIFICATION_ACTIONS.add) {
|
||||
this.languageService.modifySchemaContent(modifications);
|
||||
}
|
||||
else if (modifications.action === MODIFICATION_ACTIONS.delete) {
|
||||
this.languageService.deleteSchemaContent(modifications);
|
||||
}
|
||||
else if (modifications.action === MODIFICATION_ACTIONS.deleteAll) {
|
||||
this.languageService.deleteSchemasWhole(modifications);
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=requestHandlers.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/requestHandlers.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/requestHandlers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"requestHandlers.js","sourceRoot":"","sources":["../../../../src/languageserver/handlers/requestHandlers.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,oBAAoB,GAIrB,MAAM,kDAAkD,CAAC;AAE1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,OAAO,eAAe;IAE1B,YAA6B,UAAsB,EAAE,eAAgC;QAAxD,eAAU,GAAV,UAAU,CAAY;QACjD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAEM,gBAAgB;QACrB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,8BAA8B,CAAC,IAAI,EAAE,CAAC,aAAa,EAAE,EAAE,CAC/E,IAAI,CAAC,6CAA6C,CAAC,aAAa,CAAC,CAClE,CAAC;IACJ,CAAC;IAEO,6CAA6C,CACnD,aAAqE;QAErE,IAAI,aAAa,CAAC,MAAM,KAAK,oBAAoB,CAAC,GAAG,EAAE;YACrD,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;SACzD;aAAM,IAAI,aAAa,CAAC,MAAM,KAAK,oBAAoB,CAAC,MAAM,EAAE;YAC/D,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;SACzD;aAAM,IAAI,aAAa,CAAC,MAAM,KAAK,oBAAoB,CAAC,SAAS,EAAE;YAClE,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;SACxD;IACH,CAAC;CACF"}
|
||||
13
node_modules/yaml-language-server/lib/esm/languageserver/handlers/schemaSelectionHandlers.d.ts
generated
vendored
Normal file
13
node_modules/yaml-language-server/lib/esm/languageserver/handlers/schemaSelectionHandlers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Connection } from 'vscode-languageserver/node';
|
||||
import { YAMLSchemaService } from '../../languageservice/services/yamlSchemaService';
|
||||
import { SettingsState } from '../../yamlSettings';
|
||||
import { JSONSchemaDescription, JSONSchemaDescriptionExt } from '../../requestTypes';
|
||||
export declare class JSONSchemaSelection {
|
||||
private readonly schemaService;
|
||||
private readonly yamlSettings?;
|
||||
private readonly connection?;
|
||||
constructor(schemaService: YAMLSchemaService, yamlSettings?: SettingsState, connection?: Connection);
|
||||
getSchemas(docUri: string): Promise<JSONSchemaDescription[]>;
|
||||
private getSchemasForFile;
|
||||
getAllSchemas(docUri: string): Promise<JSONSchemaDescriptionExt[]>;
|
||||
}
|
||||
72
node_modules/yaml-language-server/lib/esm/languageserver/handlers/schemaSelectionHandlers.js
generated
vendored
Normal file
72
node_modules/yaml-language-server/lib/esm/languageserver/handlers/schemaSelectionHandlers.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { yamlDocumentsCache } from '../../languageservice/parser/yaml-documents';
|
||||
import { getSchemaUrls } from '../../languageservice/utils/schemaUrls';
|
||||
import { SchemaSelectionRequests } from '../../requestTypes';
|
||||
export class JSONSchemaSelection {
|
||||
constructor(schemaService, yamlSettings, connection) {
|
||||
this.schemaService = schemaService;
|
||||
this.yamlSettings = yamlSettings;
|
||||
this.connection = connection;
|
||||
this.connection?.onRequest(SchemaSelectionRequests.getSchema, (fileUri) => {
|
||||
return this.getSchemas(fileUri);
|
||||
});
|
||||
this.connection?.onRequest(SchemaSelectionRequests.getAllSchemas, (fileUri) => {
|
||||
return this.getAllSchemas(fileUri);
|
||||
});
|
||||
}
|
||||
async getSchemas(docUri) {
|
||||
const schemas = await this.getSchemasForFile(docUri);
|
||||
return Array.from(schemas).map((val) => {
|
||||
return {
|
||||
name: val[1].title,
|
||||
uri: val[0],
|
||||
description: val[1].description,
|
||||
versions: val[1].versions,
|
||||
};
|
||||
});
|
||||
}
|
||||
async getSchemasForFile(docUri) {
|
||||
const document = this.yamlSettings?.documents.get(docUri);
|
||||
const schemas = new Map();
|
||||
if (!document) {
|
||||
return schemas;
|
||||
}
|
||||
const yamlDoc = yamlDocumentsCache.getYamlDocument(document);
|
||||
for (const currentYAMLDoc of yamlDoc.documents) {
|
||||
const schema = await this.schemaService.getSchemaForResource(document.uri, currentYAMLDoc);
|
||||
if (schema?.schema) {
|
||||
const schemaUrls = getSchemaUrls(schema?.schema);
|
||||
if (schemaUrls.size === 0) {
|
||||
continue;
|
||||
}
|
||||
for (const urlToSchema of schemaUrls) {
|
||||
schemas.set(urlToSchema[0], urlToSchema[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return schemas;
|
||||
}
|
||||
async getAllSchemas(docUri) {
|
||||
const fileSchemas = await this.getSchemasForFile(docUri);
|
||||
const fileSchemasHandle = Array.from(fileSchemas.entries()).map((val) => {
|
||||
return {
|
||||
uri: val[0],
|
||||
fromStore: false,
|
||||
usedForCurrentFile: true,
|
||||
name: val[1].title,
|
||||
description: val[1].description,
|
||||
versions: val[1].versions,
|
||||
};
|
||||
});
|
||||
const result = [];
|
||||
let allSchemas = this.schemaService.getAllSchemas();
|
||||
allSchemas = allSchemas.filter((val) => !fileSchemas.has(val.uri));
|
||||
result.push(...fileSchemasHandle);
|
||||
result.push(...allSchemas);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=schemaSelectionHandlers.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/schemaSelectionHandlers.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/schemaSelectionHandlers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schemaSelectionHandlers.js","sourceRoot":"","sources":["../../../../src/languageserver/handlers/schemaSelectionHandlers.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAAmD,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE9G,MAAM,OAAO,mBAAmB;IAC9B,YACmB,aAAgC,EAChC,YAA4B,EAC5B,UAAuB;QAFvB,kBAAa,GAAb,aAAa,CAAmB;QAChC,iBAAY,GAAZ,YAAY,CAAgB;QAC5B,eAAU,GAAV,UAAU,CAAa;QAExC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,uBAAuB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YACxE,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,uBAAuB,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE;YAC5E,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc;QAC7B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACrD,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACrC,OAAO;gBACL,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;gBAClB,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;gBACX,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW;gBAC/B,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ;aAC1B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,MAAc;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;QAC9C,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,OAAO,CAAC;SAChB;QAED,MAAM,OAAO,GAAG,kBAAkB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAE7D,KAAK,MAAM,cAAc,IAAI,OAAO,CAAC,SAAS,EAAE;YAC9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAC3F,IAAI,MAAM,EAAE,MAAM,EAAE;gBAClB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBACjD,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,EAAE;oBACzB,SAAS;iBACV;gBACD,KAAK,MAAM,WAAW,IAAI,UAAU,EAAE;oBACpC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC7C;aACF;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAc;QAChC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACzD,MAAM,iBAAiB,GAA+B,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAClG,OAAO;gBACL,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;gBACX,SAAS,EAAE,KAAK;gBAChB,kBAAkB,EAAE,IAAI;gBACxB,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;gBAClB,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW;gBAC/B,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ;aAC1B,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAI,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;QACpD,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,MAAM,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;QAE3B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
||||
42
node_modules/yaml-language-server/lib/esm/languageserver/handlers/settingsHandlers.d.ts
generated
vendored
Normal file
42
node_modules/yaml-language-server/lib/esm/languageserver/handlers/settingsHandlers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Connection } from 'vscode-languageserver';
|
||||
import { LanguageService } from '../../languageservice/yamlLanguageService';
|
||||
import { SettingsState } from '../../yamlSettings';
|
||||
import { Telemetry } from '../../languageservice/telemetry';
|
||||
import { ValidationHandler } from './validationHandlers';
|
||||
export declare class SettingsHandler {
|
||||
private readonly connection;
|
||||
private readonly languageService;
|
||||
private readonly yamlSettings;
|
||||
private readonly validationHandler;
|
||||
private readonly telemetry;
|
||||
constructor(connection: Connection, languageService: LanguageService, yamlSettings: SettingsState, validationHandler: ValidationHandler, telemetry: Telemetry);
|
||||
registerHandlers(): Promise<void>;
|
||||
/**
|
||||
* The server pull the 'yaml', 'http.proxy', 'http.proxyStrictSSL', '[yaml]' settings sections
|
||||
*/
|
||||
pullConfiguration(): Promise<void>;
|
||||
private setConfiguration;
|
||||
/**
|
||||
* This function helps set the schema store if it hasn't already been set
|
||||
* AND the schema store setting is enabled. If the schema store setting
|
||||
* is not enabled we need to clear the schemas.
|
||||
*/
|
||||
private setSchemaStoreSettingsIfNotSet;
|
||||
/**
|
||||
* When the schema store is enabled, download and store YAML schema associations
|
||||
*/
|
||||
private getSchemaStoreMatchingSchemas;
|
||||
/**
|
||||
* Called when server settings or schema associations are changed
|
||||
* Re-creates schema associations and re-validates any open YAML files
|
||||
*/
|
||||
private updateConfiguration;
|
||||
/**
|
||||
* Stores schema associations in server settings, handling kubernetes
|
||||
* @param uri string path to schema (whether local or online)
|
||||
* @param fileMatch file pattern to apply the schema to
|
||||
* @param schema schema id
|
||||
* @param languageSettings current server settings
|
||||
*/
|
||||
private configureSchemas;
|
||||
}
|
||||
299
node_modules/yaml-language-server/lib/esm/languageserver/handlers/settingsHandlers.js
generated
vendored
Normal file
299
node_modules/yaml-language-server/lib/esm/languageserver/handlers/settingsHandlers.js
generated
vendored
Normal file
@@ -0,0 +1,299 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { configure as configureHttpRequests, xhr } from 'request-light';
|
||||
import { DidChangeConfigurationNotification, DocumentFormattingRequest } from 'vscode-languageserver';
|
||||
import { convertErrorToTelemetryMsg } from '../../languageservice/utils/objects';
|
||||
import { isRelativePath, relativeToAbsolutePath } from '../../languageservice/utils/paths';
|
||||
import { checkSchemaURI, JSON_SCHEMASTORE_URL, KUBERNETES_SCHEMA_URL } from '../../languageservice/utils/schemaUrls';
|
||||
import { SchemaPriority } from '../../languageservice/yamlLanguageService';
|
||||
import { SchemaSelectionRequests } from '../../requestTypes';
|
||||
export class SettingsHandler {
|
||||
constructor(connection, languageService, yamlSettings, validationHandler, telemetry) {
|
||||
this.connection = connection;
|
||||
this.languageService = languageService;
|
||||
this.yamlSettings = yamlSettings;
|
||||
this.validationHandler = validationHandler;
|
||||
this.telemetry = telemetry;
|
||||
}
|
||||
async registerHandlers() {
|
||||
if (this.yamlSettings.hasConfigurationCapability && this.yamlSettings.clientDynamicRegisterSupport) {
|
||||
try {
|
||||
// Register for all configuration changes.
|
||||
await this.connection.client.register(DidChangeConfigurationNotification.type);
|
||||
}
|
||||
catch (err) {
|
||||
this.telemetry.sendError('yaml.settings.error', { error: convertErrorToTelemetryMsg(err) });
|
||||
}
|
||||
}
|
||||
this.connection.onDidChangeConfiguration(() => this.pullConfiguration());
|
||||
}
|
||||
/**
|
||||
* The server pull the 'yaml', 'http.proxy', 'http.proxyStrictSSL', '[yaml]' settings sections
|
||||
*/
|
||||
async pullConfiguration() {
|
||||
const config = await this.connection.workspace.getConfiguration([
|
||||
{ section: 'yaml' },
|
||||
{ section: 'http' },
|
||||
{ section: '[yaml]' },
|
||||
{ section: 'editor' },
|
||||
{ section: 'files' },
|
||||
]);
|
||||
const settings = {
|
||||
yaml: config[0],
|
||||
http: {
|
||||
proxy: config[1]?.proxy ?? '',
|
||||
proxyStrictSSL: config[1]?.proxyStrictSSL ?? false,
|
||||
},
|
||||
yamlEditor: config[2],
|
||||
vscodeEditor: config[3],
|
||||
files: config[4],
|
||||
};
|
||||
await this.setConfiguration(settings);
|
||||
}
|
||||
async setConfiguration(settings) {
|
||||
configureHttpRequests(settings.http && settings.http.proxy, settings.http && settings.http.proxyStrictSSL);
|
||||
this.yamlSettings.specificValidatorPaths = [];
|
||||
if (settings.yaml) {
|
||||
if (Object.prototype.hasOwnProperty.call(settings.yaml, 'schemas')) {
|
||||
this.yamlSettings.yamlConfigurationSettings = settings.yaml.schemas;
|
||||
}
|
||||
if (Object.prototype.hasOwnProperty.call(settings.yaml, 'validate')) {
|
||||
this.yamlSettings.yamlShouldValidate = settings.yaml.validate;
|
||||
}
|
||||
if (Object.prototype.hasOwnProperty.call(settings.yaml, 'hover')) {
|
||||
this.yamlSettings.yamlShouldHover = settings.yaml.hover;
|
||||
}
|
||||
if (Object.prototype.hasOwnProperty.call(settings.yaml, 'completion')) {
|
||||
this.yamlSettings.yamlShouldCompletion = settings.yaml.completion;
|
||||
}
|
||||
this.yamlSettings.customTags = settings.yaml.customTags ? settings.yaml.customTags : [];
|
||||
this.yamlSettings.maxItemsComputed = Math.trunc(Math.max(0, Number(settings.yaml.maxItemsComputed))) || 5000;
|
||||
if (settings.yaml.schemaStore) {
|
||||
this.yamlSettings.schemaStoreEnabled = settings.yaml.schemaStore.enable;
|
||||
if (settings.yaml.schemaStore.url?.length !== 0) {
|
||||
this.yamlSettings.schemaStoreUrl = settings.yaml.schemaStore.url;
|
||||
}
|
||||
}
|
||||
if (settings.files?.associations) {
|
||||
for (const [ext, languageId] of Object.entries(settings.files.associations)) {
|
||||
if (languageId === 'yaml') {
|
||||
this.yamlSettings.fileExtensions.push(ext);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.yamlSettings.yamlVersion = settings.yaml.yamlVersion ?? '1.2';
|
||||
if (settings.yaml.format) {
|
||||
this.yamlSettings.yamlFormatterSettings = {
|
||||
proseWrap: settings.yaml.format.proseWrap || 'preserve',
|
||||
printWidth: settings.yaml.format.printWidth || 80,
|
||||
};
|
||||
if (settings.yaml.format.singleQuote !== undefined) {
|
||||
this.yamlSettings.yamlFormatterSettings.singleQuote = settings.yaml.format.singleQuote;
|
||||
}
|
||||
if (settings.yaml.format.bracketSpacing !== undefined) {
|
||||
this.yamlSettings.yamlFormatterSettings.bracketSpacing = settings.yaml.format.bracketSpacing;
|
||||
}
|
||||
if (settings.yaml.format.enable !== undefined) {
|
||||
this.yamlSettings.yamlFormatterSettings.enable = settings.yaml.format.enable;
|
||||
}
|
||||
}
|
||||
this.yamlSettings.disableAdditionalProperties = settings.yaml.disableAdditionalProperties;
|
||||
this.yamlSettings.disableDefaultProperties = settings.yaml.disableDefaultProperties;
|
||||
if (settings.yaml.suggest) {
|
||||
this.yamlSettings.suggest.parentSkeletonSelectedFirst = settings.yaml.suggest.parentSkeletonSelectedFirst;
|
||||
}
|
||||
this.yamlSettings.style = {
|
||||
flowMapping: settings.yaml.style?.flowMapping ?? 'allow',
|
||||
flowSequence: settings.yaml.style?.flowSequence ?? 'allow',
|
||||
};
|
||||
this.yamlSettings.keyOrdering = settings.yaml.keyOrdering ?? false;
|
||||
}
|
||||
this.yamlSettings.schemaConfigurationSettings = [];
|
||||
let tabSize = 2;
|
||||
if (settings.vscodeEditor) {
|
||||
tabSize =
|
||||
!settings.vscodeEditor['detectIndentation'] && settings.yamlEditor ? settings.yamlEditor['editor.tabSize'] : tabSize;
|
||||
}
|
||||
if (settings.yamlEditor && settings.yamlEditor['editor.tabSize']) {
|
||||
this.yamlSettings.indentation = ' '.repeat(tabSize);
|
||||
}
|
||||
for (const uri in this.yamlSettings.yamlConfigurationSettings) {
|
||||
const globPattern = this.yamlSettings.yamlConfigurationSettings[uri];
|
||||
const schemaObj = {
|
||||
fileMatch: Array.isArray(globPattern) ? globPattern : [globPattern],
|
||||
uri: checkSchemaURI(this.yamlSettings.workspaceFolders, this.yamlSettings.workspaceRoot, uri, this.telemetry),
|
||||
};
|
||||
this.yamlSettings.schemaConfigurationSettings.push(schemaObj);
|
||||
}
|
||||
await this.setSchemaStoreSettingsIfNotSet();
|
||||
this.updateConfiguration();
|
||||
if (this.yamlSettings.useSchemaSelectionRequests) {
|
||||
this.connection.sendNotification(SchemaSelectionRequests.schemaStoreInitialized, {});
|
||||
}
|
||||
// dynamically enable & disable the formatter
|
||||
if (this.yamlSettings.clientDynamicRegisterSupport) {
|
||||
const enableFormatter = settings && settings.yaml && settings.yaml.format && settings.yaml.format.enable;
|
||||
if (enableFormatter) {
|
||||
if (!this.yamlSettings.formatterRegistration) {
|
||||
this.yamlSettings.formatterRegistration = this.connection.client.register(DocumentFormattingRequest.type, {
|
||||
documentSelector: [{ language: 'yaml' }],
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (this.yamlSettings.formatterRegistration) {
|
||||
this.yamlSettings.formatterRegistration.then((r) => {
|
||||
return r.dispose();
|
||||
});
|
||||
this.yamlSettings.formatterRegistration = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This function helps set the schema store if it hasn't already been set
|
||||
* AND the schema store setting is enabled. If the schema store setting
|
||||
* is not enabled we need to clear the schemas.
|
||||
*/
|
||||
async setSchemaStoreSettingsIfNotSet() {
|
||||
const schemaStoreIsSet = this.yamlSettings.schemaStoreSettings.length !== 0;
|
||||
let schemaStoreUrl = '';
|
||||
if (this.yamlSettings.schemaStoreUrl?.length !== 0) {
|
||||
schemaStoreUrl = this.yamlSettings.schemaStoreUrl;
|
||||
}
|
||||
else {
|
||||
schemaStoreUrl = JSON_SCHEMASTORE_URL;
|
||||
}
|
||||
if (this.yamlSettings.schemaStoreEnabled && !schemaStoreIsSet) {
|
||||
try {
|
||||
const schemaStore = await this.getSchemaStoreMatchingSchemas(schemaStoreUrl);
|
||||
this.yamlSettings.schemaStoreSettings = schemaStore.schemas;
|
||||
}
|
||||
catch (err) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
else if (!this.yamlSettings.schemaStoreEnabled) {
|
||||
this.yamlSettings.schemaStoreSettings = [];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* When the schema store is enabled, download and store YAML schema associations
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async getSchemaStoreMatchingSchemas(schemaStoreUrl) {
|
||||
const response = await xhr({ url: schemaStoreUrl });
|
||||
const languageSettings = {
|
||||
schemas: [],
|
||||
};
|
||||
// Parse the schema store catalog as JSON
|
||||
const schemas = JSON.parse(response.responseText);
|
||||
for (const schemaIndex in schemas.schemas) {
|
||||
const schema = schemas.schemas[schemaIndex];
|
||||
if (schema && schema.fileMatch) {
|
||||
for (const fileMatch in schema.fileMatch) {
|
||||
const currFileMatch = schema.fileMatch[fileMatch];
|
||||
// If the schema is for files with a YAML extension, save the schema association
|
||||
if (this.yamlSettings.fileExtensions.findIndex((value) => {
|
||||
return currFileMatch.indexOf(value) > -1;
|
||||
}) > -1) {
|
||||
languageSettings.schemas.push({
|
||||
uri: schema.url,
|
||||
fileMatch: [currFileMatch],
|
||||
priority: SchemaPriority.SchemaStore,
|
||||
name: schema.name,
|
||||
description: schema.description,
|
||||
versions: schema.versions,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return languageSettings;
|
||||
}
|
||||
/**
|
||||
* Called when server settings or schema associations are changed
|
||||
* Re-creates schema associations and re-validates any open YAML files
|
||||
*/
|
||||
updateConfiguration() {
|
||||
let languageSettings = {
|
||||
validate: this.yamlSettings.yamlShouldValidate,
|
||||
hover: this.yamlSettings.yamlShouldHover,
|
||||
completion: this.yamlSettings.yamlShouldCompletion,
|
||||
schemas: [],
|
||||
customTags: this.yamlSettings.customTags,
|
||||
format: this.yamlSettings.yamlFormatterSettings.enable,
|
||||
indentation: this.yamlSettings.indentation,
|
||||
disableAdditionalProperties: this.yamlSettings.disableAdditionalProperties,
|
||||
disableDefaultProperties: this.yamlSettings.disableDefaultProperties,
|
||||
parentSkeletonSelectedFirst: this.yamlSettings.suggest.parentSkeletonSelectedFirst,
|
||||
flowMapping: this.yamlSettings.style?.flowMapping,
|
||||
flowSequence: this.yamlSettings.style?.flowSequence,
|
||||
yamlVersion: this.yamlSettings.yamlVersion,
|
||||
keyOrdering: this.yamlSettings.keyOrdering,
|
||||
};
|
||||
if (this.yamlSettings.schemaAssociations) {
|
||||
if (Array.isArray(this.yamlSettings.schemaAssociations)) {
|
||||
this.yamlSettings.schemaAssociations.forEach((association) => {
|
||||
languageSettings = this.configureSchemas(association.uri, association.fileMatch, association.schema, languageSettings, SchemaPriority.SchemaAssociation);
|
||||
});
|
||||
}
|
||||
else {
|
||||
for (const uri in this.yamlSettings.schemaAssociations) {
|
||||
const fileMatch = this.yamlSettings.schemaAssociations[uri];
|
||||
languageSettings = this.configureSchemas(uri, fileMatch, null, languageSettings, SchemaPriority.SchemaAssociation);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.yamlSettings.schemaConfigurationSettings) {
|
||||
this.yamlSettings.schemaConfigurationSettings.forEach((schema) => {
|
||||
let uri = schema.uri;
|
||||
if (!uri && schema.schema) {
|
||||
uri = schema.schema.id;
|
||||
}
|
||||
if (!uri && schema.fileMatch) {
|
||||
uri = 'vscode://schemas/custom/' + encodeURIComponent(schema.fileMatch.join('&'));
|
||||
}
|
||||
if (uri) {
|
||||
if (isRelativePath(uri)) {
|
||||
uri = relativeToAbsolutePath(this.yamlSettings.workspaceFolders, this.yamlSettings.workspaceRoot, uri);
|
||||
}
|
||||
languageSettings = this.configureSchemas(uri, schema.fileMatch, schema.schema, languageSettings, SchemaPriority.Settings);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.yamlSettings.schemaStoreSettings) {
|
||||
languageSettings.schemas = languageSettings.schemas.concat(this.yamlSettings.schemaStoreSettings);
|
||||
}
|
||||
this.languageService.configure(languageSettings);
|
||||
// Revalidate any open text documents
|
||||
this.yamlSettings.documents.all().forEach((document) => this.validationHandler.validate(document));
|
||||
}
|
||||
/**
|
||||
* Stores schema associations in server settings, handling kubernetes
|
||||
* @param uri string path to schema (whether local or online)
|
||||
* @param fileMatch file pattern to apply the schema to
|
||||
* @param schema schema id
|
||||
* @param languageSettings current server settings
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
configureSchemas(uri, fileMatch, schema, languageSettings, priorityLevel) {
|
||||
uri = checkSchemaURI(this.yamlSettings.workspaceFolders, this.yamlSettings.workspaceRoot, uri, this.telemetry);
|
||||
if (schema === null) {
|
||||
languageSettings.schemas.push({ uri, fileMatch: fileMatch, priority: priorityLevel });
|
||||
}
|
||||
else {
|
||||
languageSettings.schemas.push({ uri, fileMatch: fileMatch, schema: schema, priority: priorityLevel });
|
||||
}
|
||||
if (fileMatch.constructor === Array && uri === KUBERNETES_SCHEMA_URL) {
|
||||
fileMatch.forEach((url) => {
|
||||
this.yamlSettings.specificValidatorPaths.push(url);
|
||||
});
|
||||
}
|
||||
else if (uri === KUBERNETES_SCHEMA_URL) {
|
||||
this.yamlSettings.specificValidatorPaths.push(fileMatch);
|
||||
}
|
||||
return languageSettings;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=settingsHandlers.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/settingsHandlers.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/settingsHandlers.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
node_modules/yaml-language-server/lib/esm/languageserver/handlers/validationHandlers.d.ts
generated
vendored
Normal file
14
node_modules/yaml-language-server/lib/esm/languageserver/handlers/validationHandlers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Connection } from 'vscode-languageserver';
|
||||
import { TextDocument } from 'vscode-languageserver-textdocument';
|
||||
import { Diagnostic } from 'vscode-languageserver-types';
|
||||
import { LanguageService } from '../../languageservice/yamlLanguageService';
|
||||
import { SettingsState } from '../../yamlSettings';
|
||||
export declare class ValidationHandler {
|
||||
private readonly connection;
|
||||
private languageService;
|
||||
private yamlSettings;
|
||||
constructor(connection: Connection, languageService: LanguageService, yamlSettings: SettingsState);
|
||||
validate(textDocument: TextDocument): void;
|
||||
private cleanPendingValidation;
|
||||
validateTextDocument(textDocument: TextDocument): Promise<Diagnostic[]>;
|
||||
}
|
||||
54
node_modules/yaml-language-server/lib/esm/languageserver/handlers/validationHandlers.js
generated
vendored
Normal file
54
node_modules/yaml-language-server/lib/esm/languageserver/handlers/validationHandlers.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import { isKubernetesAssociatedDocument } from '../../languageservice/parser/isKubernetes';
|
||||
import { removeDuplicatesObj } from '../../languageservice/utils/arrUtils';
|
||||
export class ValidationHandler {
|
||||
constructor(connection, languageService, yamlSettings) {
|
||||
this.connection = connection;
|
||||
this.languageService = languageService;
|
||||
this.yamlSettings = yamlSettings;
|
||||
this.yamlSettings.documents.onDidChangeContent((change) => {
|
||||
this.validate(change.document);
|
||||
});
|
||||
this.yamlSettings.documents.onDidClose((event) => {
|
||||
this.cleanPendingValidation(event.document);
|
||||
this.connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
|
||||
});
|
||||
}
|
||||
validate(textDocument) {
|
||||
this.cleanPendingValidation(textDocument);
|
||||
this.yamlSettings.pendingValidationRequests[textDocument.uri] = setTimeout(() => {
|
||||
delete this.yamlSettings.pendingValidationRequests[textDocument.uri];
|
||||
this.validateTextDocument(textDocument);
|
||||
}, this.yamlSettings.validationDelayMs);
|
||||
}
|
||||
cleanPendingValidation(textDocument) {
|
||||
const request = this.yamlSettings.pendingValidationRequests[textDocument.uri];
|
||||
if (request) {
|
||||
clearTimeout(request);
|
||||
delete this.yamlSettings.pendingValidationRequests[textDocument.uri];
|
||||
}
|
||||
}
|
||||
validateTextDocument(textDocument) {
|
||||
if (!textDocument) {
|
||||
return;
|
||||
}
|
||||
return this.languageService
|
||||
.doValidation(textDocument, isKubernetesAssociatedDocument(textDocument, this.yamlSettings.specificValidatorPaths))
|
||||
.then((diagnosticResults) => {
|
||||
const diagnostics = [];
|
||||
for (const diagnosticItem of diagnosticResults) {
|
||||
// Convert all warnings to errors
|
||||
if (diagnosticItem.severity === 2) {
|
||||
diagnosticItem.severity = 1;
|
||||
}
|
||||
diagnostics.push(diagnosticItem);
|
||||
}
|
||||
const removeDuplicatesDiagnostics = removeDuplicatesObj(diagnostics);
|
||||
this.connection.sendDiagnostics({
|
||||
uri: textDocument.uri,
|
||||
diagnostics: removeDuplicatesDiagnostics,
|
||||
});
|
||||
return removeDuplicatesDiagnostics;
|
||||
});
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=validationHandlers.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/validationHandlers.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/validationHandlers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"validationHandlers.js","sourceRoot":"","sources":["../../../../src/languageserver/handlers/validationHandlers.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAI3E,MAAM,OAAO,iBAAiB;IAI5B,YAA6B,UAAsB,EAAE,eAAgC,EAAE,YAA2B;QAArF,eAAU,GAAV,UAAU,CAAY;QACjD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,EAAE;YACxD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE;YAC/C,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAChF,CAAC,CAAC,CAAC;IACL,CAAC;IAED,QAAQ,CAAC,YAA0B;QACjC,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9E,OAAO,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YACrE,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAC1C,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAC1C,CAAC;IAEO,sBAAsB,CAAC,YAA0B;QACvD,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAE9E,IAAI,OAAO,EAAE;YACX,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;SACtE;IACH,CAAC;IAED,oBAAoB,CAAC,YAA0B;QAC7C,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO;SACR;QAED,OAAO,IAAI,CAAC,eAAe;aACxB,YAAY,CAAC,YAAY,EAAE,8BAA8B,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;aAClH,IAAI,CAAC,CAAC,iBAAiB,EAAE,EAAE;YAC1B,MAAM,WAAW,GAAiB,EAAE,CAAC;YACrC,KAAK,MAAM,cAAc,IAAI,iBAAiB,EAAE;gBAC9C,iCAAiC;gBACjC,IAAI,cAAc,CAAC,QAAQ,KAAK,CAAC,EAAE;oBACjC,cAAc,CAAC,QAAQ,GAAG,CAAC,CAAC;iBAC7B;gBACD,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aAClC;YAED,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;YACrE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;gBAC9B,GAAG,EAAE,YAAY,CAAC,GAAG;gBACrB,WAAW,EAAE,2BAA2B;aACzC,CAAC,CAAC;YACH,OAAO,2BAA2B,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC;CACF"}
|
||||
9
node_modules/yaml-language-server/lib/esm/languageserver/handlers/workspaceHandlers.d.ts
generated
vendored
Normal file
9
node_modules/yaml-language-server/lib/esm/languageserver/handlers/workspaceHandlers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Connection } from 'vscode-languageserver';
|
||||
import { CommandExecutor } from '../commandExecutor';
|
||||
export declare class WorkspaceHandlers {
|
||||
private readonly connection;
|
||||
private readonly commandExecutor;
|
||||
constructor(connection: Connection, commandExecutor: CommandExecutor);
|
||||
registerHandlers(): void;
|
||||
private executeCommand;
|
||||
}
|
||||
17
node_modules/yaml-language-server/lib/esm/languageserver/handlers/workspaceHandlers.js
generated
vendored
Normal file
17
node_modules/yaml-language-server/lib/esm/languageserver/handlers/workspaceHandlers.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
export class WorkspaceHandlers {
|
||||
constructor(connection, commandExecutor) {
|
||||
this.connection = connection;
|
||||
this.commandExecutor = commandExecutor;
|
||||
}
|
||||
registerHandlers() {
|
||||
this.connection.onExecuteCommand((params) => this.executeCommand(params));
|
||||
}
|
||||
executeCommand(params) {
|
||||
return this.commandExecutor.executeCommand(params);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=workspaceHandlers.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/workspaceHandlers.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/handlers/workspaceHandlers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"workspaceHandlers.js","sourceRoot":"","sources":["../../../../src/languageserver/handlers/workspaceHandlers.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,MAAM,OAAO,iBAAiB;IAC5B,YAA6B,UAAsB,EAAmB,eAAgC;QAAzE,eAAU,GAAV,UAAU,CAAY;QAAmB,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAE1G,gBAAgB;QACd,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5E,CAAC;IAEO,cAAc,CAAC,MAA4B;QACjD,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;CACF"}
|
||||
9
node_modules/yaml-language-server/lib/esm/languageserver/telemetry.d.ts
generated
vendored
Normal file
9
node_modules/yaml-language-server/lib/esm/languageserver/telemetry.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Connection } from 'vscode-languageserver';
|
||||
import { TelemetryEvent, Telemetry } from '../languageservice/telemetry';
|
||||
export declare class TelemetryImpl implements Telemetry {
|
||||
private readonly connection;
|
||||
constructor(connection: Connection);
|
||||
send(event: TelemetryEvent): void;
|
||||
sendError(name: string, properties: unknown): void;
|
||||
sendTrack(name: string, properties: unknown): void;
|
||||
}
|
||||
19
node_modules/yaml-language-server/lib/esm/languageserver/telemetry.js
generated
vendored
Normal file
19
node_modules/yaml-language-server/lib/esm/languageserver/telemetry.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
export class TelemetryImpl {
|
||||
constructor(connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
send(event) {
|
||||
this.connection.telemetry.logEvent(event);
|
||||
}
|
||||
sendError(name, properties) {
|
||||
this.send({ name, type: 'track', properties: properties });
|
||||
}
|
||||
sendTrack(name, properties) {
|
||||
this.send({ name, type: 'track', properties: properties });
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=telemetry.js.map
|
||||
1
node_modules/yaml-language-server/lib/esm/languageserver/telemetry.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/esm/languageserver/telemetry.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../../src/languageserver/telemetry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,MAAM,OAAO,aAAa;IACxB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAEvD,IAAI,CAAC,KAAqB;QACxB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,SAAS,CAAC,IAAY,EAAE,UAAmB;QACzC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,SAAS,CAAC,IAAY,EAAE,UAAmB;QACzC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
||||
Reference in New Issue
Block a user