{"version":3,"sources":["webpack:///./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js","webpack:///./node_modules/monaco-editor/esm/vs/language/html/workerManager.js","webpack:///./node_modules/monaco-editor/esm/vs/language/html/languageFeatures.js","webpack:///./node_modules/monaco-editor/esm/vs/language/html/htmlMode.js"],"names":["integer","uinteger","Position","Range","Location","LocationLink","Color","ColorInformation","ColorPresentation","FoldingRangeKind","FoldingRange","DiagnosticRelatedInformation","DiagnosticSeverity","DiagnosticTag","CodeDescription","Diagnostic","Command","TextEdit","ChangeAnnotation","ChangeAnnotationIdentifier","AnnotatedTextEdit","TextDocumentEdit","CreateFile","RenameFile","DeleteFile","WorkspaceEdit","STOP_WHEN_IDLE_FOR","WorkerManager","defaults","_this","this","_defaults","_worker","_idleCheckInterval","window","setInterval","_checkIfIdle","_lastUsedTime","_configChangeListener","onDidChange","_stopWorker","prototype","dispose","_client","clearInterval","timePassedSinceLastUsed","Date","now","_getClient","createWebWorker","moduleId","createData","languageSettings","options","languageId","label","getProxy","getLanguageServiceWorker","resources","_i","arguments","length","then","client","_","withSyncedResources","MIN_VALUE","MAX_VALUE","create","line","character","Number","is","value","candidate","Is","objectLiteral","one","two","three","four","start","end","Error","uri","range","defined","string","undefined","targetUri","targetRange","targetSelectionRange","originSelectionRange","red","green","blue","alpha","numberRange","color","textEdit","additionalTextEdits","typedArray","startLine","endLine","startCharacter","endCharacter","kind","result","location","message","Warning","Information","Hint","Unnecessary","Deprecated","href","severity","code","source","relatedInformation","_a","number","codeDescription","title","command","args","replace","newText","insert","position","del","needsConfirmation","description","boolean","annotation","annotationId","textDocument","edits","OptionalVersionedTextDocumentIdentifier","Array","isArray","overwrite","ignoreIfExists","oldUri","newUri","recursive","ignoreIfNotExists","changes","documentChanges","every","change","TextDocumentIdentifier","VersionedTextDocumentIdentifier","TextDocumentItem","MarkupKind","MarkupContent","CompletionItemKind","InsertTextFormat","CompletionItemTag","InsertReplaceEdit","InsertTextMode","CompletionItem","CompletionList","MarkedString","Hover","ParameterInformation","SignatureInformation","DocumentHighlightKind","DocumentHighlight","SymbolKind","SymbolTag","SymbolInformation","DocumentSymbol","CodeActionKind","CodeActionContext","CodeAction","CodeLens","FormattingOptions","DocumentLink","SelectionRange","TextEditChangeImpl","changeAnnotations","edit","id","assertChangeAnnotations","manage","push","delete","add","all","clear","splice","ChangeAnnotations","annotations","_annotations","Object","_counter","_size","defineProperty","get","enumerable","configurable","idOrAnnotation","nextId","toString","WorkspaceChange","workspaceEdit","_textEditChanges","_workspaceEdit","_changeAnnotations","forEach","textEditChange","keys","key","initDocumentChanges","size","getTextEditChange","version","textDocumentEdit","initChanges","createFile","optionsOrAnnotation","operation","renameFile","deleteFile","text","PlainText","Markdown","Text","Method","Function","Constructor","Field","Variable","Class","Interface","Module","Property","Unit","Value","Enum","Keyword","Snippet","File","Reference","Folder","EnumMember","Constant","Struct","Event","Operator","TypeParameter","asIs","adjustIndentation","items","isIncomplete","fromPlainText","plainText","language","contents","documentation","parameters","Read","Write","Namespace","Package","String","Boolean","Key","Null","name","containerName","detail","selectionRange","children","deprecated","tags","Empty","QuickFix","Refactor","RefactorExtract","RefactorInline","RefactorRewrite","Source","SourceOrganizeImports","SourceFixAll","diagnostics","only","kindOrCommandOrEdit","checkKind","isPreferred","data","tabSize","insertSpaces","target","parent","TextDocument","content","FullTextDocument","lineCount","func","getText","positionAt","offsetAt","applyEdits","document","sortedEdits","mergeSort","a","b","diff","lastModifiedOffset","i","e","startOffset","endOffset","substring","compare","p","left","slice","right","leftIdx","rightIdx","ret","_uri","_languageId","_version","_content","_lineOffsets","update","event","getLineOffsets","lineOffsets","isLineStart","ch","charAt","offset","Math","max","min","low","high","mid","floor","lineOffset","nextLineOffset","fromPosition","column","lineNumber","fromRange","getStartPosition","getEndPosition","toRange","isInsertReplaceEdit","toCompletionItemKind","mItemKind","toTextEdit","toCommand","c","call","check","CompletionAdapter","provideCompletionItems","model","context","token","resource","worker","doComplete","info","wordInfo","getWordUntilPosition","wordRange","startColumn","endColumn","map","entry","item","insertText","sortText","filterText","insertTextFormat","insertTextRules","CompletionItemInsertTextRule","InsertAsSnippet","suggestions","isMarkupContent","thing","toMarkdownString","toMarkedStringArray","HoverAdapter","provideHover","doHover","toHighlighKind","mKind","DocumentHighlightAdapter","provideDocumentHighlights","findDocumentHighlights","toSymbolKind","DocumentSymbolAdapter","provideDocumentSymbols","findDocumentSymbols","DocumentLinkAdapter","provideLinks","findDocumentLinks","links","url","fromFormattingOptions","DocumentFormattingEditProvider","provideDocumentFormattingEdits","format","DocumentRangeFormattingEditProvider","provideDocumentRangeFormattingEdits","RenameAdapter","provideRenameEdits","newName","doRename","toWorkspaceEdit","resourceEdits","parse","FoldingRangeAdapter","provideFoldingRanges","getFoldingRanges","ranges","toFoldingRangeKind","Comment","Imports","Region","SelectionRangeAdapter","provideSelectionRanges","positions","getSelectionRanges","selectionRanges","setupMode1","uris","apply","registerCompletionItemProvider","registerHoverProvider","registerDocumentHighlightProvider","registerLinkProvider","registerFoldingRangeProvider","registerDocumentSymbolProvider","registerSelectionRangeProvider","registerRenameProvider","registerDocumentFormattingEditProvider","registerDocumentRangeFormattingEditProvider","setupMode","disposables","providers","registerProviders","modeConfiguration","disposeAll","completionItems","hovers","documentHighlights","documentSymbols","rename","foldingRanges","documentFormattingEdits","documentRangeFormattingEdits","asDisposable","pop"],"mappings":"kNAKWA,EAKAC,EASAC,EA8BAC,EA2BAC,EAwBAC,EA4BAC,EA8BAC,EAyBAC,EA2BAC,EAmBAC,EAsCAC,EAwBAC,EAwBAC,EAqBAC,EAYAC,EA2CAC,EA8BAC,EAoCAC,EAqBAC,EAQAC,EA4CAC,EAiBAC,EAuBAC,EAwBAC,EAuBAC,E,YCpmBPC,EAAqB,KACrB,EAA+B,WAC/B,SAASC,EAAcC,GACnB,IAAIC,EAAQC,KACZA,KAAKC,UAAYH,EACjBE,KAAKE,QAAU,KACfF,KAAKG,mBAAqBC,OAAOC,aAAY,WAAc,OAAON,EAAMO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,EAAoBva,EAASua,kBACnEC,GAAWH,GACPE,EAAkBE,iBAClBJ,EAAUvQ,KAAK,eAAU2P,+BAA+B/X,EAAY,IAAI,GAAmC0T,KAE3GmF,EAAkBG,QAClBL,EAAUvQ,KAAK,eAAU4P,sBAAsBhY,EAAY,IAAI,GAA8B0T,KAE7FmF,EAAkBI,oBAClBN,EAAUvQ,KAAK,eAAU6P,kCAAkCjY,EAAY,IAAI,GAA0C0T,KAErHmF,EAAkB7C,OAClB2C,EAAUvQ,KAAK,eAAU8P,qBAAqBlY,EAAY,IAAI,GAAqC0T,KAEnGmF,EAAkBK,iBAClBP,EAAUvQ,KAAK,eAAUgQ,+BAA+BpY,EAAY,IAAI,GAAuC0T,KAE/GmF,EAAkBM,QAClBR,EAAUvQ,KAAK,eAAUkQ,uBAAuBtY,EAAY,IAAI,GAA+B0T,KAE/FmF,EAAkBO,eAClBT,EAAUvQ,KAAK,eAAU+P,6BAA6BnY,EAAY,IAAI,GAAqC0T,KAE3GmF,EAAkBlB,iBAClBgB,EAAUvQ,KAAK,eAAUiQ,+BAA+BrY,EAAY,IAAI,GAAuC0T,KAE/GmF,EAAkBQ,yBAClBV,EAAUvQ,KAAK,eAAUmQ,uCAAuCvY,EAAY,IAAI,GAAgD0T,KAEhImF,EAAkBS,8BAClBX,EAAUvQ,KAAK,eAAUoQ,4CAA4CxY,EAAY,IAAI,GAAqD0T,KAKlJ,OAFAkF,IACAF,EAAYtQ,KAAKmR,GAAaZ,IACvBY,GAAab,GAExB,SAASa,GAAab,GAClB,MAAO,CAAEtZ,QAAS,WAAc,OAAO0Z,GAAWJ,KAEtD,SAASI,GAAWJ,GAChB,MAAOA,EAAYnY,OACfmY,EAAYc,MAAMpa","file":"js/chunk-2d2371be.b1f97ec8.js","sourcesContent":["/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nexport var integer;\n(function (integer) {\n integer.MIN_VALUE = -2147483648;\n integer.MAX_VALUE = 2147483647;\n})(integer || (integer = {}));\nexport var uinteger;\n(function (uinteger) {\n uinteger.MIN_VALUE = 0;\n uinteger.MAX_VALUE = 2147483647;\n})(uinteger || (uinteger = {}));\n/**\n * The Position namespace provides helper functions to work with\n * [Position](#Position) literals.\n */\nexport var Position;\n(function (Position) {\n /**\n * Creates a new Position literal from the given line and character.\n * @param line The position's line.\n * @param character The position's character.\n */\n function create(line, character) {\n if (line === Number.MAX_VALUE) {\n line = uinteger.MAX_VALUE;\n }\n if (character === Number.MAX_VALUE) {\n character = uinteger.MAX_VALUE;\n }\n return { line: line, character: character };\n }\n Position.create = create;\n /**\n * Checks whether the given literal conforms to the [Position](#Position) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }\n Position.is = is;\n})(Position || (Position = {}));\n/**\n * The Range namespace provides helper functions to work with\n * [Range](#Range) literals.\n */\nexport var Range;\n(function (Range) {\n function create(one, two, three, four) {\n if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {\n return { start: Position.create(one, two), end: Position.create(three, four) };\n }\n else if (Position.is(one) && Position.is(two)) {\n return { start: one, end: two };\n }\n else {\n throw new Error(\"Range#create called with invalid arguments[\" + one + \", \" + two + \", \" + three + \", \" + four + \"]\");\n }\n }\n Range.create = create;\n /**\n * Checks whether the given literal conforms to the [Range](#Range) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }\n Range.is = is;\n})(Range || (Range = {}));\n/**\n * The Location namespace provides helper functions to work with\n * [Location](#Location) literals.\n */\nexport var Location;\n(function (Location) {\n /**\n * Creates a Location literal.\n * @param uri The location's uri.\n * @param range The location's range.\n */\n function create(uri, range) {\n return { uri: uri, range: range };\n }\n Location.create = create;\n /**\n * Checks whether the given literal conforms to the [Location](#Location) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\n }\n Location.is = is;\n})(Location || (Location = {}));\n/**\n * The LocationLink namespace provides helper functions to work with\n * [LocationLink](#LocationLink) literals.\n */\nexport var LocationLink;\n(function (LocationLink) {\n /**\n * Creates a LocationLink literal.\n * @param targetUri The definition's uri.\n * @param targetRange The full range of the definition.\n * @param targetSelectionRange The span of the symbol definition at the target.\n * @param originSelectionRange The span of the symbol being defined in the originating source file.\n */\n function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\n }\n LocationLink.create = create;\n /**\n * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\n && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))\n && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\n }\n LocationLink.is = is;\n})(LocationLink || (LocationLink = {}));\n/**\n * The Color namespace provides helper functions to work with\n * [Color](#Color) literals.\n */\nexport var Color;\n(function (Color) {\n /**\n * Creates a new Color literal.\n */\n function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n }\n Color.create = create;\n /**\n * Checks whether the given literal conforms to the [Color](#Color) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.numberRange(candidate.red, 0, 1)\n && Is.numberRange(candidate.green, 0, 1)\n && Is.numberRange(candidate.blue, 0, 1)\n && Is.numberRange(candidate.alpha, 0, 1);\n }\n Color.is = is;\n})(Color || (Color = {}));\n/**\n * The ColorInformation namespace provides helper functions to work with\n * [ColorInformation](#ColorInformation) literals.\n */\nexport var ColorInformation;\n(function (ColorInformation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }\n ColorInformation.create = create;\n /**\n * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Range.is(candidate.range) && Color.is(candidate.color);\n }\n ColorInformation.is = is;\n})(ColorInformation || (ColorInformation = {}));\n/**\n * The Color namespace provides helper functions to work with\n * [ColorPresentation](#ColorPresentation) literals.\n */\nexport var ColorPresentation;\n(function (ColorPresentation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(label, textEdit, additionalTextEdits) {\n return {\n label: label,\n textEdit: textEdit,\n additionalTextEdits: additionalTextEdits,\n };\n }\n ColorPresentation.create = create;\n /**\n * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.string(candidate.label)\n && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\n && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\n }\n ColorPresentation.is = is;\n})(ColorPresentation || (ColorPresentation = {}));\n/**\n * Enum of known range kinds\n */\nexport var FoldingRangeKind;\n(function (FoldingRangeKind) {\n /**\n * Folding range for a comment\n */\n FoldingRangeKind[\"Comment\"] = \"comment\";\n /**\n * Folding range for a imports or includes\n */\n FoldingRangeKind[\"Imports\"] = \"imports\";\n /**\n * Folding range for a region (e.g. `#region`)\n */\n FoldingRangeKind[\"Region\"] = \"region\";\n})(FoldingRangeKind || (FoldingRangeKind = {}));\n/**\n * The folding range namespace provides helper functions to work with\n * [FoldingRange](#FoldingRange) literals.\n */\nexport var FoldingRange;\n(function (FoldingRange) {\n /**\n * Creates a new FoldingRange literal.\n */\n function create(startLine, endLine, startCharacter, endCharacter, kind) {\n var result = {\n startLine: startLine,\n endLine: endLine\n };\n if (Is.defined(startCharacter)) {\n result.startCharacter = startCharacter;\n }\n if (Is.defined(endCharacter)) {\n result.endCharacter = endCharacter;\n }\n if (Is.defined(kind)) {\n result.kind = kind;\n }\n return result;\n }\n FoldingRange.create = create;\n /**\n * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)\n && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))\n && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))\n && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\n }\n FoldingRange.is = is;\n})(FoldingRange || (FoldingRange = {}));\n/**\n * The DiagnosticRelatedInformation namespace provides helper functions to work with\n * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.\n */\nexport var DiagnosticRelatedInformation;\n(function (DiagnosticRelatedInformation) {\n /**\n * Creates a new DiagnosticRelatedInformation literal.\n */\n function create(location, message) {\n return {\n location: location,\n message: message\n };\n }\n DiagnosticRelatedInformation.create = create;\n /**\n * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\n }\n DiagnosticRelatedInformation.is = is;\n})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\n/**\n * The diagnostic's severity.\n */\nexport var DiagnosticSeverity;\n(function (DiagnosticSeverity) {\n /**\n * Reports an error.\n */\n DiagnosticSeverity.Error = 1;\n /**\n * Reports a warning.\n */\n DiagnosticSeverity.Warning = 2;\n /**\n * Reports an information.\n */\n DiagnosticSeverity.Information = 3;\n /**\n * Reports a hint.\n */\n DiagnosticSeverity.Hint = 4;\n})(DiagnosticSeverity || (DiagnosticSeverity = {}));\n/**\n * The diagnostic tags.\n *\n * @since 3.15.0\n */\nexport var DiagnosticTag;\n(function (DiagnosticTag) {\n /**\n * Unused or unnecessary code.\n *\n * Clients are allowed to render diagnostics with this tag faded out instead of having\n * an error squiggle.\n */\n DiagnosticTag.Unnecessary = 1;\n /**\n * Deprecated or obsolete code.\n *\n * Clients are allowed to rendered diagnostics with this tag strike through.\n */\n DiagnosticTag.Deprecated = 2;\n})(DiagnosticTag || (DiagnosticTag = {}));\n/**\n * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.\n *\n * @since 3.16.0\n */\nexport var CodeDescription;\n(function (CodeDescription) {\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Is.string(candidate.href);\n }\n CodeDescription.is = is;\n})(CodeDescription || (CodeDescription = {}));\n/**\n * The Diagnostic namespace provides helper functions to work with\n * [Diagnostic](#Diagnostic) literals.\n */\nexport var Diagnostic;\n(function (Diagnostic) {\n /**\n * Creates a new Diagnostic literal.\n */\n function create(range, message, severity, code, source, relatedInformation) {\n var result = { range: range, message: message };\n if (Is.defined(severity)) {\n result.severity = severity;\n }\n if (Is.defined(code)) {\n result.code = code;\n }\n if (Is.defined(source)) {\n result.source = source;\n }\n if (Is.defined(relatedInformation)) {\n result.relatedInformation = relatedInformation;\n }\n return result;\n }\n Diagnostic.create = create;\n /**\n * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.\n */\n function is(value) {\n var _a;\n var candidate = value;\n return Is.defined(candidate)\n && Range.is(candidate.range)\n && Is.string(candidate.message)\n && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\n && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\n && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))\n && (Is.string(candidate.source) || Is.undefined(candidate.source))\n && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\n }\n Diagnostic.is = is;\n})(Diagnostic || (Diagnostic = {}));\n/**\n * The Command namespace provides helper functions to work with\n * [Command](#Command) literals.\n */\nexport var Command;\n(function (Command) {\n /**\n * Creates a new Command literal.\n */\n function create(title, command) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var result = { title: title, command: command };\n if (Is.defined(args) && args.length > 0) {\n result.arguments = args;\n }\n return result;\n }\n Command.create = create;\n /**\n * Checks whether the given literal conforms to the [Command](#Command) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\n }\n Command.is = is;\n})(Command || (Command = {}));\n/**\n * The TextEdit namespace provides helper function to create replace,\n * insert and delete edits more easily.\n */\nexport var TextEdit;\n(function (TextEdit) {\n /**\n * Creates a replace text edit.\n * @param range The range of text to be replaced.\n * @param newText The new text.\n */\n function replace(range, newText) {\n return { range: range, newText: newText };\n }\n TextEdit.replace = replace;\n /**\n * Creates a insert text edit.\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n */\n function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }\n TextEdit.insert = insert;\n /**\n * Creates a delete text edit.\n * @param range The range of text to be deleted.\n */\n function del(range) {\n return { range: range, newText: '' };\n }\n TextEdit.del = del;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && Is.string(candidate.newText)\n && Range.is(candidate.range);\n }\n TextEdit.is = is;\n})(TextEdit || (TextEdit = {}));\nexport var ChangeAnnotation;\n(function (ChangeAnnotation) {\n function create(label, needsConfirmation, description) {\n var result = { label: label };\n if (needsConfirmation !== undefined) {\n result.needsConfirmation = needsConfirmation;\n }\n if (description !== undefined) {\n result.description = description;\n }\n return result;\n }\n ChangeAnnotation.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && Is.objectLiteral(candidate) && Is.string(candidate.label) &&\n (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n ChangeAnnotation.is = is;\n})(ChangeAnnotation || (ChangeAnnotation = {}));\nexport var ChangeAnnotationIdentifier;\n(function (ChangeAnnotationIdentifier) {\n function is(value) {\n var candidate = value;\n return typeof candidate === 'string';\n }\n ChangeAnnotationIdentifier.is = is;\n})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));\nexport var AnnotatedTextEdit;\n(function (AnnotatedTextEdit) {\n /**\n * Creates an annotated replace text edit.\n *\n * @param range The range of text to be replaced.\n * @param newText The new text.\n * @param annotation The annotation.\n */\n function replace(range, newText, annotation) {\n return { range: range, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.replace = replace;\n /**\n * Creates an annotated insert text edit.\n *\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n * @param annotation The annotation.\n */\n function insert(position, newText, annotation) {\n return { range: { start: position, end: position }, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.insert = insert;\n /**\n * Creates an annotated delete text edit.\n *\n * @param range The range of text to be deleted.\n * @param annotation The annotation.\n */\n function del(range, annotation) {\n return { range: range, newText: '', annotationId: annotation };\n }\n AnnotatedTextEdit.del = del;\n function is(value) {\n var candidate = value;\n return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n AnnotatedTextEdit.is = is;\n})(AnnotatedTextEdit || (AnnotatedTextEdit = {}));\n/**\n * The TextDocumentEdit namespace provides helper function to create\n * an edit that manipulates a text document.\n */\nexport var TextDocumentEdit;\n(function (TextDocumentEdit) {\n /**\n * Creates a new `TextDocumentEdit`\n */\n function create(textDocument, edits) {\n return { textDocument: textDocument, edits: edits };\n }\n TextDocumentEdit.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate)\n && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)\n && Array.isArray(candidate.edits);\n }\n TextDocumentEdit.is = is;\n})(TextDocumentEdit || (TextDocumentEdit = {}));\nexport var CreateFile;\n(function (CreateFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'create',\n uri: uri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n CreateFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n CreateFile.is = is;\n})(CreateFile || (CreateFile = {}));\nexport var RenameFile;\n(function (RenameFile) {\n function create(oldUri, newUri, options, annotation) {\n var result = {\n kind: 'rename',\n oldUri: oldUri,\n newUri: newUri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n RenameFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n RenameFile.is = is;\n})(RenameFile || (RenameFile = {}));\nexport var DeleteFile;\n(function (DeleteFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'delete',\n uri: uri\n };\n if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n DeleteFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n DeleteFile.is = is;\n})(DeleteFile || (DeleteFile = {}));\nexport var WorkspaceEdit;\n(function (WorkspaceEdit) {\n function is(value) {\n var candidate = value;\n return candidate &&\n (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&\n (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {\n if (Is.string(change.kind)) {\n return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\n }\n else {\n return TextDocumentEdit.is(change);\n }\n }));\n }\n WorkspaceEdit.is = is;\n})(WorkspaceEdit || (WorkspaceEdit = {}));\nvar TextEditChangeImpl = /** @class */ (function () {\n function TextEditChangeImpl(edits, changeAnnotations) {\n this.edits = edits;\n this.changeAnnotations = changeAnnotations;\n }\n TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.insert(position, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.insert(position, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.insert(position, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.replace(range, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.replace(range, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.replace(range, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.delete = function (range, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.del(range);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.del(range, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.del(range, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.add = function (edit) {\n this.edits.push(edit);\n };\n TextEditChangeImpl.prototype.all = function () {\n return this.edits;\n };\n TextEditChangeImpl.prototype.clear = function () {\n this.edits.splice(0, this.edits.length);\n };\n TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {\n if (value === undefined) {\n throw new Error(\"Text edit change is not configured to manage change annotations.\");\n }\n };\n return TextEditChangeImpl;\n}());\n/**\n * A helper class\n */\nvar ChangeAnnotations = /** @class */ (function () {\n function ChangeAnnotations(annotations) {\n this._annotations = annotations === undefined ? Object.create(null) : annotations;\n this._counter = 0;\n this._size = 0;\n }\n ChangeAnnotations.prototype.all = function () {\n return this._annotations;\n };\n Object.defineProperty(ChangeAnnotations.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {\n var id;\n if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {\n id = idOrAnnotation;\n }\n else {\n id = this.nextId();\n annotation = idOrAnnotation;\n }\n if (this._annotations[id] !== undefined) {\n throw new Error(\"Id \" + id + \" is already in use.\");\n }\n if (annotation === undefined) {\n throw new Error(\"No annotation provided for id \" + id);\n }\n this._annotations[id] = annotation;\n this._size++;\n return id;\n };\n ChangeAnnotations.prototype.nextId = function () {\n this._counter++;\n return this._counter.toString();\n };\n return ChangeAnnotations;\n}());\n/**\n * A workspace change helps constructing changes to a workspace.\n */\nvar WorkspaceChange = /** @class */ (function () {\n function WorkspaceChange(workspaceEdit) {\n var _this = this;\n this._textEditChanges = Object.create(null);\n if (workspaceEdit !== undefined) {\n this._workspaceEdit = workspaceEdit;\n if (workspaceEdit.documentChanges) {\n this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);\n workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n workspaceEdit.documentChanges.forEach(function (change) {\n if (TextDocumentEdit.is(change)) {\n var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);\n _this._textEditChanges[change.textDocument.uri] = textEditChange;\n }\n });\n }\n else if (workspaceEdit.changes) {\n Object.keys(workspaceEdit.changes).forEach(function (key) {\n var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\n _this._textEditChanges[key] = textEditChange;\n });\n }\n }\n else {\n this._workspaceEdit = {};\n }\n }\n Object.defineProperty(WorkspaceChange.prototype, \"edit\", {\n /**\n * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal\n * use to be returned from a workspace edit operation like rename.\n */\n get: function () {\n this.initDocumentChanges();\n if (this._changeAnnotations !== undefined) {\n if (this._changeAnnotations.size === 0) {\n this._workspaceEdit.changeAnnotations = undefined;\n }\n else {\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n }\n return this._workspaceEdit;\n },\n enumerable: false,\n configurable: true\n });\n WorkspaceChange.prototype.getTextEditChange = function (key) {\n if (OptionalVersionedTextDocumentIdentifier.is(key)) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var textDocument = { uri: key.uri, version: key.version };\n var result = this._textEditChanges[textDocument.uri];\n if (!result) {\n var edits = [];\n var textDocumentEdit = {\n textDocument: textDocument,\n edits: edits\n };\n this._workspaceEdit.documentChanges.push(textDocumentEdit);\n result = new TextEditChangeImpl(edits, this._changeAnnotations);\n this._textEditChanges[textDocument.uri] = result;\n }\n return result;\n }\n else {\n this.initChanges();\n if (this._workspaceEdit.changes === undefined) {\n throw new Error('Workspace edit is not configured for normal text edit changes.');\n }\n var result = this._textEditChanges[key];\n if (!result) {\n var edits = [];\n this._workspaceEdit.changes[key] = edits;\n result = new TextEditChangeImpl(edits);\n this._textEditChanges[key] = result;\n }\n return result;\n }\n };\n WorkspaceChange.prototype.initDocumentChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._changeAnnotations = new ChangeAnnotations();\n this._workspaceEdit.documentChanges = [];\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n };\n WorkspaceChange.prototype.initChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._workspaceEdit.changes = Object.create(null);\n }\n };\n WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = CreateFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = CreateFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = RenameFile.create(oldUri, newUri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = RenameFile.create(oldUri, newUri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = DeleteFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = DeleteFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n return WorkspaceChange;\n}());\nexport { WorkspaceChange };\n/**\n * The TextDocumentIdentifier namespace provides helper functions to work with\n * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.\n */\nexport var TextDocumentIdentifier;\n(function (TextDocumentIdentifier) {\n /**\n * Creates a new TextDocumentIdentifier literal.\n * @param uri The document's uri.\n */\n function create(uri) {\n return { uri: uri };\n }\n TextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }\n TextDocumentIdentifier.is = is;\n})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\n/**\n * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\n * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.\n */\nexport var VersionedTextDocumentIdentifier;\n(function (VersionedTextDocumentIdentifier) {\n /**\n * Creates a new VersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param uri The document's text.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n VersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);\n }\n VersionedTextDocumentIdentifier.is = is;\n})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\n/**\n * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with\n * [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) literals.\n */\nexport var OptionalVersionedTextDocumentIdentifier;\n(function (OptionalVersionedTextDocumentIdentifier) {\n /**\n * Creates a new OptionalVersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param uri The document's text.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n OptionalVersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));\n }\n OptionalVersionedTextDocumentIdentifier.is = is;\n})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));\n/**\n * The TextDocumentItem namespace provides helper functions to work with\n * [TextDocumentItem](#TextDocumentItem) literals.\n */\nexport var TextDocumentItem;\n(function (TextDocumentItem) {\n /**\n * Creates a new TextDocumentItem literal.\n * @param uri The document's uri.\n * @param languageId The document's language identifier.\n * @param version The document's version number.\n * @param text The document's text.\n */\n function create(uri, languageId, version, text) {\n return { uri: uri, languageId: languageId, version: version, text: text };\n }\n TextDocumentItem.create = create;\n /**\n * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);\n }\n TextDocumentItem.is = is;\n})(TextDocumentItem || (TextDocumentItem = {}));\n/**\n * Describes the content type that a client supports in various\n * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n *\n * Please note that `MarkupKinds` must not start with a `$`. This kinds\n * are reserved for internal usage.\n */\nexport var MarkupKind;\n(function (MarkupKind) {\n /**\n * Plain text is supported as a content format\n */\n MarkupKind.PlainText = 'plaintext';\n /**\n * Markdown is supported as a content format\n */\n MarkupKind.Markdown = 'markdown';\n})(MarkupKind || (MarkupKind = {}));\n(function (MarkupKind) {\n /**\n * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.\n */\n function is(value) {\n var candidate = value;\n return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\n }\n MarkupKind.is = is;\n})(MarkupKind || (MarkupKind = {}));\nexport var MarkupContent;\n(function (MarkupContent) {\n /**\n * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }\n MarkupContent.is = is;\n})(MarkupContent || (MarkupContent = {}));\n/**\n * The kind of a completion entry.\n */\nexport var CompletionItemKind;\n(function (CompletionItemKind) {\n CompletionItemKind.Text = 1;\n CompletionItemKind.Method = 2;\n CompletionItemKind.Function = 3;\n CompletionItemKind.Constructor = 4;\n CompletionItemKind.Field = 5;\n CompletionItemKind.Variable = 6;\n CompletionItemKind.Class = 7;\n CompletionItemKind.Interface = 8;\n CompletionItemKind.Module = 9;\n CompletionItemKind.Property = 10;\n CompletionItemKind.Unit = 11;\n CompletionItemKind.Value = 12;\n CompletionItemKind.Enum = 13;\n CompletionItemKind.Keyword = 14;\n CompletionItemKind.Snippet = 15;\n CompletionItemKind.Color = 16;\n CompletionItemKind.File = 17;\n CompletionItemKind.Reference = 18;\n CompletionItemKind.Folder = 19;\n CompletionItemKind.EnumMember = 20;\n CompletionItemKind.Constant = 21;\n CompletionItemKind.Struct = 22;\n CompletionItemKind.Event = 23;\n CompletionItemKind.Operator = 24;\n CompletionItemKind.TypeParameter = 25;\n})(CompletionItemKind || (CompletionItemKind = {}));\n/**\n * Defines whether the insert text in a completion item should be interpreted as\n * plain text or a snippet.\n */\nexport var InsertTextFormat;\n(function (InsertTextFormat) {\n /**\n * The primary text to be inserted is treated as a plain string.\n */\n InsertTextFormat.PlainText = 1;\n /**\n * The primary text to be inserted is treated as a snippet.\n *\n * A snippet can define tab stops and placeholders with `$1`, `$2`\n * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\n * the end of the snippet. Placeholders with equal identifiers are linked,\n * that is typing in one will update others too.\n *\n * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax\n */\n InsertTextFormat.Snippet = 2;\n})(InsertTextFormat || (InsertTextFormat = {}));\n/**\n * Completion item tags are extra annotations that tweak the rendering of a completion\n * item.\n *\n * @since 3.15.0\n */\nexport var CompletionItemTag;\n(function (CompletionItemTag) {\n /**\n * Render a completion as obsolete, usually using a strike-out.\n */\n CompletionItemTag.Deprecated = 1;\n})(CompletionItemTag || (CompletionItemTag = {}));\n/**\n * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.\n *\n * @since 3.16.0\n */\nexport var InsertReplaceEdit;\n(function (InsertReplaceEdit) {\n /**\n * Creates a new insert / replace edit\n */\n function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }\n InsertReplaceEdit.create = create;\n /**\n * Checks whether the given literal conforms to the [InsertReplaceEdit](#InsertReplaceEdit) interface.\n */\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);\n }\n InsertReplaceEdit.is = is;\n})(InsertReplaceEdit || (InsertReplaceEdit = {}));\n/**\n * How whitespace and indentation is handled during completion\n * item insertion.\n *\n * @since 3.16.0\n */\nexport var InsertTextMode;\n(function (InsertTextMode) {\n /**\n * The insertion or replace strings is taken as it is. If the\n * value is multi line the lines below the cursor will be\n * inserted using the indentation defined in the string value.\n * The client will not apply any kind of adjustments to the\n * string.\n */\n InsertTextMode.asIs = 1;\n /**\n * The editor adjusts leading whitespace of new lines so that\n * they match the indentation up to the cursor of the line for\n * which the item is accepted.\n *\n * Consider a line like this: <2tabs><3tabs>foo. Accepting a\n * multi line completion item is indented using 2 tabs and all\n * following lines inserted will be indented using 2 tabs as well.\n */\n InsertTextMode.adjustIndentation = 2;\n})(InsertTextMode || (InsertTextMode = {}));\n/**\n * The CompletionItem namespace provides functions to deal with\n * completion items.\n */\nexport var CompletionItem;\n(function (CompletionItem) {\n /**\n * Create a completion item and seed it with a label.\n * @param label The completion item's label\n */\n function create(label) {\n return { label: label };\n }\n CompletionItem.create = create;\n})(CompletionItem || (CompletionItem = {}));\n/**\n * The CompletionList namespace provides functions to deal with\n * completion lists.\n */\nexport var CompletionList;\n(function (CompletionList) {\n /**\n * Creates a new completion list.\n *\n * @param items The completion items.\n * @param isIncomplete The list is not complete.\n */\n function create(items, isIncomplete) {\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\n }\n CompletionList.create = create;\n})(CompletionList || (CompletionList = {}));\nexport var MarkedString;\n(function (MarkedString) {\n /**\n * Creates a marked string from plain text.\n *\n * @param plainText The plain text.\n */\n function fromPlainText(plainText) {\n return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n }\n MarkedString.fromPlainText = fromPlainText;\n /**\n * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.\n */\n function is(value) {\n var candidate = value;\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\n }\n MarkedString.is = is;\n})(MarkedString || (MarkedString = {}));\nexport var Hover;\n(function (Hover) {\n /**\n * Checks whether the given value conforms to the [Hover](#Hover) interface.\n */\n function is(value) {\n var candidate = value;\n return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\n MarkedString.is(candidate.contents) ||\n Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));\n }\n Hover.is = is;\n})(Hover || (Hover = {}));\n/**\n * The ParameterInformation namespace provides helper functions to work with\n * [ParameterInformation](#ParameterInformation) literals.\n */\nexport var ParameterInformation;\n(function (ParameterInformation) {\n /**\n * Creates a new parameter information literal.\n *\n * @param label A label string.\n * @param documentation A doc string.\n */\n function create(label, documentation) {\n return documentation ? { label: label, documentation: documentation } : { label: label };\n }\n ParameterInformation.create = create;\n})(ParameterInformation || (ParameterInformation = {}));\n/**\n * The SignatureInformation namespace provides helper functions to work with\n * [SignatureInformation](#SignatureInformation) literals.\n */\nexport var SignatureInformation;\n(function (SignatureInformation) {\n function create(label, documentation) {\n var parameters = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n parameters[_i - 2] = arguments[_i];\n }\n var result = { label: label };\n if (Is.defined(documentation)) {\n result.documentation = documentation;\n }\n if (Is.defined(parameters)) {\n result.parameters = parameters;\n }\n else {\n result.parameters = [];\n }\n return result;\n }\n SignatureInformation.create = create;\n})(SignatureInformation || (SignatureInformation = {}));\n/**\n * A document highlight kind.\n */\nexport var DocumentHighlightKind;\n(function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind.Text = 1;\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind.Read = 2;\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind.Write = 3;\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\n/**\n * DocumentHighlight namespace to provide helper functions to work with\n * [DocumentHighlight](#DocumentHighlight) literals.\n */\nexport var DocumentHighlight;\n(function (DocumentHighlight) {\n /**\n * Create a DocumentHighlight object.\n * @param range The range the highlight applies to.\n */\n function create(range, kind) {\n var result = { range: range };\n if (Is.number(kind)) {\n result.kind = kind;\n }\n return result;\n }\n DocumentHighlight.create = create;\n})(DocumentHighlight || (DocumentHighlight = {}));\n/**\n * A symbol kind.\n */\nexport var SymbolKind;\n(function (SymbolKind) {\n SymbolKind.File = 1;\n SymbolKind.Module = 2;\n SymbolKind.Namespace = 3;\n SymbolKind.Package = 4;\n SymbolKind.Class = 5;\n SymbolKind.Method = 6;\n SymbolKind.Property = 7;\n SymbolKind.Field = 8;\n SymbolKind.Constructor = 9;\n SymbolKind.Enum = 10;\n SymbolKind.Interface = 11;\n SymbolKind.Function = 12;\n SymbolKind.Variable = 13;\n SymbolKind.Constant = 14;\n SymbolKind.String = 15;\n SymbolKind.Number = 16;\n SymbolKind.Boolean = 17;\n SymbolKind.Array = 18;\n SymbolKind.Object = 19;\n SymbolKind.Key = 20;\n SymbolKind.Null = 21;\n SymbolKind.EnumMember = 22;\n SymbolKind.Struct = 23;\n SymbolKind.Event = 24;\n SymbolKind.Operator = 25;\n SymbolKind.TypeParameter = 26;\n})(SymbolKind || (SymbolKind = {}));\n/**\n * Symbol tags are extra annotations that tweak the rendering of a symbol.\n * @since 3.16\n */\nexport var SymbolTag;\n(function (SymbolTag) {\n /**\n * Render a symbol as obsolete, usually using a strike-out.\n */\n SymbolTag.Deprecated = 1;\n})(SymbolTag || (SymbolTag = {}));\nexport var SymbolInformation;\n(function (SymbolInformation) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the location of the symbol.\n * @param uri The resource of the location of symbol, defaults to the current document.\n * @param containerName The name of the symbol containing the symbol.\n */\n function create(name, kind, range, uri, containerName) {\n var result = {\n name: name,\n kind: kind,\n location: { uri: uri, range: range }\n };\n if (containerName) {\n result.containerName = containerName;\n }\n return result;\n }\n SymbolInformation.create = create;\n})(SymbolInformation || (SymbolInformation = {}));\nexport var DocumentSymbol;\n(function (DocumentSymbol) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param detail The detail of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the symbol.\n * @param selectionRange The selectionRange of the symbol.\n * @param children Children of the symbol.\n */\n function create(name, detail, kind, range, selectionRange, children) {\n var result = {\n name: name,\n detail: detail,\n kind: kind,\n range: range,\n selectionRange: selectionRange\n };\n if (children !== undefined) {\n result.children = children;\n }\n return result;\n }\n DocumentSymbol.create = create;\n /**\n * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.\n */\n function is(value) {\n var candidate = value;\n return candidate &&\n Is.string(candidate.name) && Is.number(candidate.kind) &&\n Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\n (candidate.detail === undefined || Is.string(candidate.detail)) &&\n (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&\n (candidate.children === undefined || Array.isArray(candidate.children)) &&\n (candidate.tags === undefined || Array.isArray(candidate.tags));\n }\n DocumentSymbol.is = is;\n})(DocumentSymbol || (DocumentSymbol = {}));\n/**\n * A set of predefined code action kinds\n */\nexport var CodeActionKind;\n(function (CodeActionKind) {\n /**\n * Empty kind.\n */\n CodeActionKind.Empty = '';\n /**\n * Base kind for quickfix actions: 'quickfix'\n */\n CodeActionKind.QuickFix = 'quickfix';\n /**\n * Base kind for refactoring actions: 'refactor'\n */\n CodeActionKind.Refactor = 'refactor';\n /**\n * Base kind for refactoring extraction actions: 'refactor.extract'\n *\n * Example extract actions:\n *\n * - Extract method\n * - Extract function\n * - Extract variable\n * - Extract interface from class\n * - ...\n */\n CodeActionKind.RefactorExtract = 'refactor.extract';\n /**\n * Base kind for refactoring inline actions: 'refactor.inline'\n *\n * Example inline actions:\n *\n * - Inline function\n * - Inline variable\n * - Inline constant\n * - ...\n */\n CodeActionKind.RefactorInline = 'refactor.inline';\n /**\n * Base kind for refactoring rewrite actions: 'refactor.rewrite'\n *\n * Example rewrite actions:\n *\n * - Convert JavaScript function to class\n * - Add or remove parameter\n * - Encapsulate field\n * - Make method static\n * - Move method to base class\n * - ...\n */\n CodeActionKind.RefactorRewrite = 'refactor.rewrite';\n /**\n * Base kind for source actions: `source`\n *\n * Source code actions apply to the entire file.\n */\n CodeActionKind.Source = 'source';\n /**\n * Base kind for an organize imports source action: `source.organizeImports`\n */\n CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\n /**\n * Base kind for auto-fix source actions: `source.fixAll`.\n *\n * Fix all actions automatically fix errors that have a clear fix that do not require user input.\n * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\n *\n * @since 3.15.0\n */\n CodeActionKind.SourceFixAll = 'source.fixAll';\n})(CodeActionKind || (CodeActionKind = {}));\n/**\n * The CodeActionContext namespace provides helper functions to work with\n * [CodeActionContext](#CodeActionContext) literals.\n */\nexport var CodeActionContext;\n(function (CodeActionContext) {\n /**\n * Creates a new CodeActionContext literal.\n */\n function create(diagnostics, only) {\n var result = { diagnostics: diagnostics };\n if (only !== undefined && only !== null) {\n result.only = only;\n }\n return result;\n }\n CodeActionContext.create = create;\n /**\n * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string));\n }\n CodeActionContext.is = is;\n})(CodeActionContext || (CodeActionContext = {}));\nexport var CodeAction;\n(function (CodeAction) {\n function create(title, kindOrCommandOrEdit, kind) {\n var result = { title: title };\n var checkKind = true;\n if (typeof kindOrCommandOrEdit === 'string') {\n checkKind = false;\n result.kind = kindOrCommandOrEdit;\n }\n else if (Command.is(kindOrCommandOrEdit)) {\n result.command = kindOrCommandOrEdit;\n }\n else {\n result.edit = kindOrCommandOrEdit;\n }\n if (checkKind && kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n CodeAction.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.title) &&\n (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\n (candidate.kind === undefined || Is.string(candidate.kind)) &&\n (candidate.edit !== undefined || candidate.command !== undefined) &&\n (candidate.command === undefined || Command.is(candidate.command)) &&\n (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&\n (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));\n }\n CodeAction.is = is;\n})(CodeAction || (CodeAction = {}));\n/**\n * The CodeLens namespace provides helper functions to work with\n * [CodeLens](#CodeLens) literals.\n */\nexport var CodeLens;\n(function (CodeLens) {\n /**\n * Creates a new CodeLens literal.\n */\n function create(range, data) {\n var result = { range: range };\n if (Is.defined(data)) {\n result.data = data;\n }\n return result;\n }\n CodeLens.create = create;\n /**\n * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\n }\n CodeLens.is = is;\n})(CodeLens || (CodeLens = {}));\n/**\n * The FormattingOptions namespace provides helper functions to work with\n * [FormattingOptions](#FormattingOptions) literals.\n */\nexport var FormattingOptions;\n(function (FormattingOptions) {\n /**\n * Creates a new FormattingOptions literal.\n */\n function create(tabSize, insertSpaces) {\n return { tabSize: tabSize, insertSpaces: insertSpaces };\n }\n FormattingOptions.create = create;\n /**\n * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\n }\n FormattingOptions.is = is;\n})(FormattingOptions || (FormattingOptions = {}));\n/**\n * The DocumentLink namespace provides helper functions to work with\n * [DocumentLink](#DocumentLink) literals.\n */\nexport var DocumentLink;\n(function (DocumentLink) {\n /**\n * Creates a new DocumentLink literal.\n */\n function create(range, target, data) {\n return { range: range, target: target, data: data };\n }\n DocumentLink.create = create;\n /**\n * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\n }\n DocumentLink.is = is;\n})(DocumentLink || (DocumentLink = {}));\n/**\n * The SelectionRange namespace provides helper function to work with\n * SelectionRange literals.\n */\nexport var SelectionRange;\n(function (SelectionRange) {\n /**\n * Creates a new SelectionRange\n * @param range the range.\n * @param parent an optional parent.\n */\n function create(range, parent) {\n return { range: range, parent: parent };\n }\n SelectionRange.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\n }\n SelectionRange.is = is;\n})(SelectionRange || (SelectionRange = {}));\nexport var EOL = ['\\n', '\\r\\n', '\\r'];\n/**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\nexport var TextDocument;\n(function (TextDocument) {\n /**\n * Creates a new ITextDocument literal from the given uri and content.\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }\n TextDocument.is = is;\n function applyEdits(document, edits) {\n var text = document.getText();\n var sortedEdits = mergeSort(edits, function (a, b) {\n var diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n var lastModifiedOffset = text.length;\n for (var i = sortedEdits.length - 1; i >= 0; i--) {\n var e = sortedEdits[i];\n var startOffset = document.offsetAt(e.range.start);\n var endOffset = document.offsetAt(e.range.end);\n if (endOffset <= lastModifiedOffset) {\n text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\n }\n else {\n throw new Error('Overlapping edit');\n }\n lastModifiedOffset = startOffset;\n }\n return text;\n }\n TextDocument.applyEdits = applyEdits;\n function mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n var p = (data.length / 2) | 0;\n var left = data.slice(0, p);\n var right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n var leftIdx = 0;\n var rightIdx = 0;\n var i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n var ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n }\n})(TextDocument || (TextDocument = {}));\n/**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\nvar FullTextDocument = /** @class */ (function () {\n function FullTextDocument(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n Object.defineProperty(FullTextDocument.prototype, \"uri\", {\n get: function () {\n return this._uri;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\n get: function () {\n return this._languageId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"version\", {\n get: function () {\n return this._version;\n },\n enumerable: false,\n configurable: true\n });\n FullTextDocument.prototype.getText = function (range) {\n if (range) {\n var start = this.offsetAt(range.start);\n var end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n };\n FullTextDocument.prototype.update = function (event, version) {\n this._content = event.text;\n this._version = version;\n this._lineOffsets = undefined;\n };\n FullTextDocument.prototype.getLineOffsets = function () {\n if (this._lineOffsets === undefined) {\n var lineOffsets = [];\n var text = this._content;\n var isLineStart = true;\n for (var i = 0; i < text.length; i++) {\n if (isLineStart) {\n lineOffsets.push(i);\n isLineStart = false;\n }\n var ch = text.charAt(i);\n isLineStart = (ch === '\\r' || ch === '\\n');\n if (ch === '\\r' && i + 1 < text.length && text.charAt(i + 1) === '\\n') {\n i++;\n }\n }\n if (isLineStart && text.length > 0) {\n lineOffsets.push(text.length);\n }\n this._lineOffsets = lineOffsets;\n }\n return this._lineOffsets;\n };\n FullTextDocument.prototype.positionAt = function (offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n var lineOffsets = this.getLineOffsets();\n var low = 0, high = lineOffsets.length;\n if (high === 0) {\n return Position.create(0, offset);\n }\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n var line = low - 1;\n return Position.create(line, offset - lineOffsets[line]);\n };\n FullTextDocument.prototype.offsetAt = function (position) {\n var lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n var lineOffset = lineOffsets[position.line];\n var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n };\n Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\n get: function () {\n return this.getLineOffsets().length;\n },\n enumerable: false,\n configurable: true\n });\n return FullTextDocument;\n}());\nvar Is;\n(function (Is) {\n var toString = Object.prototype.toString;\n function defined(value) {\n return typeof value !== 'undefined';\n }\n Is.defined = defined;\n function undefined(value) {\n return typeof value === 'undefined';\n }\n Is.undefined = undefined;\n function boolean(value) {\n return value === true || value === false;\n }\n Is.boolean = boolean;\n function string(value) {\n return toString.call(value) === '[object String]';\n }\n Is.string = string;\n function number(value) {\n return toString.call(value) === '[object Number]';\n }\n Is.number = number;\n function numberRange(value, min, max) {\n return toString.call(value) === '[object Number]' && min <= value && value <= max;\n }\n Is.numberRange = numberRange;\n function integer(value) {\n return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;\n }\n Is.integer = integer;\n function uinteger(value) {\n return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;\n }\n Is.uinteger = uinteger;\n function func(value) {\n return toString.call(value) === '[object Function]';\n }\n Is.func = func;\n function objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n }\n Is.objectLiteral = objectLiteral;\n function typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n }\n Is.typedArray = typedArray;\n})(Is || (Is = {}));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { editor } from './fillers/monaco-editor-core.js';\nvar STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min\nvar WorkerManager = /** @class */ (function () {\n function WorkerManager(defaults) {\n var _this = this;\n this._defaults = defaults;\n this._worker = null;\n this._idleCheckInterval = window.setInterval(function () { return _this._checkIfIdle(); }, 30 * 1000);\n this._lastUsedTime = 0;\n this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); });\n }\n WorkerManager.prototype._stopWorker = function () {\n if (this._worker) {\n this._worker.dispose();\n this._worker = null;\n }\n this._client = null;\n };\n WorkerManager.prototype.dispose = function () {\n clearInterval(this._idleCheckInterval);\n this._configChangeListener.dispose();\n this._stopWorker();\n };\n WorkerManager.prototype._checkIfIdle = function () {\n if (!this._worker) {\n return;\n }\n var timePassedSinceLastUsed = Date.now() - this._lastUsedTime;\n if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) {\n this._stopWorker();\n }\n };\n WorkerManager.prototype._getClient = function () {\n this._lastUsedTime = Date.now();\n if (!this._client) {\n this._worker = editor.createWebWorker({\n // module that exports the create() method and returns a `HTMLWorker` instance\n moduleId: 'vs/language/html/htmlWorker',\n // passed in to the create() method\n createData: {\n languageSettings: this._defaults.options,\n languageId: this._defaults.languageId\n },\n label: this._defaults.languageId\n });\n this._client = this._worker.getProxy();\n }\n return this._client;\n };\n WorkerManager.prototype.getLanguageServiceWorker = function () {\n var _this = this;\n var resources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n resources[_i] = arguments[_i];\n }\n var _client;\n return this._getClient()\n .then(function (client) {\n _client = client;\n })\n .then(function (_) {\n if (_this._worker) {\n return _this._worker.withSyncedResources(resources);\n }\n })\n .then(function (_) { return _client; });\n };\n return WorkerManager;\n}());\nexport { WorkerManager };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as lsTypes from './_deps/vscode-languageserver-types/main.js';\nimport { languages, Uri, Range } from './fillers/monaco-editor-core.js';\n// --- completion ------\nfunction fromPosition(position) {\n if (!position) {\n return void 0;\n }\n return { character: position.column - 1, line: position.lineNumber - 1 };\n}\nfunction fromRange(range) {\n if (!range) {\n return void 0;\n }\n return {\n start: fromPosition(range.getStartPosition()),\n end: fromPosition(range.getEndPosition())\n };\n}\nfunction toRange(range) {\n if (!range) {\n return void 0;\n }\n return new Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);\n}\nfunction isInsertReplaceEdit(edit) {\n return (typeof edit.insert !== 'undefined' &&\n typeof edit.replace !== 'undefined');\n}\nfunction toCompletionItemKind(kind) {\n var mItemKind = languages.CompletionItemKind;\n switch (kind) {\n case lsTypes.CompletionItemKind.Text:\n return mItemKind.Text;\n case lsTypes.CompletionItemKind.Method:\n return mItemKind.Method;\n case lsTypes.CompletionItemKind.Function:\n return mItemKind.Function;\n case lsTypes.CompletionItemKind.Constructor:\n return mItemKind.Constructor;\n case lsTypes.CompletionItemKind.Field:\n return mItemKind.Field;\n case lsTypes.CompletionItemKind.Variable:\n return mItemKind.Variable;\n case lsTypes.CompletionItemKind.Class:\n return mItemKind.Class;\n case lsTypes.CompletionItemKind.Interface:\n return mItemKind.Interface;\n case lsTypes.CompletionItemKind.Module:\n return mItemKind.Module;\n case lsTypes.CompletionItemKind.Property:\n return mItemKind.Property;\n case lsTypes.CompletionItemKind.Unit:\n return mItemKind.Unit;\n case lsTypes.CompletionItemKind.Value:\n return mItemKind.Value;\n case lsTypes.CompletionItemKind.Enum:\n return mItemKind.Enum;\n case lsTypes.CompletionItemKind.Keyword:\n return mItemKind.Keyword;\n case lsTypes.CompletionItemKind.Snippet:\n return mItemKind.Snippet;\n case lsTypes.CompletionItemKind.Color:\n return mItemKind.Color;\n case lsTypes.CompletionItemKind.File:\n return mItemKind.File;\n case lsTypes.CompletionItemKind.Reference:\n return mItemKind.Reference;\n }\n return mItemKind.Property;\n}\nfunction fromCompletionItemKind(kind) {\n var mItemKind = languages.CompletionItemKind;\n switch (kind) {\n case mItemKind.Text:\n return lsTypes.CompletionItemKind.Text;\n case mItemKind.Method:\n return lsTypes.CompletionItemKind.Method;\n case mItemKind.Function:\n return lsTypes.CompletionItemKind.Function;\n case mItemKind.Constructor:\n return lsTypes.CompletionItemKind.Constructor;\n case mItemKind.Field:\n return lsTypes.CompletionItemKind.Field;\n case mItemKind.Variable:\n return lsTypes.CompletionItemKind.Variable;\n case mItemKind.Class:\n return lsTypes.CompletionItemKind.Class;\n case mItemKind.Interface:\n return lsTypes.CompletionItemKind.Interface;\n case mItemKind.Module:\n return lsTypes.CompletionItemKind.Module;\n case mItemKind.Property:\n return lsTypes.CompletionItemKind.Property;\n case mItemKind.Unit:\n return lsTypes.CompletionItemKind.Unit;\n case mItemKind.Value:\n return lsTypes.CompletionItemKind.Value;\n case mItemKind.Enum:\n return lsTypes.CompletionItemKind.Enum;\n case mItemKind.Keyword:\n return lsTypes.CompletionItemKind.Keyword;\n case mItemKind.Snippet:\n return lsTypes.CompletionItemKind.Snippet;\n case mItemKind.Color:\n return lsTypes.CompletionItemKind.Color;\n case mItemKind.File:\n return lsTypes.CompletionItemKind.File;\n case mItemKind.Reference:\n return lsTypes.CompletionItemKind.Reference;\n }\n return lsTypes.CompletionItemKind.Property;\n}\nfunction toTextEdit(textEdit) {\n if (!textEdit) {\n return void 0;\n }\n return {\n range: toRange(textEdit.range),\n text: textEdit.newText\n };\n}\nfunction toCommand(c) {\n return c && c.command === 'editor.action.triggerSuggest'\n ? { id: c.command, title: c.title, arguments: c.arguments }\n : undefined;\n}\nvar CompletionAdapter = /** @class */ (function () {\n function CompletionAdapter(_worker) {\n this._worker = _worker;\n }\n Object.defineProperty(CompletionAdapter.prototype, \"triggerCharacters\", {\n get: function () {\n return ['.', ':', '<', '\"', '=', '/'];\n },\n enumerable: false,\n configurable: true\n });\n CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) {\n var resource = model.uri;\n return this._worker(resource)\n .then(function (worker) {\n return worker.doComplete(resource.toString(), fromPosition(position));\n })\n .then(function (info) {\n if (!info) {\n return;\n }\n var wordInfo = model.getWordUntilPosition(position);\n var wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);\n var items = info.items.map(function (entry) {\n var item = {\n label: entry.label,\n insertText: entry.insertText || entry.label,\n sortText: entry.sortText,\n filterText: entry.filterText,\n documentation: entry.documentation,\n command: toCommand(entry.command),\n detail: entry.detail,\n range: wordRange,\n kind: toCompletionItemKind(entry.kind)\n };\n if (entry.textEdit) {\n if (isInsertReplaceEdit(entry.textEdit)) {\n item.range = {\n insert: toRange(entry.textEdit.insert),\n replace: toRange(entry.textEdit.replace)\n };\n }\n else {\n item.range = toRange(entry.textEdit.range);\n }\n item.insertText = entry.textEdit.newText;\n }\n if (entry.additionalTextEdits) {\n item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);\n }\n if (entry.insertTextFormat === lsTypes.InsertTextFormat.Snippet) {\n item.insertTextRules = languages.CompletionItemInsertTextRule.InsertAsSnippet;\n }\n return item;\n });\n return {\n isIncomplete: info.isIncomplete,\n suggestions: items\n };\n });\n };\n return CompletionAdapter;\n}());\nexport { CompletionAdapter };\n// --- hover ------\nfunction isMarkupContent(thing) {\n return (thing && typeof thing === 'object' && typeof thing.kind === 'string');\n}\nfunction toMarkdownString(entry) {\n if (typeof entry === 'string') {\n return {\n value: entry\n };\n }\n if (isMarkupContent(entry)) {\n if (entry.kind === 'plaintext') {\n return {\n value: entry.value.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&')\n };\n }\n return {\n value: entry.value\n };\n }\n return { value: '```' + entry.language + '\\n' + entry.value + '\\n```\\n' };\n}\nfunction toMarkedStringArray(contents) {\n if (!contents) {\n return void 0;\n }\n if (Array.isArray(contents)) {\n return contents.map(toMarkdownString);\n }\n return [toMarkdownString(contents)];\n}\nvar HoverAdapter = /** @class */ (function () {\n function HoverAdapter(_worker) {\n this._worker = _worker;\n }\n HoverAdapter.prototype.provideHover = function (model, position, token) {\n var resource = model.uri;\n return this._worker(resource)\n .then(function (worker) {\n return worker.doHover(resource.toString(), fromPosition(position));\n })\n .then(function (info) {\n if (!info) {\n return;\n }\n return {\n range: toRange(info.range),\n contents: toMarkedStringArray(info.contents)\n };\n });\n };\n return HoverAdapter;\n}());\nexport { HoverAdapter };\n// --- document highlights ------\nfunction toHighlighKind(kind) {\n var mKind = languages.DocumentHighlightKind;\n switch (kind) {\n case lsTypes.DocumentHighlightKind.Read:\n return mKind.Read;\n case lsTypes.DocumentHighlightKind.Write:\n return mKind.Write;\n case lsTypes.DocumentHighlightKind.Text:\n return mKind.Text;\n }\n return mKind.Text;\n}\nvar DocumentHighlightAdapter = /** @class */ (function () {\n function DocumentHighlightAdapter(_worker) {\n this._worker = _worker;\n }\n DocumentHighlightAdapter.prototype.provideDocumentHighlights = function (model, position, token) {\n var resource = model.uri;\n return this._worker(resource)\n .then(function (worker) { return worker.findDocumentHighlights(resource.toString(), fromPosition(position)); })\n .then(function (items) {\n if (!items) {\n return;\n }\n return items.map(function (item) { return ({\n range: toRange(item.range),\n kind: toHighlighKind(item.kind)\n }); });\n });\n };\n return DocumentHighlightAdapter;\n}());\nexport { DocumentHighlightAdapter };\n// --- document symbols ------\nfunction toSymbolKind(kind) {\n var mKind = languages.SymbolKind;\n switch (kind) {\n case lsTypes.SymbolKind.File:\n return mKind.Array;\n case lsTypes.SymbolKind.Module:\n return mKind.Module;\n case lsTypes.SymbolKind.Namespace:\n return mKind.Namespace;\n case lsTypes.SymbolKind.Package:\n return mKind.Package;\n case lsTypes.SymbolKind.Class:\n return mKind.Class;\n case lsTypes.SymbolKind.Method:\n return mKind.Method;\n case lsTypes.SymbolKind.Property:\n return mKind.Property;\n case lsTypes.SymbolKind.Field:\n return mKind.Field;\n case lsTypes.SymbolKind.Constructor:\n return mKind.Constructor;\n case lsTypes.SymbolKind.Enum:\n return mKind.Enum;\n case lsTypes.SymbolKind.Interface:\n return mKind.Interface;\n case lsTypes.SymbolKind.Function:\n return mKind.Function;\n case lsTypes.SymbolKind.Variable:\n return mKind.Variable;\n case lsTypes.SymbolKind.Constant:\n return mKind.Constant;\n case lsTypes.SymbolKind.String:\n return mKind.String;\n case lsTypes.SymbolKind.Number:\n return mKind.Number;\n case lsTypes.SymbolKind.Boolean:\n return mKind.Boolean;\n case lsTypes.SymbolKind.Array:\n return mKind.Array;\n }\n return mKind.Function;\n}\nvar DocumentSymbolAdapter = /** @class */ (function () {\n function DocumentSymbolAdapter(_worker) {\n this._worker = _worker;\n }\n DocumentSymbolAdapter.prototype.provideDocumentSymbols = function (model, token) {\n var resource = model.uri;\n return this._worker(resource)\n .then(function (worker) { return worker.findDocumentSymbols(resource.toString()); })\n .then(function (items) {\n if (!items) {\n return;\n }\n return items.map(function (item) { return ({\n name: item.name,\n detail: '',\n containerName: item.containerName,\n kind: toSymbolKind(item.kind),\n tags: [],\n range: toRange(item.location.range),\n selectionRange: toRange(item.location.range)\n }); });\n });\n };\n return DocumentSymbolAdapter;\n}());\nexport { DocumentSymbolAdapter };\nvar DocumentLinkAdapter = /** @class */ (function () {\n function DocumentLinkAdapter(_worker) {\n this._worker = _worker;\n }\n DocumentLinkAdapter.prototype.provideLinks = function (model, token) {\n var resource = model.uri;\n return this._worker(resource)\n .then(function (worker) { return worker.findDocumentLinks(resource.toString()); })\n .then(function (items) {\n if (!items) {\n return;\n }\n return {\n links: items.map(function (item) { return ({\n range: toRange(item.range),\n url: item.target\n }); })\n };\n });\n };\n return DocumentLinkAdapter;\n}());\nexport { DocumentLinkAdapter };\nfunction fromFormattingOptions(options) {\n return {\n tabSize: options.tabSize,\n insertSpaces: options.insertSpaces\n };\n}\nvar DocumentFormattingEditProvider = /** @class */ (function () {\n function DocumentFormattingEditProvider(_worker) {\n this._worker = _worker;\n }\n DocumentFormattingEditProvider.prototype.provideDocumentFormattingEdits = function (model, options, token) {\n var resource = model.uri;\n return this._worker(resource).then(function (worker) {\n return worker\n .format(resource.toString(), null, fromFormattingOptions(options))\n .then(function (edits) {\n if (!edits || edits.length === 0) {\n return;\n }\n return edits.map(toTextEdit);\n });\n });\n };\n return DocumentFormattingEditProvider;\n}());\nexport { DocumentFormattingEditProvider };\nvar DocumentRangeFormattingEditProvider = /** @class */ (function () {\n function DocumentRangeFormattingEditProvider(_worker) {\n this._worker = _worker;\n }\n DocumentRangeFormattingEditProvider.prototype.provideDocumentRangeFormattingEdits = function (model, range, options, token) {\n var resource = model.uri;\n return this._worker(resource).then(function (worker) {\n return worker\n .format(resource.toString(), fromRange(range), fromFormattingOptions(options))\n .then(function (edits) {\n if (!edits || edits.length === 0) {\n return;\n }\n return edits.map(toTextEdit);\n });\n });\n };\n return DocumentRangeFormattingEditProvider;\n}());\nexport { DocumentRangeFormattingEditProvider };\nvar RenameAdapter = /** @class */ (function () {\n function RenameAdapter(_worker) {\n this._worker = _worker;\n }\n RenameAdapter.prototype.provideRenameEdits = function (model, position, newName, token) {\n var resource = model.uri;\n return this._worker(resource)\n .then(function (worker) {\n return worker.doRename(resource.toString(), fromPosition(position), newName);\n })\n .then(function (edit) {\n return toWorkspaceEdit(edit);\n });\n };\n return RenameAdapter;\n}());\nexport { RenameAdapter };\nfunction toWorkspaceEdit(edit) {\n if (!edit || !edit.changes) {\n return void 0;\n }\n var resourceEdits = [];\n for (var uri in edit.changes) {\n var _uri = Uri.parse(uri);\n for (var _i = 0, _a = edit.changes[uri]; _i < _a.length; _i++) {\n var e = _a[_i];\n resourceEdits.push({\n resource: _uri,\n edit: {\n range: toRange(e.range),\n text: e.newText\n }\n });\n }\n }\n return {\n edits: resourceEdits\n };\n}\nvar FoldingRangeAdapter = /** @class */ (function () {\n function FoldingRangeAdapter(_worker) {\n this._worker = _worker;\n }\n FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) {\n var resource = model.uri;\n return this._worker(resource)\n .then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); })\n .then(function (ranges) {\n if (!ranges) {\n return;\n }\n return ranges.map(function (range) {\n var result = {\n start: range.startLine + 1,\n end: range.endLine + 1\n };\n if (typeof range.kind !== 'undefined') {\n result.kind = toFoldingRangeKind(range.kind);\n }\n return result;\n });\n });\n };\n return FoldingRangeAdapter;\n}());\nexport { FoldingRangeAdapter };\nfunction toFoldingRangeKind(kind) {\n switch (kind) {\n case lsTypes.FoldingRangeKind.Comment:\n return languages.FoldingRangeKind.Comment;\n case lsTypes.FoldingRangeKind.Imports:\n return languages.FoldingRangeKind.Imports;\n case lsTypes.FoldingRangeKind.Region:\n return languages.FoldingRangeKind.Region;\n }\n}\nvar SelectionRangeAdapter = /** @class */ (function () {\n function SelectionRangeAdapter(_worker) {\n this._worker = _worker;\n }\n SelectionRangeAdapter.prototype.provideSelectionRanges = function (model, positions, token) {\n var resource = model.uri;\n return this._worker(resource)\n .then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); })\n .then(function (selectionRanges) {\n if (!selectionRanges) {\n return;\n }\n return selectionRanges.map(function (selectionRange) {\n var result = [];\n while (selectionRange) {\n result.push({ range: toRange(selectionRange.range) });\n selectionRange = selectionRange.parent;\n }\n return result;\n });\n });\n };\n return SelectionRangeAdapter;\n}());\nexport { SelectionRangeAdapter };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { WorkerManager } from './workerManager.js';\nimport * as languageFeatures from './languageFeatures.js';\nimport { languages } from './fillers/monaco-editor-core.js';\nexport function setupMode1(defaults) {\n var client = new WorkerManager(defaults);\n var worker = function () {\n var uris = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uris[_i] = arguments[_i];\n }\n return client.getLanguageServiceWorker.apply(client, uris);\n };\n var languageId = defaults.languageId;\n // all modes\n languages.registerCompletionItemProvider(languageId, new languageFeatures.CompletionAdapter(worker));\n languages.registerHoverProvider(languageId, new languageFeatures.HoverAdapter(worker));\n languages.registerDocumentHighlightProvider(languageId, new languageFeatures.DocumentHighlightAdapter(worker));\n languages.registerLinkProvider(languageId, new languageFeatures.DocumentLinkAdapter(worker));\n languages.registerFoldingRangeProvider(languageId, new languageFeatures.FoldingRangeAdapter(worker));\n languages.registerDocumentSymbolProvider(languageId, new languageFeatures.DocumentSymbolAdapter(worker));\n languages.registerSelectionRangeProvider(languageId, new languageFeatures.SelectionRangeAdapter(worker));\n languages.registerRenameProvider(languageId, new languageFeatures.RenameAdapter(worker));\n // only html\n if (languageId === 'html') {\n languages.registerDocumentFormattingEditProvider(languageId, new languageFeatures.DocumentFormattingEditProvider(worker));\n languages.registerDocumentRangeFormattingEditProvider(languageId, new languageFeatures.DocumentRangeFormattingEditProvider(worker));\n }\n}\nexport function setupMode(defaults) {\n var disposables = [];\n var providers = [];\n var client = new WorkerManager(defaults);\n disposables.push(client);\n var worker = function () {\n var uris = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uris[_i] = arguments[_i];\n }\n return client.getLanguageServiceWorker.apply(client, uris);\n };\n function registerProviders() {\n var languageId = defaults.languageId, modeConfiguration = defaults.modeConfiguration;\n disposeAll(providers);\n if (modeConfiguration.completionItems) {\n providers.push(languages.registerCompletionItemProvider(languageId, new languageFeatures.CompletionAdapter(worker)));\n }\n if (modeConfiguration.hovers) {\n providers.push(languages.registerHoverProvider(languageId, new languageFeatures.HoverAdapter(worker)));\n }\n if (modeConfiguration.documentHighlights) {\n providers.push(languages.registerDocumentHighlightProvider(languageId, new languageFeatures.DocumentHighlightAdapter(worker)));\n }\n if (modeConfiguration.links) {\n providers.push(languages.registerLinkProvider(languageId, new languageFeatures.DocumentLinkAdapter(worker)));\n }\n if (modeConfiguration.documentSymbols) {\n providers.push(languages.registerDocumentSymbolProvider(languageId, new languageFeatures.DocumentSymbolAdapter(worker)));\n }\n if (modeConfiguration.rename) {\n providers.push(languages.registerRenameProvider(languageId, new languageFeatures.RenameAdapter(worker)));\n }\n if (modeConfiguration.foldingRanges) {\n providers.push(languages.registerFoldingRangeProvider(languageId, new languageFeatures.FoldingRangeAdapter(worker)));\n }\n if (modeConfiguration.selectionRanges) {\n providers.push(languages.registerSelectionRangeProvider(languageId, new languageFeatures.SelectionRangeAdapter(worker)));\n }\n if (modeConfiguration.documentFormattingEdits) {\n providers.push(languages.registerDocumentFormattingEditProvider(languageId, new languageFeatures.DocumentFormattingEditProvider(worker)));\n }\n if (modeConfiguration.documentRangeFormattingEdits) {\n providers.push(languages.registerDocumentRangeFormattingEditProvider(languageId, new languageFeatures.DocumentRangeFormattingEditProvider(worker)));\n }\n }\n registerProviders();\n disposables.push(asDisposable(providers));\n return asDisposable(disposables);\n}\nfunction asDisposable(disposables) {\n return { dispose: function () { return disposeAll(disposables); } };\n}\nfunction disposeAll(disposables) {\n while (disposables.length) {\n disposables.pop().dispose();\n }\n}\n"],"sourceRoot":""}