This commit is contained in:
6
node_modules/yaml-language-server/lib/umd/languageservice/utils/arrUtils.d.ts
generated
vendored
Normal file
6
node_modules/yaml-language-server/lib/umd/languageservice/utils/arrUtils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { YAMLDocument, SingleYAMLDocument } from '../parser/yamlParser07';
|
||||
export declare function getLineOffsets(textDocString: string): number[];
|
||||
export declare function removeDuplicatesObj<T>(objArray: T[]): T[];
|
||||
export declare function matchOffsetToDocument(offset: number, jsonDocuments: YAMLDocument): SingleYAMLDocument | null;
|
||||
export declare function filterInvalidCustomTags(customTags: string[]): string[];
|
||||
export declare function isArrayEqual(fst: Array<unknown>, snd: Array<unknown>): boolean;
|
||||
99
node_modules/yaml-language-server/lib/umd/languageservice/utils/arrUtils.js
generated
vendored
Normal file
99
node_modules/yaml-language-server/lib/umd/languageservice/utils/arrUtils.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isArrayEqual = exports.filterInvalidCustomTags = exports.matchOffsetToDocument = exports.removeDuplicatesObj = exports.getLineOffsets = void 0;
|
||||
function getLineOffsets(textDocString) {
|
||||
const lineOffsets = [];
|
||||
const text = textDocString;
|
||||
let isLineStart = true;
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
if (isLineStart) {
|
||||
lineOffsets.push(i);
|
||||
isLineStart = false;
|
||||
}
|
||||
const ch = text.charAt(i);
|
||||
isLineStart = ch === '\r' || ch === '\n';
|
||||
if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (isLineStart && text.length > 0) {
|
||||
lineOffsets.push(text.length);
|
||||
}
|
||||
return lineOffsets;
|
||||
}
|
||||
exports.getLineOffsets = getLineOffsets;
|
||||
function removeDuplicatesObj(objArray) {
|
||||
const nonDuplicateSet = new Set();
|
||||
const nonDuplicateArr = [];
|
||||
for (const obj in objArray) {
|
||||
const currObj = objArray[obj];
|
||||
const stringifiedObj = JSON.stringify(currObj);
|
||||
if (!nonDuplicateSet.has(stringifiedObj)) {
|
||||
nonDuplicateArr.push(currObj);
|
||||
nonDuplicateSet.add(stringifiedObj);
|
||||
}
|
||||
}
|
||||
return nonDuplicateArr;
|
||||
}
|
||||
exports.removeDuplicatesObj = removeDuplicatesObj;
|
||||
function matchOffsetToDocument(offset, jsonDocuments) {
|
||||
for (const jsonDoc of jsonDocuments.documents) {
|
||||
if (jsonDoc.internalDocument && jsonDoc.internalDocument.range[0] <= offset && jsonDoc.internalDocument.range[2] >= offset) {
|
||||
return jsonDoc;
|
||||
}
|
||||
}
|
||||
if (jsonDocuments.documents.length === 1) {
|
||||
return jsonDocuments.documents[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
exports.matchOffsetToDocument = matchOffsetToDocument;
|
||||
function filterInvalidCustomTags(customTags) {
|
||||
const validCustomTags = ['mapping', 'scalar', 'sequence'];
|
||||
if (!customTags) {
|
||||
return [];
|
||||
}
|
||||
return customTags.filter((tag) => {
|
||||
if (typeof tag === 'string') {
|
||||
const typeInfo = tag.split(' ');
|
||||
const type = (typeInfo[1] && typeInfo[1].toLowerCase()) || 'scalar';
|
||||
// We need to check if map is a type because map will throw an error within the yaml-ast-parser
|
||||
if (type === 'map') {
|
||||
return false;
|
||||
}
|
||||
return validCustomTags.indexOf(type) !== -1;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
exports.filterInvalidCustomTags = filterInvalidCustomTags;
|
||||
function isArrayEqual(fst, snd) {
|
||||
if (!snd || !fst) {
|
||||
return false;
|
||||
}
|
||||
if (snd.length !== fst.length) {
|
||||
return false;
|
||||
}
|
||||
for (let index = fst.length - 1; index >= 0; index--) {
|
||||
if (fst[index] !== snd[index]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.isArrayEqual = isArrayEqual;
|
||||
});
|
||||
//# sourceMappingURL=arrUtils.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/arrUtils.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/arrUtils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"arrUtils.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/arrUtils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;;;IAIhG,SAAgB,cAAc,CAAC,aAAqB;QAClD,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,aAAa,CAAC;QAC3B,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,IAAI,WAAW,EAAE;gBACf,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpB,WAAW,GAAG,KAAK,CAAC;aACrB;YACD,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC1B,WAAW,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC;YACzC,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;gBACrE,CAAC,EA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e,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QAE1D,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,EAAE,CAAC;SACX;QACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBAC3B,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAChC,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,QAAQ,CAAC;gBAEpE,+FAA+F;gBAC/F,IAAI,IAAI,KAAK,KAAK,EAAE;oBAClB,OAAO,KAAK,CAAC;iBACd;gBAED,OAAO,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aAC7C;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IApBD,0DAoBC;IACD,SAAgB,YAAY,CAAC,GAAmB,EAAE,GAAmB;QACnE,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE;YAChB,OAAO,KAAK,CAAC;SACd;QACD,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE;YAC7B,OAAO,KAAK,CAAC;SACd;QACD,KAAK,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE;YACpD,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE;gBAC7B,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAbD,oCAaC"}
|
||||
13
node_modules/yaml-language-server/lib/umd/languageservice/utils/astUtils.d.ts
generated
vendored
Normal file
13
node_modules/yaml-language-server/lib/umd/languageservice/utils/astUtils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Document, YAMLMap, YAMLSeq } from 'yaml';
|
||||
import { CollectionItem, Token } from 'yaml/dist/parse/cst';
|
||||
import { YamlNode } from '../jsonASTTypes';
|
||||
export declare function getParent(doc: Document, nodeToFind: YamlNode): YamlNode | undefined;
|
||||
export declare function isMapContainsEmptyPair(map: YAMLMap): boolean;
|
||||
export declare function indexOf(seq: YAMLSeq, item: YamlNode): number | undefined;
|
||||
/**
|
||||
* Check that given offset is in YAML comment
|
||||
* @param doc the yaml document
|
||||
* @param offset the offset to check
|
||||
*/
|
||||
export declare function isInComment(tokens: Token[], offset: number): boolean;
|
||||
export declare function isCollectionItem(token: unknown): token is CollectionItem;
|
||||
126
node_modules/yaml-language-server/lib/umd/languageservice/utils/astUtils.js
generated
vendored
Normal file
126
node_modules/yaml-language-server/lib/umd/languageservice/utils/astUtils.js
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports", "yaml"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isCollectionItem = exports.isInComment = exports.indexOf = exports.isMapContainsEmptyPair = exports.getParent = void 0;
|
||||
const yaml_1 = require("yaml");
|
||||
function getParent(doc, nodeToFind) {
|
||||
let parentNode;
|
||||
(0, yaml_1.visit)(doc, (_, node, path) => {
|
||||
if (node === nodeToFind) {
|
||||
parentNode = path[path.length - 1];
|
||||
return yaml_1.visit.BREAK;
|
||||
}
|
||||
});
|
||||
if ((0, yaml_1.isDocument)(parentNode)) {
|
||||
return undefined;
|
||||
}
|
||||
return parentNode;
|
||||
}
|
||||
exports.getParent = getParent;
|
||||
function isMapContainsEmptyPair(map) {
|
||||
if (map.items.length > 1) {
|
||||
return false;
|
||||
}
|
||||
const pair = map.items[0];
|
||||
return (0, yaml_1.isScalar)(pair.key) && (0, yaml_1.isScalar)(pair.value) && pair.key.value === '' && !pair.value.value;
|
||||
}
|
||||
exports.isMapContainsEmptyPair = isMapContainsEmptyPair;
|
||||
function indexOf(seq, item) {
|
||||
for (const [i, obj] of seq.items.entries()) {
|
||||
if (item === obj) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
exports.indexOf = indexOf;
|
||||
/**
|
||||
* Check that given offset is in YAML comment
|
||||
* @param doc the yaml document
|
||||
* @param offset the offset to check
|
||||
*/
|
||||
function isInComment(tokens, offset) {
|
||||
let inComment = false;
|
||||
for (const token of tokens) {
|
||||
if (token.type === 'document') {
|
||||
_visit([], token, (item) => {
|
||||
if (isCollectionItem(item) && item.value?.type === 'comment') {
|
||||
if (token.offset <= offset && item.value.source.length + item.value.offset >= offset) {
|
||||
inComment = true;
|
||||
return yaml_1.visit.BREAK;
|
||||
}
|
||||
}
|
||||
else if (item.type === 'comment' && item.offset <= offset && item.offset + item.source.length >= offset) {
|
||||
inComment = true;
|
||||
return yaml_1.visit.BREAK;
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (token.type === 'comment') {
|
||||
if (token.offset <= offset && token.source.length + token.offset >= offset) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (inComment) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return inComment;
|
||||
}
|
||||
exports.isInComment = isInComment;
|
||||
function isCollectionItem(token) {
|
||||
return token['start'] !== undefined;
|
||||
}
|
||||
exports.isCollectionItem = isCollectionItem;
|
||||
function _visit(path, item, visitor) {
|
||||
let ctrl = visitor(item, path);
|
||||
if (typeof ctrl === 'symbol')
|
||||
return ctrl;
|
||||
for (const field of ['key', 'value']) {
|
||||
const token = item[field];
|
||||
if (token && 'items' in token) {
|
||||
for (let i = 0; i < token.items.length; ++i) {
|
||||
const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);
|
||||
if (typeof ci === 'number')
|
||||
i = ci - 1;
|
||||
else if (ci === yaml_1.visit.BREAK)
|
||||
return yaml_1.visit.BREAK;
|
||||
else if (ci === yaml_1.visit.REMOVE) {
|
||||
token.items.splice(i, 1);
|
||||
i -= 1;
|
||||
}
|
||||
}
|
||||
if (typeof ctrl === 'function' && field === 'key')
|
||||
ctrl = ctrl(item, path);
|
||||
}
|
||||
}
|
||||
const token = item['sep'];
|
||||
if (token) {
|
||||
for (let i = 0; i < token.length; ++i) {
|
||||
const ci = _visit(Object.freeze(path), token[i], visitor);
|
||||
if (typeof ci === 'number')
|
||||
i = ci - 1;
|
||||
else if (ci === yaml_1.visit.BREAK)
|
||||
return yaml_1.visit.BREAK;
|
||||
else if (ci === yaml_1.visit.REMOVE) {
|
||||
token.items.splice(i, 1);
|
||||
i -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return typeof ctrl === 'function' ? ctrl(item, path) : ctrl;
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=astUtils.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/astUtils.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/astUtils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"astUtils.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/astUtils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;;;IAEhG,+BAAqF;IAOrF,SAAgB,SAAS,CAAC,GAAa,EAAE,UAAoB;QAC3D,IAAI,UAAgB,CAAC;QACrB,IAAA,YAAK,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAU,EAAE,IAAI,EAAE,E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O,EAAE,KAAK,QAAQ;oBAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;qBAClC,IAAI,EAAE,KAAK,YAAK,CAAC,KAAK;oBAAE,OAAO,YAAK,CAAC,KAAK,CAAC;qBAC3C,IAAI,EAAE,KAAK,YAAK,CAAC,MAAM,EAAE;oBAC5B,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBACzB,CAAC,IAAI,CAAC,CAAC;iBACR;aACF;SACF;QACD,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,CAAC"}
|
||||
415
node_modules/yaml-language-server/lib/umd/languageservice/utils/charCode.d.ts
generated
vendored
Normal file
415
node_modules/yaml-language-server/lib/umd/languageservice/utils/charCode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,415 @@
|
||||
/**
|
||||
* An inlined enum containing useful character codes (to be used with String.charCodeAt).
|
||||
* Please leave the const keyword such that it gets inlined when compiled to JavaScript!
|
||||
*/
|
||||
export declare const enum CharCode {
|
||||
Null = 0,
|
||||
/**
|
||||
* The `\b` character.
|
||||
*/
|
||||
Backspace = 8,
|
||||
/**
|
||||
* The `\t` character.
|
||||
*/
|
||||
Tab = 9,
|
||||
/**
|
||||
* The `\n` character.
|
||||
*/
|
||||
LineFeed = 10,
|
||||
/**
|
||||
* The `\r` character.
|
||||
*/
|
||||
CarriageReturn = 13,
|
||||
Space = 32,
|
||||
/**
|
||||
* The `!` character.
|
||||
*/
|
||||
ExclamationMark = 33,
|
||||
/**
|
||||
* The `"` character.
|
||||
*/
|
||||
DoubleQuote = 34,
|
||||
/**
|
||||
* The `#` character.
|
||||
*/
|
||||
Hash = 35,
|
||||
/**
|
||||
* The `$` character.
|
||||
*/
|
||||
DollarSign = 36,
|
||||
/**
|
||||
* The `%` character.
|
||||
*/
|
||||
PercentSign = 37,
|
||||
/**
|
||||
* The `&` character.
|
||||
*/
|
||||
Ampersand = 38,
|
||||
/**
|
||||
* The `'` character.
|
||||
*/
|
||||
SingleQuote = 39,
|
||||
/**
|
||||
* The `(` character.
|
||||
*/
|
||||
OpenParen = 40,
|
||||
/**
|
||||
* The `)` character.
|
||||
*/
|
||||
CloseParen = 41,
|
||||
/**
|
||||
* The `*` character.
|
||||
*/
|
||||
Asterisk = 42,
|
||||
/**
|
||||
* The `+` character.
|
||||
*/
|
||||
Plus = 43,
|
||||
/**
|
||||
* The `,` character.
|
||||
*/
|
||||
Comma = 44,
|
||||
/**
|
||||
* The `-` character.
|
||||
*/
|
||||
Dash = 45,
|
||||
/**
|
||||
* The `.` character.
|
||||
*/
|
||||
Period = 46,
|
||||
/**
|
||||
* The `/` character.
|
||||
*/
|
||||
Slash = 47,
|
||||
Digit0 = 48,
|
||||
Digit1 = 49,
|
||||
Digit2 = 50,
|
||||
Digit3 = 51,
|
||||
Digit4 = 52,
|
||||
Digit5 = 53,
|
||||
Digit6 = 54,
|
||||
Digit7 = 55,
|
||||
Digit8 = 56,
|
||||
Digit9 = 57,
|
||||
/**
|
||||
* The `:` character.
|
||||
*/
|
||||
Colon = 58,
|
||||
/**
|
||||
* The `;` character.
|
||||
*/
|
||||
Semicolon = 59,
|
||||
/**
|
||||
* The `<` character.
|
||||
*/
|
||||
LessThan = 60,
|
||||
/**
|
||||
* The `=` character.
|
||||
*/
|
||||
Equals = 61,
|
||||
/**
|
||||
* The `>` character.
|
||||
*/
|
||||
GreaterThan = 62,
|
||||
/**
|
||||
* The `?` character.
|
||||
*/
|
||||
QuestionMark = 63,
|
||||
/**
|
||||
* The `@` character.
|
||||
*/
|
||||
AtSign = 64,
|
||||
A = 65,
|
||||
B = 66,
|
||||
C = 67,
|
||||
D = 68,
|
||||
E = 69,
|
||||
F = 70,
|
||||
G = 71,
|
||||
H = 72,
|
||||
I = 73,
|
||||
J = 74,
|
||||
K = 75,
|
||||
L = 76,
|
||||
M = 77,
|
||||
N = 78,
|
||||
O = 79,
|
||||
P = 80,
|
||||
Q = 81,
|
||||
R = 82,
|
||||
S = 83,
|
||||
T = 84,
|
||||
U = 85,
|
||||
V = 86,
|
||||
W = 87,
|
||||
X = 88,
|
||||
Y = 89,
|
||||
Z = 90,
|
||||
/**
|
||||
* The `[` character.
|
||||
*/
|
||||
OpenSquareBracket = 91,
|
||||
/**
|
||||
* The `\` character.
|
||||
*/
|
||||
Backslash = 92,
|
||||
/**
|
||||
* The `]` character.
|
||||
*/
|
||||
CloseSquareBracket = 93,
|
||||
/**
|
||||
* The `^` character.
|
||||
*/
|
||||
Caret = 94,
|
||||
/**
|
||||
* The `_` character.
|
||||
*/
|
||||
Underline = 95,
|
||||
/**
|
||||
* The ``(`)`` character.
|
||||
*/
|
||||
BackTick = 96,
|
||||
a = 97,
|
||||
b = 98,
|
||||
c = 99,
|
||||
d = 100,
|
||||
e = 101,
|
||||
f = 102,
|
||||
g = 103,
|
||||
h = 104,
|
||||
i = 105,
|
||||
j = 106,
|
||||
k = 107,
|
||||
l = 108,
|
||||
m = 109,
|
||||
n = 110,
|
||||
o = 111,
|
||||
p = 112,
|
||||
q = 113,
|
||||
r = 114,
|
||||
s = 115,
|
||||
t = 116,
|
||||
u = 117,
|
||||
v = 118,
|
||||
w = 119,
|
||||
x = 120,
|
||||
y = 121,
|
||||
z = 122,
|
||||
/**
|
||||
* The `{` character.
|
||||
*/
|
||||
OpenCurlyBrace = 123,
|
||||
/**
|
||||
* The `|` character.
|
||||
*/
|
||||
Pipe = 124,
|
||||
/**
|
||||
* The `}` character.
|
||||
*/
|
||||
CloseCurlyBrace = 125,
|
||||
/**
|
||||
* The `~` character.
|
||||
*/
|
||||
Tilde = 126,
|
||||
U_Combining_Grave_Accent = 768,
|
||||
U_Combining_Acute_Accent = 769,
|
||||
U_Combining_Circumflex_Accent = 770,
|
||||
U_Combining_Tilde = 771,
|
||||
U_Combining_Macron = 772,
|
||||
U_Combining_Overline = 773,
|
||||
U_Combining_Breve = 774,
|
||||
U_Combining_Dot_Above = 775,
|
||||
U_Combining_Diaeresis = 776,
|
||||
U_Combining_Hook_Above = 777,
|
||||
U_Combining_Ring_Above = 778,
|
||||
U_Combining_Double_Acute_Accent = 779,
|
||||
U_Combining_Caron = 780,
|
||||
U_Combining_Vertical_Line_Above = 781,
|
||||
U_Combining_Double_Vertical_Line_Above = 782,
|
||||
U_Combining_Double_Grave_Accent = 783,
|
||||
U_Combining_Candrabindu = 784,
|
||||
U_Combining_Inverted_Breve = 785,
|
||||
U_Combining_Turned_Comma_Above = 786,
|
||||
U_Combining_Comma_Above = 787,
|
||||
U_Combining_Reversed_Comma_Above = 788,
|
||||
U_Combining_Comma_Above_Right = 789,
|
||||
U_Combining_Grave_Accent_Below = 790,
|
||||
U_Combining_Acute_Accent_Below = 791,
|
||||
U_Combining_Left_Tack_Below = 792,
|
||||
U_Combining_Right_Tack_Below = 793,
|
||||
U_Combining_Left_Angle_Above = 794,
|
||||
U_Combining_Horn = 795,
|
||||
U_Combining_Left_Half_Ring_Below = 796,
|
||||
U_Combining_Up_Tack_Below = 797,
|
||||
U_Combining_Down_Tack_Below = 798,
|
||||
U_Combining_Plus_Sign_Below = 799,
|
||||
U_Combining_Minus_Sign_Below = 800,
|
||||
U_Combining_Palatalized_Hook_Below = 801,
|
||||
U_Combining_Retroflex_Hook_Below = 802,
|
||||
U_Combining_Dot_Below = 803,
|
||||
U_Combining_Diaeresis_Below = 804,
|
||||
U_Combining_Ring_Below = 805,
|
||||
U_Combining_Comma_Below = 806,
|
||||
U_Combining_Cedilla = 807,
|
||||
U_Combining_Ogonek = 808,
|
||||
U_Combining_Vertical_Line_Below = 809,
|
||||
U_Combining_Bridge_Below = 810,
|
||||
U_Combining_Inverted_Double_Arch_Below = 811,
|
||||
U_Combining_Caron_Below = 812,
|
||||
U_Combining_Circumflex_Accent_Below = 813,
|
||||
U_Combining_Breve_Below = 814,
|
||||
U_Combining_Inverted_Breve_Below = 815,
|
||||
U_Combining_Tilde_Below = 816,
|
||||
U_Combining_Macron_Below = 817,
|
||||
U_Combining_Low_Line = 818,
|
||||
U_Combining_Double_Low_Line = 819,
|
||||
U_Combining_Tilde_Overlay = 820,
|
||||
U_Combining_Short_Stroke_Overlay = 821,
|
||||
U_Combining_Long_Stroke_Overlay = 822,
|
||||
U_Combining_Short_Solidus_Overlay = 823,
|
||||
U_Combining_Long_Solidus_Overlay = 824,
|
||||
U_Combining_Right_Half_Ring_Below = 825,
|
||||
U_Combining_Inverted_Bridge_Below = 826,
|
||||
U_Combining_Square_Below = 827,
|
||||
U_Combining_Seagull_Below = 828,
|
||||
U_Combining_X_Above = 829,
|
||||
U_Combining_Vertical_Tilde = 830,
|
||||
U_Combining_Double_Overline = 831,
|
||||
U_Combining_Grave_Tone_Mark = 832,
|
||||
U_Combining_Acute_Tone_Mark = 833,
|
||||
U_Combining_Greek_Perispomeni = 834,
|
||||
U_Combining_Greek_Koronis = 835,
|
||||
U_Combining_Greek_Dialytika_Tonos = 836,
|
||||
U_Combining_Greek_Ypogegrammeni = 837,
|
||||
U_Combining_Bridge_Above = 838,
|
||||
U_Combining_Equals_Sign_Below = 839,
|
||||
U_Combining_Double_Vertical_Line_Below = 840,
|
||||
U_Combining_Left_Angle_Below = 841,
|
||||
U_Combining_Not_Tilde_Above = 842,
|
||||
U_Combining_Homothetic_Above = 843,
|
||||
U_Combining_Almost_Equal_To_Above = 844,
|
||||
U_Combining_Left_Right_Arrow_Below = 845,
|
||||
U_Combining_Upwards_Arrow_Below = 846,
|
||||
U_Combining_Grapheme_Joiner = 847,
|
||||
U_Combining_Right_Arrowhead_Above = 848,
|
||||
U_Combining_Left_Half_Ring_Above = 849,
|
||||
U_Combining_Fermata = 850,
|
||||
U_Combining_X_Below = 851,
|
||||
U_Combining_Left_Arrowhead_Below = 852,
|
||||
U_Combining_Right_Arrowhead_Below = 853,
|
||||
U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below = 854,
|
||||
U_Combining_Right_Half_Ring_Above = 855,
|
||||
U_Combining_Dot_Above_Right = 856,
|
||||
U_Combining_Asterisk_Below = 857,
|
||||
U_Combining_Double_Ring_Below = 858,
|
||||
U_Combining_Zigzag_Above = 859,
|
||||
U_Combining_Double_Breve_Below = 860,
|
||||
U_Combining_Double_Breve = 861,
|
||||
U_Combining_Double_Macron = 862,
|
||||
U_Combining_Double_Macron_Below = 863,
|
||||
U_Combining_Double_Tilde = 864,
|
||||
U_Combining_Double_Inverted_Breve = 865,
|
||||
U_Combining_Double_Rightwards_Arrow_Below = 866,
|
||||
U_Combining_Latin_Small_Letter_A = 867,
|
||||
U_Combining_Latin_Small_Letter_E = 868,
|
||||
U_Combining_Latin_Small_Letter_I = 869,
|
||||
U_Combining_Latin_Small_Letter_O = 870,
|
||||
U_Combining_Latin_Small_Letter_U = 871,
|
||||
U_Combining_Latin_Small_Letter_C = 872,
|
||||
U_Combining_Latin_Small_Letter_D = 873,
|
||||
U_Combining_Latin_Small_Letter_H = 874,
|
||||
U_Combining_Latin_Small_Letter_M = 875,
|
||||
U_Combining_Latin_Small_Letter_R = 876,
|
||||
U_Combining_Latin_Small_Letter_T = 877,
|
||||
U_Combining_Latin_Small_Letter_V = 878,
|
||||
U_Combining_Latin_Small_Letter_X = 879,
|
||||
/**
|
||||
* Unicode Character 'LINE SEPARATOR' (U+2028)
|
||||
* http://www.fileformat.info/info/unicode/char/2028/index.htm
|
||||
*/
|
||||
LINE_SEPARATOR = 8232,
|
||||
/**
|
||||
* Unicode Character 'PARAGRAPH SEPARATOR' (U+2029)
|
||||
* http://www.fileformat.info/info/unicode/char/2029/index.htm
|
||||
*/
|
||||
PARAGRAPH_SEPARATOR = 8233,
|
||||
/**
|
||||
* Unicode Character 'NEXT LINE' (U+0085)
|
||||
* http://www.fileformat.info/info/unicode/char/0085/index.htm
|
||||
*/
|
||||
NEXT_LINE = 133,
|
||||
U_CIRCUMFLEX = 94,
|
||||
U_GRAVE_ACCENT = 96,
|
||||
U_DIAERESIS = 168,
|
||||
U_MACRON = 175,
|
||||
U_ACUTE_ACCENT = 180,
|
||||
U_CEDILLA = 184,
|
||||
U_MODIFIER_LETTER_LEFT_ARROWHEAD = 706,
|
||||
U_MODIFIER_LETTER_RIGHT_ARROWHEAD = 707,
|
||||
U_MODIFIER_LETTER_UP_ARROWHEAD = 708,
|
||||
U_MODIFIER_LETTER_DOWN_ARROWHEAD = 709,
|
||||
U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING = 722,
|
||||
U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING = 723,
|
||||
U_MODIFIER_LETTER_UP_TACK = 724,
|
||||
U_MODIFIER_LETTER_DOWN_TACK = 725,
|
||||
U_MODIFIER_LETTER_PLUS_SIGN = 726,
|
||||
U_MODIFIER_LETTER_MINUS_SIGN = 727,
|
||||
U_BREVE = 728,
|
||||
U_DOT_ABOVE = 729,
|
||||
U_RING_ABOVE = 730,
|
||||
U_OGONEK = 731,
|
||||
U_SMALL_TILDE = 732,
|
||||
U_DOUBLE_ACUTE_ACCENT = 733,
|
||||
U_MODIFIER_LETTER_RHOTIC_HOOK = 734,
|
||||
U_MODIFIER_LETTER_CROSS_ACCENT = 735,
|
||||
U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR = 741,
|
||||
U_MODIFIER_LETTER_HIGH_TONE_BAR = 742,
|
||||
U_MODIFIER_LETTER_MID_TONE_BAR = 743,
|
||||
U_MODIFIER_LETTER_LOW_TONE_BAR = 744,
|
||||
U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR = 745,
|
||||
U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK = 746,
|
||||
U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK = 747,
|
||||
U_MODIFIER_LETTER_UNASPIRATED = 749,
|
||||
U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD = 751,
|
||||
U_MODIFIER_LETTER_LOW_UP_ARROWHEAD = 752,
|
||||
U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD = 753,
|
||||
U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD = 754,
|
||||
U_MODIFIER_LETTER_LOW_RING = 755,
|
||||
U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT = 756,
|
||||
U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT = 757,
|
||||
U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT = 758,
|
||||
U_MODIFIER_LETTER_LOW_TILDE = 759,
|
||||
U_MODIFIER_LETTER_RAISED_COLON = 760,
|
||||
U_MODIFIER_LETTER_BEGIN_HIGH_TONE = 761,
|
||||
U_MODIFIER_LETTER_END_HIGH_TONE = 762,
|
||||
U_MODIFIER_LETTER_BEGIN_LOW_TONE = 763,
|
||||
U_MODIFIER_LETTER_END_LOW_TONE = 764,
|
||||
U_MODIFIER_LETTER_SHELF = 765,
|
||||
U_MODIFIER_LETTER_OPEN_SHELF = 766,
|
||||
U_MODIFIER_LETTER_LOW_LEFT_ARROW = 767,
|
||||
U_GREEK_LOWER_NUMERAL_SIGN = 885,
|
||||
U_GREEK_TONOS = 900,
|
||||
U_GREEK_DIALYTIKA_TONOS = 901,
|
||||
U_GREEK_KORONIS = 8125,
|
||||
U_GREEK_PSILI = 8127,
|
||||
U_GREEK_PERISPOMENI = 8128,
|
||||
U_GREEK_DIALYTIKA_AND_PERISPOMENI = 8129,
|
||||
U_GREEK_PSILI_AND_VARIA = 8141,
|
||||
U_GREEK_PSILI_AND_OXIA = 8142,
|
||||
U_GREEK_PSILI_AND_PERISPOMENI = 8143,
|
||||
U_GREEK_DASIA_AND_VARIA = 8157,
|
||||
U_GREEK_DASIA_AND_OXIA = 8158,
|
||||
U_GREEK_DASIA_AND_PERISPOMENI = 8159,
|
||||
U_GREEK_DIALYTIKA_AND_VARIA = 8173,
|
||||
U_GREEK_DIALYTIKA_AND_OXIA = 8174,
|
||||
U_GREEK_VARIA = 8175,
|
||||
U_GREEK_OXIA = 8189,
|
||||
U_GREEK_DASIA = 8190,
|
||||
U_OVERLINE = 8254,
|
||||
/**
|
||||
* UTF-8 BOM
|
||||
* Unicode Character 'ZERO WIDTH NO-BREAK SPACE' (U+FEFF)
|
||||
* http://www.fileformat.info/info/unicode/char/feff/index.htm
|
||||
*/
|
||||
UTF8_BOM = 65279
|
||||
}
|
||||
17
node_modules/yaml-language-server/lib/umd/languageservice/utils/charCode.js
generated
vendored
Normal file
17
node_modules/yaml-language-server/lib/umd/languageservice/utils/charCode.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
});
|
||||
//# sourceMappingURL=charCode.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/charCode.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/charCode.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"charCode.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/charCode.ts"],"names":[],"mappings":"AAAA;;;gGAGgG"}
|
||||
5
node_modules/yaml-language-server/lib/umd/languageservice/utils/documentPositionCalculator.d.ts
generated
vendored
Normal file
5
node_modules/yaml-language-server/lib/umd/languageservice/utils/documentPositionCalculator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Position } from 'vscode-languageserver-types';
|
||||
export declare function insertionPointReturnValue(pt: number): number;
|
||||
export declare function binarySearch(array: number[], sought: number): number;
|
||||
export declare function getLineStartPositions(text: string): number[];
|
||||
export declare function getPosition(pos: number, lineStartPositions: number[]): Position;
|
||||
73
node_modules/yaml-language-server/lib/umd/languageservice/utils/documentPositionCalculator.js
generated
vendored
Normal file
73
node_modules/yaml-language-server/lib/umd/languageservice/utils/documentPositionCalculator.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports", "vscode-languageserver-types"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getPosition = exports.getLineStartPositions = exports.binarySearch = exports.insertionPointReturnValue = void 0;
|
||||
const vscode_languageserver_types_1 = require("vscode-languageserver-types");
|
||||
function insertionPointReturnValue(pt) {
|
||||
return -pt - 1;
|
||||
}
|
||||
exports.insertionPointReturnValue = insertionPointReturnValue;
|
||||
function binarySearch(array, sought) {
|
||||
let lower = 0;
|
||||
let upper = array.length - 1;
|
||||
while (lower <= upper) {
|
||||
const idx = Math.floor((lower + upper) / 2);
|
||||
const value = array[idx];
|
||||
if (value === sought) {
|
||||
return idx;
|
||||
}
|
||||
if (lower === upper) {
|
||||
const insertionPoint = value < sought ? idx + 1 : idx;
|
||||
return insertionPointReturnValue(insertionPoint);
|
||||
}
|
||||
if (sought > value) {
|
||||
lower = idx + 1;
|
||||
}
|
||||
else if (sought < value) {
|
||||
upper = idx - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.binarySearch = binarySearch;
|
||||
function getLineStartPositions(text) {
|
||||
const lineStartPositions = [0];
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
const c = text[i];
|
||||
if (c === '\r') {
|
||||
// Check for Windows encoding, otherwise we are old Mac
|
||||
if (i + 1 < text.length && text[i + 1] === '\n') {
|
||||
i++;
|
||||
}
|
||||
lineStartPositions.push(i + 1);
|
||||
}
|
||||
else if (c === '\n') {
|
||||
lineStartPositions.push(i + 1);
|
||||
}
|
||||
}
|
||||
return lineStartPositions;
|
||||
}
|
||||
exports.getLineStartPositions = getLineStartPositions;
|
||||
function getPosition(pos, lineStartPositions) {
|
||||
let line = binarySearch(lineStartPositions, pos);
|
||||
if (line < 0) {
|
||||
const insertionPoint = -1 * line - 1;
|
||||
line = insertionPoint - 1;
|
||||
}
|
||||
return vscode_languageserver_types_1.Position.create(line, pos - lineStartPositions[line]);
|
||||
}
|
||||
exports.getPosition = getPosition;
|
||||
});
|
||||
//# sourceMappingURL=documentPositionCalculator.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/documentPositionCalculator.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/documentPositionCalculator.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"documentPositionCalculator.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/documentPositionCalculator.ts"],"names":[],"mappings":"AAAA;;;;gGAIgG;;;;;;;;;;;;;IAEhG,6EAAuD;IAEvD,SAAgB,yBAAyB,CAAC,EAAU;QAClD,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;IACjB,CAAC;IAFD,8DAEC;IAED,SAAgB,YAAY,CAAC,KAAe,EAAE,MAAc;QAC1D,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAE7B,OAAO,KAAK,IAAI,KAAK,EAAE;YACrB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK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AC;IAlBD,sDAkBC;IAED,SAAgB,WAAW,CAAC,GAAW,EAAE,kBAA4B;QACnE,IAAI,IAAI,GAAG,YAAY,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;QAEjD,IAAI,IAAI,GAAG,CAAC,EAAE;YACZ,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;YACrC,IAAI,GAAG,cAAc,GAAG,CAAC,CAAC;SAC3B;QAED,OAAO,sCAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IATD,kCASC"}
|
||||
6
node_modules/yaml-language-server/lib/umd/languageservice/utils/flow-style-rewriter.d.ts
generated
vendored
Normal file
6
node_modules/yaml-language-server/lib/umd/languageservice/utils/flow-style-rewriter.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { ASTNode } from '../jsonASTTypes';
|
||||
export declare class FlowStyleRewriter {
|
||||
private readonly indentation;
|
||||
constructor(indentation: string);
|
||||
write(node: ASTNode): string | null;
|
||||
}
|
||||
67
node_modules/yaml-language-server/lib/umd/languageservice/utils/flow-style-rewriter.js
generated
vendored
Normal file
67
node_modules/yaml-language-server/lib/umd/languageservice/utils/flow-style-rewriter.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports", "yaml"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FlowStyleRewriter = void 0;
|
||||
const yaml_1 = require("yaml");
|
||||
class FlowStyleRewriter {
|
||||
constructor(indentation) {
|
||||
this.indentation = indentation;
|
||||
}
|
||||
write(node) {
|
||||
if (node.internalNode.srcToken['type'] !== 'flow-collection') {
|
||||
return null;
|
||||
}
|
||||
const collection = node.internalNode.srcToken;
|
||||
const blockType = collection.start.type === 'flow-map-start' ? 'block-map' : 'block-seq';
|
||||
const parentType = node.parent.type;
|
||||
const blockStyle = {
|
||||
type: blockType,
|
||||
offset: collection.offset,
|
||||
indent: collection.indent,
|
||||
items: [],
|
||||
};
|
||||
for (const item of collection.items) {
|
||||
yaml_1.CST.visit(item, ({ key, sep, value }) => {
|
||||
if (blockType === 'block-map') {
|
||||
const start = [{ type: 'space', indent: 0, offset: key.offset, source: this.indentation }];
|
||||
if (parentType === 'property') {
|
||||
// add a new line if part of a map
|
||||
start.unshift({ type: 'newline', indent: 0, offset: key.offset, source: '\n' });
|
||||
}
|
||||
blockStyle.items.push({
|
||||
start: start,
|
||||
key: key,
|
||||
sep: sep,
|
||||
value: value,
|
||||
});
|
||||
}
|
||||
else if (blockType === 'block-seq') {
|
||||
blockStyle.items.push({
|
||||
start: [
|
||||
{ type: 'newline', indent: 0, offset: value.offset, source: '\n' },
|
||||
{ type: 'space', indent: 0, offset: value.offset, source: this.indentation },
|
||||
{ type: 'seq-item-ind', indent: 0, offset: value.offset, source: '-' },
|
||||
{ type: 'space', indent: 0, offset: value.offset, source: ' ' },
|
||||
],
|
||||
value: value,
|
||||
});
|
||||
}
|
||||
if (value.type === 'flow-collection') {
|
||||
return yaml_1.visit.SKIP;
|
||||
}
|
||||
});
|
||||
}
|
||||
return yaml_1.CST.stringify(blockStyle);
|
||||
}
|
||||
}
|
||||
exports.FlowStyleRewriter = FlowStyleRewriter;
|
||||
});
|
||||
//# sourceMappingURL=flow-style-rewriter.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/flow-style-rewriter.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/flow-style-rewriter.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"flow-style-rewriter.js","sourceRoot":"","sources":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,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAiB,CAAC,CAAC;yBAChG;wBACD,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC;4BACpB,KAAK,EAAE,KAAK;4BACZ,GAAG,EAAE,GAAG;4BACR,GAAG,EAAE,GAAG;4BACR,KAAK,EAAE,KAAK;yBACb,CAAC,CAAC;qBACJ;yBAAM,IAAI,SAAS,KAAK,WAAW,EAAE;wBACpC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC;4BACpB,KAAK,EAAE;gCACL,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAiB;gCACjF,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAiB;gCAC3F,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAiB;gCACrF,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAiB;6BAC/E;4BACD,KAAK,EAAE,KAAK;yBACb,CAAC,CAAC;qBACJ;oBACD,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE;wBACpC,OAAO,YAAK,CAAC,IAAI,CAAC;qBACnB;gBACH,CAAC,CAAC,CAAC;aACJ;YACD,OAAO,UAAG,CAAC,SAAS,CAAC,UAAuB,CAAC,CAAC;QAChD,CAAC;KACF;IAlDD,8CAkDC"}
|
||||
15
node_modules/yaml-language-server/lib/umd/languageservice/utils/indentationGuesser.d.ts
generated
vendored
Normal file
15
node_modules/yaml-language-server/lib/umd/languageservice/utils/indentationGuesser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { TextBuffer } from './textBuffer';
|
||||
/**
|
||||
* Result for a guessIndentation
|
||||
*/
|
||||
export interface IGuessedIndentation {
|
||||
/**
|
||||
* If indentation is based on spaces (`insertSpaces` = true), then what is the number of spaces that make an indent?
|
||||
*/
|
||||
tabSize: number;
|
||||
/**
|
||||
* Is indentation based on spaces?
|
||||
*/
|
||||
insertSpaces: boolean;
|
||||
}
|
||||
export declare function guessIndentation(source: TextBuffer, defaultTabSize: number, defaultInsertSpaces: boolean): IGuessedIndentation;
|
||||
190
node_modules/yaml-language-server/lib/umd/languageservice/utils/indentationGuesser.js
generated
vendored
Normal file
190
node_modules/yaml-language-server/lib/umd/languageservice/utils/indentationGuesser.js
generated
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.guessIndentation = void 0;
|
||||
class SpacesDiffResult {
|
||||
constructor() {
|
||||
this.spacesDiff = 0;
|
||||
this.looksLikeAlignment = false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Compute the diff in spaces between two line's indentation.
|
||||
*/
|
||||
function spacesDiff(a, aLength, b, bLength, result) {
|
||||
result.spacesDiff = 0;
|
||||
result.looksLikeAlignment = false;
|
||||
// This can go both ways (e.g.):
|
||||
// - a: "\t"
|
||||
// - b: "\t "
|
||||
// => This should count 1 tab and 4 spaces
|
||||
let i;
|
||||
for (i = 0; i < aLength && i < bLength; i++) {
|
||||
const aCharCode = a.charCodeAt(i);
|
||||
const bCharCode = b.charCodeAt(i);
|
||||
if (aCharCode !== bCharCode) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let aSpacesCnt = 0, aTabsCount = 0;
|
||||
for (let j = i; j < aLength; j++) {
|
||||
const aCharCode = a.charCodeAt(j);
|
||||
if (aCharCode === 32 /* CharCode.Space */) {
|
||||
aSpacesCnt++;
|
||||
}
|
||||
else {
|
||||
aTabsCount++;
|
||||
}
|
||||
}
|
||||
let bSpacesCnt = 0, bTabsCount = 0;
|
||||
for (let j = i; j < bLength; j++) {
|
||||
const bCharCode = b.charCodeAt(j);
|
||||
if (bCharCode === 32 /* CharCode.Space */) {
|
||||
bSpacesCnt++;
|
||||
}
|
||||
else {
|
||||
bTabsCount++;
|
||||
}
|
||||
}
|
||||
if (aSpacesCnt > 0 && aTabsCount > 0) {
|
||||
return;
|
||||
}
|
||||
if (bSpacesCnt > 0 && bTabsCount > 0) {
|
||||
return;
|
||||
}
|
||||
const tabsDiff = Math.abs(aTabsCount - bTabsCount);
|
||||
const spacesDiff = Math.abs(aSpacesCnt - bSpacesCnt);
|
||||
if (tabsDiff === 0) {
|
||||
// check if the indentation difference might be caused by alignment reasons
|
||||
// sometime folks like to align their code, but this should not be used as a hint
|
||||
result.spacesDiff = spacesDiff;
|
||||
if (spacesDiff > 0 && 0 <= bSpacesCnt - 1 && bSpacesCnt - 1 < a.length && bSpacesCnt < b.length) {
|
||||
if (b.charCodeAt(bSpacesCnt) !== 32 /* CharCode.Space */ && a.charCodeAt(bSpacesCnt - 1) === 32 /* CharCode.Space */) {
|
||||
if (a.charCodeAt(a.length - 1) === 44 /* CharCode.Comma */) {
|
||||
// This looks like an alignment desire: e.g.
|
||||
// const a = b + c,
|
||||
// d = b - c;
|
||||
result.looksLikeAlignment = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (spacesDiff % tabsDiff === 0) {
|
||||
result.spacesDiff = spacesDiff / tabsDiff;
|
||||
}
|
||||
}
|
||||
function guessIndentation(source, defaultTabSize, defaultInsertSpaces) {
|
||||
// Look at most at the first 10k lines
|
||||
const linesCount = Math.min(source.getLineCount(), 10000);
|
||||
let linesIndentedWithTabsCount = 0; // number of lines that contain at least one tab in indentation
|
||||
let linesIndentedWithSpacesCount = 0; // number of lines that contain only spaces in indentation
|
||||
let previousLineText = ''; // content of latest line that contained non-whitespace chars
|
||||
let previousLineIndentation = 0; // index at which latest line contained the first non-whitespace char
|
||||
const ALLOWED_TAB_SIZE_GUESSES = [2, 4, 6, 8, 3, 5, 7]; // prefer even guesses for `tabSize`, limit to [2, 8].
|
||||
const MAX_ALLOWED_TAB_SIZE_GUESS = 8; // max(ALLOWED_TAB_SIZE_GUESSES) = 8
|
||||
const spacesDiffCount = [0, 0, 0, 0, 0, 0, 0, 0, 0]; // `tabSize` scores
|
||||
const tmp = new SpacesDiffResult();
|
||||
for (let lineNumber = 1; lineNumber <= linesCount; lineNumber++) {
|
||||
const currentLineLength = source.getLineLength(lineNumber);
|
||||
const currentLineText = source.getLineContent(lineNumber);
|
||||
// if the text buffer is chunk based, so long lines are cons-string, v8 will flattern the string when we check charCode.
|
||||
// checking charCode on chunks directly is cheaper.
|
||||
const useCurrentLineText = currentLineLength <= 65536;
|
||||
let currentLineHasContent = false; // does `currentLineText` contain non-whitespace chars
|
||||
let currentLineIndentation = 0; // index at which `currentLineText` contains the first non-whitespace char
|
||||
let currentLineSpacesCount = 0; // count of spaces found in `currentLineText` indentation
|
||||
let currentLineTabsCount = 0; // count of tabs found in `currentLineText` indentation
|
||||
for (let j = 0, lenJ = currentLineLength; j < lenJ; j++) {
|
||||
const charCode = useCurrentLineText ? currentLineText.charCodeAt(j) : source.getLineCharCode(lineNumber, j);
|
||||
if (charCode === 9 /* CharCode.Tab */) {
|
||||
currentLineTabsCount++;
|
||||
}
|
||||
else if (charCode === 32 /* CharCode.Space */) {
|
||||
currentLineSpacesCount++;
|
||||
}
|
||||
else {
|
||||
// Hit non whitespace character on this line
|
||||
currentLineHasContent = true;
|
||||
currentLineIndentation = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Ignore empty or only whitespace lines
|
||||
if (!currentLineHasContent) {
|
||||
continue;
|
||||
}
|
||||
if (currentLineTabsCount > 0) {
|
||||
linesIndentedWithTabsCount++;
|
||||
}
|
||||
else if (currentLineSpacesCount > 1) {
|
||||
linesIndentedWithSpacesCount++;
|
||||
}
|
||||
spacesDiff(previousLineText, previousLineIndentation, currentLineText, currentLineIndentation, tmp);
|
||||
if (tmp.looksLikeAlignment) {
|
||||
// if defaultInsertSpaces === true && the spaces count == tabSize, we may want to count it as valid indentation
|
||||
//
|
||||
// - item1
|
||||
// - item2
|
||||
//
|
||||
// otherwise skip this line entirely
|
||||
//
|
||||
// const a = 1,
|
||||
// b = 2;
|
||||
if (!(defaultInsertSpaces && defaultTabSize === tmp.spacesDiff)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
const currentSpacesDiff = tmp.spacesDiff;
|
||||
if (currentSpacesDiff <= MAX_ALLOWED_TAB_SIZE_GUESS) {
|
||||
spacesDiffCount[currentSpacesDiff]++;
|
||||
}
|
||||
previousLineText = currentLineText;
|
||||
previousLineIndentation = currentLineIndentation;
|
||||
}
|
||||
let insertSpaces = defaultInsertSpaces;
|
||||
if (linesIndentedWithTabsCount !== linesIndentedWithSpacesCount) {
|
||||
insertSpaces = linesIndentedWithTabsCount < linesIndentedWithSpacesCount;
|
||||
}
|
||||
let tabSize = defaultTabSize;
|
||||
// Guess tabSize only if inserting spaces...
|
||||
if (insertSpaces) {
|
||||
let tabSizeScore = insertSpaces ? 0 : 0.1 * linesCount;
|
||||
// console.log("score threshold: " + tabSizeScore);
|
||||
ALLOWED_TAB_SIZE_GUESSES.forEach((possibleTabSize) => {
|
||||
const possibleTabSizeScore = spacesDiffCount[possibleTabSize];
|
||||
if (possibleTabSizeScore > tabSizeScore) {
|
||||
tabSizeScore = possibleTabSizeScore;
|
||||
tabSize = possibleTabSize;
|
||||
}
|
||||
});
|
||||
// Let a tabSize of 2 win even if it is not the maximum
|
||||
// (only in case 4 was guessed)
|
||||
if (tabSize === 4 && spacesDiffCount[4] > 0 && spacesDiffCount[2] > 0 && spacesDiffCount[2] >= spacesDiffCount[4] / 2) {
|
||||
tabSize = 2;
|
||||
}
|
||||
}
|
||||
// console.log('--------------------------');
|
||||
// console.log('linesIndentedWithTabsCount: ' + linesIndentedWithTabsCount + ', linesIndentedWithSpacesCount: ' + linesIndentedWithSpacesCount);
|
||||
// console.log('spacesDiffCount: ' + spacesDiffCount);
|
||||
// console.log('tabSize: ' + tabSize + ', tabSizeScore: ' + tabSizeScore);
|
||||
return {
|
||||
insertSpaces: insertSpaces,
|
||||
tabSize: tabSize,
|
||||
};
|
||||
}
|
||||
exports.guessIndentation = guessIndentation;
|
||||
});
|
||||
//# sourceMappingURL=indentationGuesser.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/indentationGuesser.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/indentationGuesser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
node_modules/yaml-language-server/lib/umd/languageservice/utils/json.d.ts
generated
vendored
Normal file
11
node_modules/yaml-language-server/lib/umd/languageservice/utils/json.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export interface StringifySettings {
|
||||
newLineFirst: boolean;
|
||||
indentFirstObject: boolean;
|
||||
shouldIndentWithTab: boolean;
|
||||
}
|
||||
interface StringifySettingsInternal extends StringifySettings {
|
||||
indentation: string;
|
||||
existingProps: string[];
|
||||
}
|
||||
export declare function stringifyObject(obj: unknown, indent: string, stringifyLiteral: (val: unknown) => string, settings: StringifySettingsInternal, depth?: number, consecutiveArrays?: number): string;
|
||||
export {};
|
||||
93
node_modules/yaml-language-server/lib/umd/languageservice/utils/json.js
generated
vendored
Normal file
93
node_modules/yaml-language-server/lib/umd/languageservice/utils/json.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.stringifyObject = void 0;
|
||||
function stringifyObject(obj, indent, stringifyLiteral, settings, depth = 0, consecutiveArrays = 0) {
|
||||
if (obj !== null && typeof obj === 'object') {
|
||||
/**
|
||||
* When we are autocompleting a snippet from a property we need the indent so everything underneath the property
|
||||
* is properly indented. When we are auto completion from a value we don't want the indent because the cursor
|
||||
* is already in the correct place
|
||||
*/
|
||||
const newIndent = (depth === 0 && settings.shouldIndentWithTab) || depth > 0 ? indent + settings.indentation : '';
|
||||
if (Array.isArray(obj)) {
|
||||
consecutiveArrays += 1;
|
||||
if (obj.length === 0) {
|
||||
return '';
|
||||
}
|
||||
let result = '';
|
||||
for (let i = 0; i < obj.length; i++) {
|
||||
let pseudoObj = obj[i];
|
||||
if (typeof obj[i] !== 'object') {
|
||||
result += '\n' + newIndent + '- ' + stringifyLiteral(obj[i]);
|
||||
continue;
|
||||
}
|
||||
if (!Array.isArray(obj[i])) {
|
||||
pseudoObj = prependToObject(obj[i], consecutiveArrays);
|
||||
}
|
||||
result += stringifyObject(pseudoObj, indent, stringifyLiteral, settings, (depth += 1), consecutiveArrays);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
const keys = Object.keys(obj);
|
||||
if (keys.length === 0) {
|
||||
return '';
|
||||
}
|
||||
let result = (depth === 0 && settings.newLineFirst) || depth > 0 ? '\n' : '';
|
||||
let isFirstProp = true;
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
if (depth === 0 && settings.existingProps.includes(key)) {
|
||||
// Don't add existing properties to the YAML
|
||||
continue;
|
||||
}
|
||||
const isObject = typeof obj[key] === 'object';
|
||||
const colonDelimiter = isObject ? ':' : ': '; // add space only when value is primitive
|
||||
const parentArrayCompensation = isObject && /^\s|-/.test(key) ? settings.indentation : ''; // add extra space if parent is an array
|
||||
const objectIndent = newIndent + parentArrayCompensation;
|
||||
const lineBreak = isFirstProp ? '' : '\n'; // break line only if it's not the first property
|
||||
// The first child of an array needs to be treated specially, otherwise indentations will be off
|
||||
if (depth === 0 && isFirstProp && !settings.indentFirstObject) {
|
||||
const value = stringifyObject(obj[key], objectIndent, stringifyLiteral, settings, depth + 1, 0);
|
||||
result += lineBreak + indent + key + colonDelimiter + value;
|
||||
}
|
||||
else {
|
||||
const value = stringifyObject(obj[key], objectIndent, stringifyLiteral, settings, depth + 1, 0);
|
||||
result += lineBreak + newIndent + key + colonDelimiter + value;
|
||||
}
|
||||
isFirstProp = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return stringifyLiteral(obj);
|
||||
}
|
||||
exports.stringifyObject = stringifyObject;
|
||||
function prependToObject(obj, consecutiveArrays) {
|
||||
const newObj = {};
|
||||
for (let i = 0; i < Object.keys(obj).length; i++) {
|
||||
const key = Object.keys(obj)[i];
|
||||
if (i === 0) {
|
||||
newObj['- '.repeat(consecutiveArrays) + key] = obj[key];
|
||||
}
|
||||
else {
|
||||
newObj[' '.repeat(consecutiveArrays) + key] = obj[key];
|
||||
}
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=json.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/json.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/json.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
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C,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;aACzD;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
||||
16
node_modules/yaml-language-server/lib/umd/languageservice/utils/objects.d.ts
generated
vendored
Normal file
16
node_modules/yaml-language-server/lib/umd/languageservice/utils/objects.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export declare function equals(one: any, other: any): boolean;
|
||||
export declare function isNumber(val: unknown): val is number;
|
||||
export declare function isDefined(val: unknown): val is object | string | number | boolean;
|
||||
export declare function isBoolean(val: unknown): val is boolean;
|
||||
export declare function isString(val: unknown): val is string;
|
||||
/**
|
||||
* Check that provided value is Iterable
|
||||
* @param val the value to check
|
||||
* @returns true if val is iterable, false otherwise
|
||||
*/
|
||||
export declare function isIterable(val: unknown): boolean;
|
||||
/**
|
||||
* Convert error to string witch should be sended to telemetry.
|
||||
* @param err any error
|
||||
*/
|
||||
export declare function convertErrorToTelemetryMsg(err: unknown): string;
|
||||
108
node_modules/yaml-language-server/lib/umd/languageservice/utils/objects.js
generated
vendored
Normal file
108
node_modules/yaml-language-server/lib/umd/languageservice/utils/objects.js
generated
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.convertErrorToTelemetryMsg = exports.isIterable = exports.isString = exports.isBoolean = exports.isDefined = exports.isNumber = exports.equals = void 0;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
||||
function equals(one, other) {
|
||||
if (one === other) {
|
||||
return true;
|
||||
}
|
||||
if (one === null || one === undefined || other === null || other === undefined) {
|
||||
return false;
|
||||
}
|
||||
if (typeof one !== typeof other) {
|
||||
return false;
|
||||
}
|
||||
if (typeof one !== 'object') {
|
||||
return false;
|
||||
}
|
||||
if (Array.isArray(one) !== Array.isArray(other)) {
|
||||
return false;
|
||||
}
|
||||
let i, key;
|
||||
if (Array.isArray(one)) {
|
||||
if (one.length !== other.length) {
|
||||
return false;
|
||||
}
|
||||
for (i = 0; i < one.length; i++) {
|
||||
if (!equals(one[i], other[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
const oneKeys = [];
|
||||
for (key in one) {
|
||||
oneKeys.push(key);
|
||||
}
|
||||
oneKeys.sort();
|
||||
const otherKeys = [];
|
||||
for (key in other) {
|
||||
otherKeys.push(key);
|
||||
}
|
||||
otherKeys.sort();
|
||||
if (!equals(oneKeys, otherKeys)) {
|
||||
return false;
|
||||
}
|
||||
for (i = 0; i < oneKeys.length; i++) {
|
||||
if (!equals(one[oneKeys[i]], other[oneKeys[i]])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.equals = equals;
|
||||
function isNumber(val) {
|
||||
return typeof val === 'number';
|
||||
}
|
||||
exports.isNumber = isNumber;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
function isDefined(val) {
|
||||
return typeof val !== 'undefined';
|
||||
}
|
||||
exports.isDefined = isDefined;
|
||||
function isBoolean(val) {
|
||||
return typeof val === 'boolean';
|
||||
}
|
||||
exports.isBoolean = isBoolean;
|
||||
function isString(val) {
|
||||
return typeof val === 'string';
|
||||
}
|
||||
exports.isString = isString;
|
||||
/**
|
||||
* Check that provided value is Iterable
|
||||
* @param val the value to check
|
||||
* @returns true if val is iterable, false otherwise
|
||||
*/
|
||||
function isIterable(val) {
|
||||
return Symbol.iterator in Object(val);
|
||||
}
|
||||
exports.isIterable = isIterable;
|
||||
/**
|
||||
* Convert error to string witch should be sended to telemetry.
|
||||
* @param err any error
|
||||
*/
|
||||
function convertErrorToTelemetryMsg(err) {
|
||||
if (!err)
|
||||
return 'null';
|
||||
if (err instanceof Error) {
|
||||
return err.stack ?? err.toString();
|
||||
}
|
||||
return err.toString();
|
||||
}
|
||||
exports.convertErrorToTelemetryMsg = convertErrorToTelemetryMsg;
|
||||
});
|
||||
//# sourceMappingURL=objects.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/objects.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/objects.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/objects.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;;;IAEhG,iHAAiH;IACjH,SAAgB,MAAM,CAAC,GAAQ,EAAE,KAAU;QACzC,IAAI,GAAG,KAAK,KAAK,EAAE;YACjB,OAAO,IAAI,CAAC;SACb;QACD,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;YAC9E,OAAO,KAAK,CAAC;SACd;QACD,IAAI,OAAO,GAAG,KAAK,OAAO,KAAK,EAAE;YAC/B,OAAO,KAAK,CAAC;SACd;QACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,OAAO,KAAK,CAAC;SACd;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC/C,OAAO,KAAK,CAAC;SACd;QAED,IAAI,CAAS,EAAE,GAAW,CAAC;QAE3B,IAAI,KAAK,C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AY;QACpC,OAAO,OAAO,GAAG,KAAK,WAAW,CAAC;IACpC,CAAC;IAFD,8BAEC;IAED,SAAgB,SAAS,CAAC,GAAY;QACpC,OAAO,OAAO,GAAG,KAAK,SAAS,CAAC;IAClC,CAAC;IAFD,8BAEC;IAED,SAAgB,QAAQ,CAAC,GAAY;QACnC,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC;IACjC,CAAC;IAFD,4BAEC;IAED;;;;OAIG;IACH,SAAgB,UAAU,CAAC,GAAY;QACrC,OAAO,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IAFD,gCAEC;IAED;;;OAGG;IACH,SAAgB,0BAA0B,CAAC,GAAY;QACrD,IAAI,CAAC,GAAG;YAAE,OAAO,MAAM,CAAC;QAExB,IAAI,GAAG,YAAY,KAAK,EAAE;YACxB,OAAO,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;SACpC;QAED,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IARD,gEAQC"}
|
||||
17
node_modules/yaml-language-server/lib/umd/languageservice/utils/parseUtils.d.ts
generated
vendored
Normal file
17
node_modules/yaml-language-server/lib/umd/languageservice/utils/parseUtils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ErrorCode } from 'vscode-json-languageservice/lib/umd/jsonLanguageTypes';
|
||||
export declare const DUPLICATE_KEY_REASON = "duplicate key";
|
||||
/**
|
||||
* An individual YAML diagnostic,
|
||||
* after formatting.
|
||||
*/
|
||||
export interface YAMLDocDiagnostic {
|
||||
message: string;
|
||||
location: {
|
||||
start: number;
|
||||
end: number;
|
||||
toLineEnd: boolean;
|
||||
};
|
||||
severity: 1 | 2;
|
||||
source?: string;
|
||||
code: ErrorCode;
|
||||
}
|
||||
15
node_modules/yaml-language-server/lib/umd/languageservice/utils/parseUtils.js
generated
vendored
Normal file
15
node_modules/yaml-language-server/lib/umd/languageservice/utils/parseUtils.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DUPLICATE_KEY_REASON = void 0;
|
||||
exports.DUPLICATE_KEY_REASON = 'duplicate key';
|
||||
});
|
||||
//# sourceMappingURL=parseUtils.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/parseUtils.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/parseUtils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"parseUtils.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/parseUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;IACa,QAAA,oBAAoB,GAAG,eAAe,CAAC"}
|
||||
5
node_modules/yaml-language-server/lib/umd/languageservice/utils/paths.d.ts
generated
vendored
Normal file
5
node_modules/yaml-language-server/lib/umd/languageservice/utils/paths.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { WorkspaceFolder, WorkspaceFoldersChangeEvent } from 'vscode-languageserver-protocol';
|
||||
import { URI } from 'vscode-uri';
|
||||
export declare const isRelativePath: (path: string) => boolean;
|
||||
export declare const relativeToAbsolutePath: (workspaceFolders: WorkspaceFolder[], workspaceRoot: URI, uri: string) => string;
|
||||
export declare const workspaceFoldersChanged: (workspaceFolders: WorkspaceFolder[], changedFolders: WorkspaceFoldersChangeEvent) => WorkspaceFolder[];
|
||||
58
node_modules/yaml-language-server/lib/umd/languageservice/utils/paths.js
generated
vendored
Normal file
58
node_modules/yaml-language-server/lib/umd/languageservice/utils/paths.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports", "path", "vscode-uri"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.workspaceFoldersChanged = exports.relativeToAbsolutePath = exports.isRelativePath = void 0;
|
||||
const path_1 = require("path");
|
||||
const vscode_uri_1 = require("vscode-uri");
|
||||
const isRelativePath = (path) => {
|
||||
const relativePathRegex = /^(((\.\.?)|([\w-@. ]+))(\/|\\\\?))*[\w-. ]*\.[\w-]+$/i;
|
||||
return relativePathRegex.test(path);
|
||||
};
|
||||
exports.isRelativePath = isRelativePath;
|
||||
const relativeToAbsolutePath = (workspaceFolders, workspaceRoot, uri) => {
|
||||
// Iterate through all of the workspace root folders
|
||||
for (const folder of workspaceFolders) {
|
||||
// If the requested schema URI specifies a workspace root folder
|
||||
// Convert it into an absolute path with the appropriate root folder path
|
||||
if (uri.startsWith(folder.name)) {
|
||||
const pathToFolder = vscode_uri_1.URI.parse(folder.uri).fsPath;
|
||||
const withoutFolderPrefix = uri.split(path_1.sep);
|
||||
withoutFolderPrefix.shift();
|
||||
return vscode_uri_1.URI.file((0, path_1.join)(pathToFolder, withoutFolderPrefix.join())).toString();
|
||||
}
|
||||
}
|
||||
// If a root folder was not specified, resolve the relative URI
|
||||
// Against the location of the workspace file instead
|
||||
if (workspaceRoot) {
|
||||
return vscode_uri_1.URI.file((0, path_1.join)(workspaceRoot.fsPath, uri)).toString();
|
||||
}
|
||||
// Fallback in case nothing could be applied
|
||||
return (0, path_1.normalize)(uri);
|
||||
};
|
||||
exports.relativeToAbsolutePath = relativeToAbsolutePath;
|
||||
const workspaceFoldersChanged = (workspaceFolders, changedFolders) => {
|
||||
workspaceFolders = workspaceFolders.filter((e) => {
|
||||
return !changedFolders.removed.some((f) => {
|
||||
return f.uri === e.uri;
|
||||
});
|
||||
});
|
||||
workspaceFolders = workspaceFolders
|
||||
.filter((e) => {
|
||||
return !changedFolders.added.some((f) => {
|
||||
return f.uri === e.uri;
|
||||
});
|
||||
})
|
||||
.concat(changedFolders.added);
|
||||
return workspaceFolders;
|
||||
};
|
||||
exports.workspaceFoldersChanged = workspaceFoldersChanged;
|
||||
});
|
||||
//# sourceMappingURL=paths.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/paths.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/paths.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/paths.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,+BAA4C;IAC5C,2CAAiC;IAE1B,MAAM,cAAc,GAAG,CAAC,IAAY,EAAW,EAAE;QACtD,MAAM,iBAAiB,GAAG,uDAAuD,CAAC;QAClF,OAAO,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC;IAHW,QAAA,cAAc,kBAGzB;IAEK,MAAM,sBAAsB,GAAG,CAAC,gBAAmC,EAAE,aAAkB,EAAE,GAAW,EAAU,EAAE;QACrH,oDAAoD;QACpD,KAAK,MAAM,MAAM,IAAI,gBAAgB,EAAE;YACrC,gEAAgE;YAChE,yEAAyE;YACzE,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBAC/B,MAAM,YAAY,GAAG,gBAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;gBAClD,MAAM,mBAAmB,GAAG,GAAG,CAAC,KAAK,CAAC,UAAG,CAAC,CAAC;gBAC3C,mBAAmB,CAAC,KAAK,EAAE,CAAC;gBAE5B,OAAO,gBAAG,CAAC,IAAI,CAAC,IAAA,WAAI,EAAC,YAAY,EAAE,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;aAC5E;SACF;QAED,+DAA+D;QAC/D,qDAAqD;QACrD,IAAI,aAAa,EAAE;YACjB,OAAO,gBAAG,CAAC,IAAI,CAAC,IAAA,WAAI,EAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;SAC7D;QAED,4CAA4C;QAC5C,OAAO,IAAA,gBAAS,EAAC,GAAG,CAAC,CAAC;IACxB,CAAC,CAAC;IAtBW,QAAA,sBAAsB,0BAsBjC;IAEK,MAAM,uBAAuB,GAAG,CACrC,gBAAmC,EACnC,cAA2C,EACxB,EAAE;QACrB,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YAC/C,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;gBACxC,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,gBAAgB,GAAG,gBAAgB;aAChC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YACZ,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;gBACtC,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;aACD,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,gBAAgB,CAAC;IAC1B,CAAC,CAAC;IAjBW,QAAA,uBAAuB,2BAiBlC"}
|
||||
13
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUrls.d.ts
generated
vendored
Normal file
13
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUrls.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { WorkspaceFolder } from 'vscode-languageserver-protocol';
|
||||
import { URI } from 'vscode-uri';
|
||||
import { Telemetry } from '../telemetry';
|
||||
import { JSONSchema } from '../jsonSchema';
|
||||
export declare const KUBERNETES_SCHEMA_URL = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json";
|
||||
export declare const JSON_SCHEMASTORE_URL = "https://www.schemastore.org/api/json/catalog.json";
|
||||
export declare function checkSchemaURI(workspaceFolders: WorkspaceFolder[], workspaceRoot: URI, uri: string, telemetry: Telemetry): string;
|
||||
/**
|
||||
* Collect all urls of sub schemas
|
||||
* @param schema the root schema
|
||||
* @returns map url to schema
|
||||
*/
|
||||
export declare function getSchemaUrls(schema: JSONSchema): Map<string, JSONSchema>;
|
||||
73
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUrls.js
generated
vendored
Normal file
73
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUrls.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports", "./objects", "./paths"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSchemaUrls = exports.checkSchemaURI = exports.JSON_SCHEMASTORE_URL = exports.KUBERNETES_SCHEMA_URL = void 0;
|
||||
const objects_1 = require("./objects");
|
||||
const paths_1 = require("./paths");
|
||||
exports.KUBERNETES_SCHEMA_URL = 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json';
|
||||
exports.JSON_SCHEMASTORE_URL = 'https://www.schemastore.org/api/json/catalog.json';
|
||||
function checkSchemaURI(workspaceFolders, workspaceRoot, uri, telemetry) {
|
||||
if (uri.trim().toLowerCase() === 'kubernetes') {
|
||||
telemetry.send({ name: 'yaml.schema.configured', properties: { kubernetes: true } });
|
||||
return exports.KUBERNETES_SCHEMA_URL;
|
||||
}
|
||||
else if ((0, paths_1.isRelativePath)(uri)) {
|
||||
return (0, paths_1.relativeToAbsolutePath)(workspaceFolders, workspaceRoot, uri);
|
||||
}
|
||||
else {
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
exports.checkSchemaURI = checkSchemaURI;
|
||||
/**
|
||||
* Collect all urls of sub schemas
|
||||
* @param schema the root schema
|
||||
* @returns map url to schema
|
||||
*/
|
||||
function getSchemaUrls(schema) {
|
||||
const result = new Map();
|
||||
if (!schema) {
|
||||
return result;
|
||||
}
|
||||
if (schema.url) {
|
||||
if (schema.url.startsWith('schemaservice://combinedSchema/')) {
|
||||
addSchemasForOf(schema, result);
|
||||
}
|
||||
else {
|
||||
result.set(schema.url, schema);
|
||||
}
|
||||
}
|
||||
else {
|
||||
addSchemasForOf(schema, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.getSchemaUrls = getSchemaUrls;
|
||||
function addSchemasForOf(schema, result) {
|
||||
if (schema.allOf) {
|
||||
addInnerSchemaUrls(schema.allOf, result);
|
||||
}
|
||||
if (schema.anyOf) {
|
||||
addInnerSchemaUrls(schema.anyOf, result);
|
||||
}
|
||||
if (schema.oneOf) {
|
||||
addInnerSchemaUrls(schema.oneOf, result);
|
||||
}
|
||||
}
|
||||
function addInnerSchemaUrls(schemas, result) {
|
||||
for (const subSchema of schemas) {
|
||||
if (!(0, objects_1.isBoolean)(subSchema) && subSchema.url && !result.has(subSchema.url)) {
|
||||
result.set(subSchema.url, subSchema);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=schemaUrls.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUrls.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUrls.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schemaUrls.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/schemaUrls.ts"],"names":[],"mappings":";;;;;;;;;;;;IAIA,uCAAsC;IACtC,mCAAiE;IAEpD,QAAA,qBAAqB,GAChC,0GAA0G,CAAC;IAChG,QAAA,oBAAoB,GAAG,mDAAmD,CAAC;IAExF,SAAgB,cAAc,CAC5B,gBAAmC,EACnC,aAAkB,EAClB,GAAW,EACX,SAAoB;QAEpB,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE;YAC7C,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YACrF,OAAO,6BAAqB,CAAC;SAC9B;aAAM,IAAI,IAAA,sBAAc,EAAC,GAAG,CAAC,EAAE;YAC9B,OAAO,IAAA,8BAAsB,EAAC,gBAAgB,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;SACrE;aAAM;YACL,OAAO,GAAG,CAAC;SACZ;IACH,CAAC;IAdD,wCAcC;IAED;;;;OAIG;IACH,SAAgB,aAAa,CAAC,MAAkB;QAC9C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAsB,CAAC;QAC7C,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,MAAM,CAAC;SACf;QAED,IAAI,MAAM,CAAC,GAAG,EAAE;YACd,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,iCAAiC,CAAC,EAAE;gBAC5D,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;aACjC;iBAAM;gBACL,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;aAChC;SACF;aAAM;YACL,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACjC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAhBD,sCAgBC;IAED,SAAS,eAAe,CAAC,MAAkB,EAAE,MAA+B;QAC1E,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,kBAAkB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAC1C;QACD,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,kBAAkB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAC1C;QACD,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,kBAAkB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAC1C;IACH,CAAC;IAED,SAAS,kBAAkB,CAAC,OAAwB,EAAE,MAA+B;QACnF,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE;YAC/B,IAAI,CAAC,IAAA,mBAAS,EAAC,SAAS,CAAC,IAAI,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;gBACxE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;aACtC;SACF;IACH,CAAC"}
|
||||
19
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUtils.d.ts
generated
vendored
Normal file
19
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUtils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { JSONSchema } from '../jsonSchema';
|
||||
export declare function getSchemaTypeName(schema: JSONSchema): string;
|
||||
/**
|
||||
* Get type name from reference url
|
||||
* @param $ref reference to the same file OR to the another component OR to the section in another component:
|
||||
* `schema-name.schema.json` -> schema-name
|
||||
* `custom-scheme://shared-schema.json#/definitions/SomeType` -> SomeType
|
||||
* `custom-scheme://schema-name.schema.json` -> schema-name
|
||||
* `shared-schema.schema.json#/definitions/SomeType` -> SomeType
|
||||
* `file:///Users/user/Documents/project/schemas/schema-name.schema.json` -> schema-name
|
||||
* `#/definitions/SomeType` -> SomeType
|
||||
* `#/definitions/io.k8s.api.apps.v1.DaemonSetSpec` => io.k8s.api.apps.v1.DaemonSetSpec
|
||||
* `file:///default_schema_id.yaml` => default_schema_id.yaml
|
||||
* test: https://regex101.com/r/ZpuXxk/1
|
||||
*/
|
||||
export declare function getSchemaRefTypeTitle($ref: string): string;
|
||||
export declare function getSchemaTitle(schema: JSONSchema, url: string): string;
|
||||
export declare function isPrimitiveType(schema: JSONSchema): boolean;
|
||||
export declare function isAnyOfAllOfOneOfType(schema: JSONSchema): boolean;
|
||||
80
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUtils.js
generated
vendored
Normal file
80
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUtils.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports", "vscode-uri", "path"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isAnyOfAllOfOneOfType = exports.isPrimitiveType = exports.getSchemaTitle = exports.getSchemaRefTypeTitle = exports.getSchemaTypeName = void 0;
|
||||
const vscode_uri_1 = require("vscode-uri");
|
||||
const path = require("path");
|
||||
function getSchemaTypeName(schema) {
|
||||
const closestTitleWithType = schema.type && schema.closestTitle;
|
||||
if (schema.title) {
|
||||
return schema.title;
|
||||
}
|
||||
if (schema.$id) {
|
||||
return getSchemaRefTypeTitle(schema.$id);
|
||||
}
|
||||
if (schema.$ref || schema._$ref) {
|
||||
return getSchemaRefTypeTitle(schema.$ref || schema._$ref);
|
||||
}
|
||||
return Array.isArray(schema.type)
|
||||
? schema.type.join(' | ')
|
||||
: closestTitleWithType
|
||||
? schema.type.concat('(', schema.closestTitle, ')')
|
||||
: schema.type || schema.closestTitle; //object
|
||||
}
|
||||
exports.getSchemaTypeName = getSchemaTypeName;
|
||||
/**
|
||||
* Get type name from reference url
|
||||
* @param $ref reference to the same file OR to the another component OR to the section in another component:
|
||||
* `schema-name.schema.json` -> schema-name
|
||||
* `custom-scheme://shared-schema.json#/definitions/SomeType` -> SomeType
|
||||
* `custom-scheme://schema-name.schema.json` -> schema-name
|
||||
* `shared-schema.schema.json#/definitions/SomeType` -> SomeType
|
||||
* `file:///Users/user/Documents/project/schemas/schema-name.schema.json` -> schema-name
|
||||
* `#/definitions/SomeType` -> SomeType
|
||||
* `#/definitions/io.k8s.api.apps.v1.DaemonSetSpec` => io.k8s.api.apps.v1.DaemonSetSpec
|
||||
* `file:///default_schema_id.yaml` => default_schema_id.yaml
|
||||
* test: https://regex101.com/r/ZpuXxk/1
|
||||
*/
|
||||
function getSchemaRefTypeTitle($ref) {
|
||||
const match = $ref.match(/^(?:.*\/)?(.*?)(?:\.schema\.json)?$/);
|
||||
let type = !!match && match[1];
|
||||
if (!type) {
|
||||
type = 'typeNotFound';
|
||||
console.error(`$ref (${$ref}) not parsed properly`);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
exports.getSchemaRefTypeTitle = getSchemaRefTypeTitle;
|
||||
function getSchemaTitle(schema, url) {
|
||||
const uri = vscode_uri_1.URI.parse(url);
|
||||
let baseName = path.basename(uri.fsPath);
|
||||
if (!path.extname(uri.fsPath)) {
|
||||
baseName += '.json';
|
||||
}
|
||||
if (Object.getOwnPropertyDescriptor(schema, 'name')) {
|
||||
return Object.getOwnPropertyDescriptor(schema, 'name').value + ` (${baseName})`;
|
||||
}
|
||||
else if (schema.title) {
|
||||
return schema.description ? schema.title + ' - ' + schema.description + ` (${baseName})` : schema.title + ` (${baseName})`;
|
||||
}
|
||||
return baseName;
|
||||
}
|
||||
exports.getSchemaTitle = getSchemaTitle;
|
||||
function isPrimitiveType(schema) {
|
||||
return schema.type !== 'object' && !isAnyOfAllOfOneOfType(schema);
|
||||
}
|
||||
exports.isPrimitiveType = isPrimitiveType;
|
||||
function isAnyOfAllOfOneOfType(schema) {
|
||||
return !!(schema.anyOf || schema.allOf || schema.oneOf);
|
||||
}
|
||||
exports.isAnyOfAllOfOneOfType = isAnyOfAllOfOneOfType;
|
||||
});
|
||||
//# sourceMappingURL=schemaUtils.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUtils.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/schemaUtils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schemaUtils.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/schemaUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAAiC;IAEjC,6BAA6B;IAE7B,SAAgB,iBAAiB,CAAC,MAAkB;QAClD,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,YAAY,CAAC;QAChE,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,OAAO,MAAM,CAAC,KAAK,CAAC;SACrB;QACD,IAAI,MAAM,CAAC,GAAG,EAAE;YACd,OAAO,qBAAqB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAC1C;QACD,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE;YAC/B,OAAO,qBAAqB,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;SAC3D;QACD,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;YAC/B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACzB,CAAC,CAAC,oBAAoB;gBACtB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;gBACnD,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,YAAY,CAAC,CA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AAM,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;IAFD,0CAEC;IAED,SAAgB,qBAAqB,CAAC,MAAkB;QACtD,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;IAFD,sDAEC"}
|
||||
10
node_modules/yaml-language-server/lib/umd/languageservice/utils/strings.d.ts
generated
vendored
Normal file
10
node_modules/yaml-language-server/lib/umd/languageservice/utils/strings.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export declare function startsWith(haystack: string, needle: string): boolean;
|
||||
/**
|
||||
* Determines if haystack ends with needle.
|
||||
*/
|
||||
export declare function endsWith(haystack: string, needle: string): boolean;
|
||||
export declare function convertSimple2RegExp(pattern: string): RegExp;
|
||||
export declare function convertSimple2RegExpPattern(pattern: string): string;
|
||||
export declare function getIndentation(lineContent: string, position: number): number;
|
||||
export declare function safeCreateUnicodeRegExp(pattern: string): RegExp;
|
||||
export declare function getFirstNonWhitespaceCharacterAfterOffset(str: string, offset: number): number;
|
||||
99
node_modules/yaml-language-server/lib/umd/languageservice/utils/strings.js
generated
vendored
Normal file
99
node_modules/yaml-language-server/lib/umd/languageservice/utils/strings.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getFirstNonWhitespaceCharacterAfterOffset = exports.safeCreateUnicodeRegExp = exports.getIndentation = exports.convertSimple2RegExpPattern = exports.convertSimple2RegExp = exports.endsWith = exports.startsWith = void 0;
|
||||
function startsWith(haystack, needle) {
|
||||
if (haystack.length < needle.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < needle.length; i++) {
|
||||
if (haystack[i] !== needle[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.startsWith = startsWith;
|
||||
/**
|
||||
* Determines if haystack ends with needle.
|
||||
*/
|
||||
function endsWith(haystack, needle) {
|
||||
const diff = haystack.length - needle.length;
|
||||
if (diff > 0) {
|
||||
return haystack.lastIndexOf(needle) === diff;
|
||||
}
|
||||
else if (diff === 0) {
|
||||
return haystack === needle;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.endsWith = endsWith;
|
||||
function convertSimple2RegExp(pattern) {
|
||||
const match = pattern.match(new RegExp('^/(.*?)/([gimy]*)$'));
|
||||
return match ? convertRegexString2RegExp(match[1], match[2]) : convertGlobalPattern2RegExp(pattern);
|
||||
}
|
||||
exports.convertSimple2RegExp = convertSimple2RegExp;
|
||||
function convertGlobalPattern2RegExp(pattern) {
|
||||
return new RegExp(pattern.replace(/[-\\{}+?|^$.,[\]()#\s]/g, '\\$&').replace(/[*]/g, '.*') + '$');
|
||||
}
|
||||
function convertRegexString2RegExp(pattern, flag) {
|
||||
return new RegExp(pattern, flag);
|
||||
}
|
||||
function convertSimple2RegExpPattern(pattern) {
|
||||
return pattern.replace(/[-\\{}+?|^$.,[\]()#\s]/g, '\\$&').replace(/[*]/g, '.*');
|
||||
}
|
||||
exports.convertSimple2RegExpPattern = convertSimple2RegExpPattern;
|
||||
function getIndentation(lineContent, position) {
|
||||
if (lineContent.length < position) {
|
||||
return 0;
|
||||
}
|
||||
for (let i = 0; i < position; i++) {
|
||||
const char = lineContent.charCodeAt(i);
|
||||
if (char !== 32 /* CharCode.Space */ && char !== 9 /* CharCode.Tab */) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
// assuming that current position is indentation
|
||||
return position;
|
||||
}
|
||||
exports.getIndentation = getIndentation;
|
||||
function safeCreateUnicodeRegExp(pattern) {
|
||||
// fall back to regular regexp if we cannot create Unicode one
|
||||
try {
|
||||
return new RegExp(pattern, 'u');
|
||||
}
|
||||
catch (ignore) {
|
||||
return new RegExp(pattern);
|
||||
}
|
||||
}
|
||||
exports.safeCreateUnicodeRegExp = safeCreateUnicodeRegExp;
|
||||
function getFirstNonWhitespaceCharacterAfterOffset(str, offset) {
|
||||
offset++;
|
||||
for (let i = offset; i < str.length; i++) {
|
||||
const char = str.charAt(i);
|
||||
if (char === ' ' || char === '\t') {
|
||||
offset++;
|
||||
}
|
||||
else {
|
||||
return offset;
|
||||
}
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
exports.getFirstNonWhitespaceCharacterAfterOffset = getFirstNonWhitespaceCharacterAfterOffset;
|
||||
});
|
||||
//# sourceMappingURL=strings.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/strings.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/strings.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/strings.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;;;IAIhG,SAAgB,UAAU,CAAC,QAAgB,EAAE,MAAc;QACzD,IAAI,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;YACnC,OAAO,KAAK,CAAC;SACd;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE;gBAC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AFD,kEAEC;IAED,SAAgB,cAAc,CAAC,WAAmB,EAAE,QAAgB;QAClE,IAAI,WAAW,CAAC,MAAM,GAAG,QAAQ,EAAE;YACjC,OAAO,CAAC,CAAC;SACV;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE;YACjC,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,IAAI,4BAAmB,IAAI,IAAI,yBAAiB,EAAE;gBACpD,OAAO,CAAC,CAAC;aACV;SACF;QAED,gDAAgD;QAChD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAdD,wCAcC;IAED,SAAgB,uBAAuB,CAAC,OAAe;QACrD,8DAA8D;QAC9D,IAAI;YACF,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;SACjC;QAAC,OAAO,MAAM,EAAE;YACf,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;SAC5B;IACH,CAAC;IAPD,0DAOC;IAED,SAAgB,yCAAyC,CAAC,GAAW,EAAE,MAAc;QACnF,MAAM,EAAE,CAAC;QACT,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3B,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,EAAE;gBACjC,MAAM,EAAE,CAAC;aACV;iBAAM;gBACL,OAAO,MAAM,CAAC;aACf;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAXD,8FAWC"}
|
||||
12
node_modules/yaml-language-server/lib/umd/languageservice/utils/textBuffer.d.ts
generated
vendored
Normal file
12
node_modules/yaml-language-server/lib/umd/languageservice/utils/textBuffer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { TextDocument } from 'vscode-languageserver-textdocument';
|
||||
import { Position, Range } from 'vscode-languageserver-types';
|
||||
export declare class TextBuffer {
|
||||
private doc;
|
||||
constructor(doc: TextDocument);
|
||||
getLineCount(): number;
|
||||
getLineLength(lineNumber: number): number;
|
||||
getLineContent(lineNumber: number): string;
|
||||
getLineCharCode(lineNumber: number, index: number): number;
|
||||
getText(range?: Range): string;
|
||||
getPosition(offest: number): Position;
|
||||
}
|
||||
59
node_modules/yaml-language-server/lib/umd/languageservice/utils/textBuffer.js
generated
vendored
Normal file
59
node_modules/yaml-language-server/lib/umd/languageservice/utils/textBuffer.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Red Hat. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports", "vscode-languageserver-types"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TextBuffer = void 0;
|
||||
const vscode_languageserver_types_1 = require("vscode-languageserver-types");
|
||||
class TextBuffer {
|
||||
constructor(doc) {
|
||||
this.doc = doc;
|
||||
}
|
||||
getLineCount() {
|
||||
return this.doc.lineCount;
|
||||
}
|
||||
getLineLength(lineNumber) {
|
||||
const lineOffsets = this.doc.getLineOffsets();
|
||||
if (lineNumber >= lineOffsets.length) {
|
||||
return this.doc.getText().length;
|
||||
}
|
||||
else if (lineNumber < 0) {
|
||||
return 0;
|
||||
}
|
||||
const nextLineOffset = lineNumber + 1 < lineOffsets.length ? lineOffsets[lineNumber + 1] : this.doc.getText().length;
|
||||
return nextLineOffset - lineOffsets[lineNumber];
|
||||
}
|
||||
getLineContent(lineNumber) {
|
||||
const lineOffsets = this.doc.getLineOffsets();
|
||||
if (lineNumber >= lineOffsets.length) {
|
||||
return this.doc.getText();
|
||||
}
|
||||
else if (lineNumber < 0) {
|
||||
return '';
|
||||
}
|
||||
const nextLineOffset = lineNumber + 1 < lineOffsets.length ? lineOffsets[lineNumber + 1] : this.doc.getText().length;
|
||||
return this.doc.getText().substring(lineOffsets[lineNumber], nextLineOffset);
|
||||
}
|
||||
getLineCharCode(lineNumber, index) {
|
||||
return this.doc.getText(vscode_languageserver_types_1.Range.create(lineNumber - 1, index, lineNumber - 1, index + 1)).charCodeAt(0);
|
||||
}
|
||||
getText(range) {
|
||||
return this.doc.getText(range);
|
||||
}
|
||||
getPosition(offest) {
|
||||
return this.doc.positionAt(offest);
|
||||
}
|
||||
}
|
||||
exports.TextBuffer = TextBuffer;
|
||||
});
|
||||
//# sourceMappingURL=textBuffer.js.map
|
||||
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/textBuffer.js.map
generated
vendored
Normal file
1
node_modules/yaml-language-server/lib/umd/languageservice/utils/textBuffer.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"textBuffer.js","sourceRoot":"","sources":["../../../../src/languageservice/utils/textBuffer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;;;IAGhG,6EAA8D;IAM9D,MAAa,UAAU;QACrB,YAAoB,GAAiB;YAAjB,QAAG,GAAH,GAAG,CAAc;QAAG,CAAC;QAEzC,YAAY;YACV,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;QAC5B,CAAC;QAED,aAAa,CAAC,UAAkB;YAC9B,MAAM,WAAW,GAAI,IAAI,CAAC,GAAmC,CAAC,cAAc,EAAE,CAAC;YAC/E,IAAI,UAAU,IAAI,WAAW,CAAC,MAAM,EAAE;gBACpC,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;aAClC;iB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