monaco-yaml
Advanced tools
Comparing version 2.0.0 to 2.1.0
/*!----------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* monaco-yaml version: 2.0.0(0122b196d4abaab8b83af4cb9c98c24f650bb5a3) | ||
* monaco-yaml version: 2.1.0(a478bef722e29f5d9cef95e221926d63e8e14f91) | ||
* Released under the MIT license | ||
@@ -5,0 +5,0 @@ * https://github.com/kpdecker/monaco-yaml/blob/master/LICENSE.md |
/*!----------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* monaco-yaml version: 2.0.0(0122b196d4abaab8b83af4cb9c98c24f650bb5a3) | ||
* monaco-yaml version: 2.1.0(a478bef722e29f5d9cef95e221926d63e8e14f91) | ||
* Released under the MIT license | ||
* https://github.com/kpdecker/monaco-yaml/blob/master/LICENSE.md | ||
*-----------------------------------------------------------------------------*/ | ||
!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vs/language/yaml/workerManager",["require","exports"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){var t=this;this._defaults=e,this._worker=null,this._idleCheckInterval=setInterval(function(){return t._checkIfIdle()},3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(function(){return t._stopWorker()})}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){this._worker&&(Date.now()-this._lastUsedTime>12e4&&this._stopWorker())},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/yaml/yamlWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var e,t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._getClient().then(function(t){e=t}).then(function(e){return t._worker.withSyncedResources(n)}).then(function(t){return e})},e}();t.WorkerManager=n}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-languageserver-types/main",["require","exports"],e)}(function(e,t){"use strict";var n,r,i,o,a,u,s,c,d,l;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.create=function(e,t){return{line:e,character:t}},e.is=function(e){var t=e;return _.objectLiteral(t)&&_.number(t.line)&&_.number(t.character)}}(n=t.Position||(t.Position={})),function(e){e.create=function(e,t,r,i){if(_.number(e)&&_.number(t)&&_.number(r)&&_.number(i))return{start:n.create(e,t),end:n.create(r,i)};if(n.is(e)&&n.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+r+", "+i+"]")},e.is=function(e){var t=e;return _.objectLiteral(t)&&n.is(t.start)&&n.is(t.end)}}(r=t.Range||(t.Range={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return _.defined(t)&&r.is(t.range)&&(_.string(t.uri)||_.undefined(t.uri))}}(i=t.Location||(t.Location={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return _.number(t.red)&&_.number(t.green)&&_.number(t.blue)&&_.number(t.alpha)}}(o=t.Color||(t.Color={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return r.is(t.range)&&o.is(t.color)}}(t.ColorInformation||(t.ColorInformation={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return _.string(t.label)&&(_.undefined(t.textEdit)||c.is(t))&&(_.undefined(t.additionalTextEdits)||_.typedArray(t.additionalTextEdits,c.is))}}(t.ColorPresentation||(t.ColorPresentation={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(t.FoldingRangeKind||(t.FoldingRangeKind={})),function(e){e.create=function(e,t,n,r,i){var o={startLine:e,endLine:t};return _.defined(n)&&(o.startCharacter=n),_.defined(r)&&(o.endCharacter=r),_.defined(i)&&(o.kind=i),o},e.is=function(e){var t=e;return _.number(t.startLine)&&_.number(t.startLine)&&(_.undefined(t.startCharacter)||_.number(t.startCharacter))&&(_.undefined(t.endCharacter)||_.number(t.endCharacter))&&(_.undefined(t.kind)||_.string(t.kind))}}(t.FoldingRange||(t.FoldingRange={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return _.defined(t)&&i.is(t.location)&&_.string(t.message)}}(a=t.DiagnosticRelatedInformation||(t.DiagnosticRelatedInformation={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(t.DiagnosticSeverity||(t.DiagnosticSeverity={})),function(e){e.create=function(e,t,n,r,i,o){var a={range:e,message:t};return _.defined(n)&&(a.severity=n),_.defined(r)&&(a.code=r),_.defined(i)&&(a.source=i),_.defined(o)&&(a.relatedInformation=o),a},e.is=function(e){var t=e;return _.defined(t)&&r.is(t.range)&&_.string(t.message)&&(_.number(t.severity)||_.undefined(t.severity))&&(_.number(t.code)||_.string(t.code)||_.undefined(t.code))&&(_.string(t.source)||_.undefined(t.source))&&(_.undefined(t.relatedInformation)||_.typedArray(t.relatedInformation,a.is))}}(u=t.Diagnostic||(t.Diagnostic={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return _.defined(n)&&n.length>0&&(i.arguments=n),i},e.is=function(e){var t=e;return _.defined(t)&&_.string(t.title)&&_.string(t.command)}}(s=t.Command||(t.Command={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return _.objectLiteral(t)&&_.string(t.newText)&&r.is(t.range)}}(c=t.TextEdit||(t.TextEdit={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return _.defined(t)&&f.is(t.textDocument)&&Array.isArray(t.edits)}}(d=t.TextDocumentEdit||(t.TextDocumentEdit={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||_.typedArray(t.documentChanges,d.is))}}(l=t.WorkspaceEdit||(t.WorkspaceEdit={}));var f,g,m,p,h=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(c.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(c.replace(e,t))},e.prototype.delete=function(e){this.edits.push(c.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),v=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach(function(e){var n=new h(e.edits);t._textEditChanges[e.textDocument.uri]=n}):e.changes&&Object.keys(e.changes).forEach(function(n){var r=new h(e.changes[n]);t._textEditChanges[n]=r}))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(f.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for versioned document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new h(i),this._textEditChanges[t.uri]=r}return r}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new h(i),this._textEditChanges[e]=r}return r},e}();t.WorkspaceChange=v,function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return _.defined(t)&&_.string(t.uri)}}(t.TextDocumentIdentifier||(t.TextDocumentIdentifier={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return _.defined(t)&&_.string(t.uri)&&_.number(t.version)}}(f=t.VersionedTextDocumentIdentifier||(t.VersionedTextDocumentIdentifier={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return _.defined(t)&&_.string(t.uri)&&_.string(t.languageId)&&_.number(t.version)&&_.string(t.text)}}(t.TextDocumentItem||(t.TextDocumentItem={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(g=t.MarkupKind||(t.MarkupKind={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(g=t.MarkupKind||(t.MarkupKind={})),function(e){e.is=function(e){var t=e;return _.objectLiteral(e)&&g.is(t.kind)&&_.string(t.value)}}(m=t.MarkupContent||(t.MarkupContent={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(t.CompletionItemKind||(t.CompletionItemKind={})),function(e){e.PlainText=1,e.Snippet=2}(t.InsertTextFormat||(t.InsertTextFormat={})),function(e){e.create=function(e){return{label:e}}}(t.CompletionItem||(t.CompletionItem={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(t.CompletionList||(t.CompletionList={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return _.string(t)||_.objectLiteral(t)&&_.string(t.language)&&_.string(t.value)}}(p=t.MarkedString||(t.MarkedString={})),function(e){e.is=function(e){var t=e;return _.objectLiteral(t)&&(m.is(t.contents)||p.is(t.contents)||_.typedArray(t.contents,p.is))&&(void 0===e.range||r.is(e.range))}}(t.Hover||(t.Hover={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(t.ParameterInformation||(t.ParameterInformation={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return _.defined(t)&&(i.documentation=t),_.defined(n)?i.parameters=n:i.parameters=[],i}}(t.SignatureInformation||(t.SignatureInformation={})),function(e){e.Text=1,e.Read=2,e.Write=3}(t.DocumentHighlightKind||(t.DocumentHighlightKind={})),function(e){e.create=function(e,t){var n={range:e};return _.number(t)&&(n.kind=t),n}}(t.DocumentHighlight||(t.DocumentHighlight={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(t.SymbolKind||(t.SymbolKind={})),function(e){e.create=function(e,t,n,r,i){var o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o}}(t.SymbolInformation||(t.SymbolInformation={}));var y=function(){return function(){}}();t.DocumentSymbol=y,function(e){e.create=function(e,t,n,r,i,o){var a={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(a.children=o),a},e.is=function(e){var t=e;return t&&_.string(t.name)&&_.number(t.kind)&&r.is(t.range)&&r.is(t.selectionRange)&&(void 0===t.detail||_.string(t.detail))&&(void 0===t.deprecated||_.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))}}(y=t.DocumentSymbol||(t.DocumentSymbol={})),t.DocumentSymbol=y,function(e){e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports"}(t.CodeActionKind||(t.CodeActionKind={})),function(e){e.create=function(e,t){var n={diagnostics:e};return void 0!==t&&null!==t&&(n.only=t),n},e.is=function(e){var t=e;return _.defined(t)&&_.typedArray(t.diagnostics,u.is)&&(void 0===t.only||_.typedArray(t.only,_.string))}}(t.CodeActionContext||(t.CodeActionContext={})),function(e){e.create=function(e,t,n){var r={title:e};return s.is(t)?r.command=t:r.edit=t,void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&_.string(t.title)&&(void 0===t.diagnostics||_.typedArray(t.diagnostics,u.is))&&(void 0===t.kind||_.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||s.is(t.command))&&(void 0===t.edit||l.is(t.edit))}}(t.CodeAction||(t.CodeAction={})),function(e){e.create=function(e,t){var n={range:e};return _.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return _.defined(t)&&r.is(t.range)&&(_.undefined(t.command)||s.is(t.command))}}(t.CodeLens||(t.CodeLens={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return _.defined(t)&&_.number(t.tabSize)&&_.boolean(t.insertSpaces)}}(t.FormattingOptions||(t.FormattingOptions={}));var b=function(){return function(){}}();t.DocumentLink=b,function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return _.defined(t)&&r.is(t.range)&&(_.undefined(t.target)||_.string(t.target))}}(b=t.DocumentLink||(t.DocumentLink={})),t.DocumentLink=b,t.EOL=["\n","\r\n","\r"],function(e){e.create=function(e,t,n,r){return new C(e,t,n,r)},e.is=function(e){var t=e;return!!(_.defined(t)&&_.string(t.uri)&&(_.undefined(t.languageId)||_.string(t.languageId))&&_.number(t.lineCount)&&_.func(t.getText)&&_.func(t.positionAt)&&_.func(t.offsetAt))},e.applyEdits=function(e,t){for(var n=e.getText(),r=function e(t,n){if(t.length<=1)return t;var r=t.length/2|0,i=t.slice(0,r),o=t.slice(r);e(i,n),e(o,n);for(var a=0,u=0,s=0;a<i.length&&u<o.length;){var c=n(i[a],o[u]);t[s++]=c<=0?i[a++]:o[u++]}for(;a<i.length;)t[s++]=i[a++];for(;u<o.length;)t[s++]=o[u++];return t}(t,function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}),i=n.length,o=r.length-1;o>=0;o--){var a=r[o],u=e.offsetAt(a.range.start),s=e.offsetAt(a.range.end);if(!(s<=i))throw new Error("Ovelapping edit");n=n.substring(0,u)+a.newText+n.substring(s,n.length),i=u}return n}}(t.TextDocument||(t.TextDocument={})),function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3}(t.TextDocumentSaveReason||(t.TextDocumentSaveReason={}));var _,C=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=null}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=null},e.prototype.getLineOffsets=function(){if(null===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),r=0,i=t.length;if(0===i)return n.create(0,e);for(;r<i;){var o=Math.floor((r+i)/2);t[o]>e?i=o:r=o+1}var a=r-1;return n.create(a,e-t[a])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(_||(_={}))}),define("vscode-languageserver-types",["vscode-languageserver-types/main"],function(e){return e}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vs/language/yaml/languageFeatures",["require","exports","vscode-languageserver-types"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("vscode-languageserver-types"),r=monaco.Range,i=function(){function e(e,t,n){var r=this;this._languageId=e,this._worker=t,this._disposables=[],this._listener=Object.create(null);var i=function(e){var t,n=e.getModeId();n===r._languageId&&(r._listener[e.uri.toString()]=e.onDidChangeContent(function(){clearTimeout(t),t=setTimeout(function(){return r._doValidate(e.uri,n)},500)}),r._doValidate(e.uri,n))},o=function(e){monaco.editor.setModelMarkers(e,r._languageId,[]);var t=e.uri.toString(),n=r._listener[t];n&&(n.dispose(),delete r._listener[t])};this._disposables.push(monaco.editor.onDidCreateModel(i)),this._disposables.push(monaco.editor.onWillDisposeModel(function(e){o(e),r._resetSchema(e.uri)})),this._disposables.push(monaco.editor.onDidChangeModelLanguage(function(e){o(e.model),i(e.model),r._resetSchema(e.model.uri)})),this._disposables.push(n.onDidChange(function(e){monaco.editor.getModels().forEach(function(e){e.getModeId()===r._languageId&&(o(e),i(e))})})),this._disposables.push({dispose:function(){for(var e in monaco.editor.getModels().forEach(o),r._listener)r._listener[e].dispose()}}),monaco.editor.getModels().forEach(i)}return e.prototype.dispose=function(){this._disposables.forEach(function(e){return e&&e.dispose()}),this._disposables=[]},e.prototype._resetSchema=function(e){this._worker().then(function(t){t.resetSchema(e.toString())})},e.prototype._doValidate=function(e,t){this._worker(e).then(function(r){return r.doValidation(e.toString()).then(function(r){var i=r.map(function(e){return r="number"==typeof(t=e).code?String(t.code):t.code,{severity:function(e){switch(e){case n.DiagnosticSeverity.Error:return monaco.MarkerSeverity.Error;case n.DiagnosticSeverity.Warning:return monaco.MarkerSeverity.Warning;case n.DiagnosticSeverity.Information:return monaco.MarkerSeverity.Info;case n.DiagnosticSeverity.Hint:return monaco.MarkerSeverity.Hint;default:return monaco.MarkerSeverity.Info}}(t.severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message,code:r,source:t.source};var t,r}),o=monaco.editor.getModel(e);o.getModeId()===t&&monaco.editor.setModelMarkers(o,t,i)})}).then(void 0,function(e){console.error(e)})},e}();function o(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function a(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function u(e){if(e)return new r(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function s(e){if(e)return{range:u(e.range),text:e.newText}}t.DiagnosticsAdapter=i;var c=function(){function e(e){this._worker=e}return Object.defineProperty(e.prototype,"triggerCharacters",{get:function(){return[" ",":"]},enumerable:!0,configurable:!0}),e.prototype.provideCompletionItems=function(e,t,r,i){e.getWordUntilPosition(t);var a=e.uri;return this._worker(a).then(function(e){return e.doComplete(a.toString(),o(t))}).then(function(e){if(e){var t=e.items.map(function(e){var t={label:e.label,insertText:e.insertText||e.label,sortText:e.sortText,filterText:e.filterText,documentation:e.documentation,detail:e.detail,kind:function(e){var t=monaco.languages.CompletionItemKind;switch(e){case n.CompletionItemKind.Text:return t.Text;case n.CompletionItemKind.Method:return t.Method;case n.CompletionItemKind.Function:return t.Function;case n.CompletionItemKind.Constructor:return t.Constructor;case n.CompletionItemKind.Field:return t.Field;case n.CompletionItemKind.Variable:return t.Variable;case n.CompletionItemKind.Class:return t.Class;case n.CompletionItemKind.Interface:return t.Interface;case n.CompletionItemKind.Module:return t.Module;case n.CompletionItemKind.Property:return t.Property;case n.CompletionItemKind.Unit:return t.Unit;case n.CompletionItemKind.Value:return t.Value;case n.CompletionItemKind.Enum:return t.Enum;case n.CompletionItemKind.Keyword:return t.Keyword;case n.CompletionItemKind.Snippet:return t.Snippet;case n.CompletionItemKind.Color:return t.Color;case n.CompletionItemKind.File:return t.File;case n.CompletionItemKind.Reference:return t.Reference}return t.Property}(e.kind)};return e.textEdit&&(t.range=u(e.textEdit.range),t.insertText=e.textEdit.newText),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(s)),e.insertTextFormat===n.InsertTextFormat.Snippet&&(t.insertTextRules=monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet),t});return{isIncomplete:e.isIncomplete,suggestions:t}}})},e}();function d(e){return"string"==typeof e?{value:e}:(t=e)&&"object"==typeof t&&"string"==typeof t.kind?"plaintext"===e.kind?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+"\n"+e.value+"\n```\n"};var t}t.CompletionAdapter=c;var l=function(){function e(e){this._worker=e}return e.prototype.provideHover=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.doHover(r.toString(),o(t))}).then(function(e){if(e)return{range:u(e.range),contents:function(e){if(e)return Array.isArray(e)?e.map(d):[d(e)]}(e.contents)}})},e}();t.HoverAdapter=l;var f=function(){function e(e){this._worker=e}return e.prototype.provideDocumentSymbols=function(e,t){var r=e.uri;return this._worker(r).then(function(e){return e.findDocumentSymbols(r.toString())}).then(function(e){if(e)return e.map(function(e){return function e(t){return{detail:"",range:u(t.range),name:t.name,kind:function(e){var t=monaco.languages.SymbolKind;switch(e){case n.SymbolKind.File:return t.Array;case n.SymbolKind.Module:return t.Module;case n.SymbolKind.Namespace:return t.Namespace;case n.SymbolKind.Package:return t.Package;case n.SymbolKind.Class:return t.Class;case n.SymbolKind.Method:return t.Method;case n.SymbolKind.Property:return t.Property;case n.SymbolKind.Field:return t.Field;case n.SymbolKind.Constructor:return t.Constructor;case n.SymbolKind.Enum:return t.Enum;case n.SymbolKind.Interface:return t.Interface;case n.SymbolKind.Function:return t.Function;case n.SymbolKind.Variable:return t.Variable;case n.SymbolKind.Constant:return t.Constant;case n.SymbolKind.String:return t.String;case n.SymbolKind.Number:return t.Number;case n.SymbolKind.Boolean:return t.Boolean;case n.SymbolKind.Array:return t.Array}return t.Function}(t.kind),selectionRange:u(t.selectionRange),children:t.children.map(function(t){return e(t)})}}(e)})})},e}();function g(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}t.DocumentSymbolAdapter=f;var m=function(){function e(e){this._worker=e}return e.prototype.provideDocumentFormattingEdits=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.format(r.toString(),null,g(t)).then(function(e){if(e&&0!==e.length)return e.map(s)})})},e}();t.DocumentFormattingEditProvider=m;var p=function(){function e(e){this._worker=e}return e.prototype.provideDocumentRangeFormattingEdits=function(e,t,n,r){var i=e.uri;return this._worker(i).then(function(e){return e.format(i.toString(),a(t),g(n)).then(function(e){if(e&&0!==e.length)return e.map(s)})})},e}();t.DocumentRangeFormattingEditProvider=p;var h=function(){function e(e){this._worker=e}return e.prototype.provideDocumentColors=function(e,t){var n=e.uri;return this._worker(n).then(function(e){return e.findDocumentColors(n.toString())}).then(function(e){if(e)return e.map(function(e){return{color:e.color,range:u(e.range)}})})},e.prototype.provideColorPresentations=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.getColorPresentations(r.toString(),t.color,a(t.range))}).then(function(e){if(e)return e.map(function(e){var t={label:e.label};return e.textEdit&&(t.textEdit=s(e.textEdit)),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(s)),t})})},e}();t.DocumentColorAdapter=h});var __read=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},__spread=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e};!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vs/language/yaml/yamlMode",["require","exports","./workerManager","./languageFeatures"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("./workerManager"),r=e("./languageFeatures");t.setupMode=function(e){var t=[],o=new n.WorkerManager(e);t.push(o);var a=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.getLanguageServiceWorker.apply(o,__spread(e))},u=e.languageId;t.push(monaco.languages.registerHoverProvider(u,new r.HoverAdapter(a))),t.push(monaco.languages.registerDocumentSymbolProvider(u,new r.DocumentSymbolAdapter(a))),t.push(monaco.languages.registerColorProvider(u,new r.DocumentColorAdapter(a))),t.push(monaco.languages.registerDocumentFormattingEditProvider(u,new r.DocumentFormattingEditProvider(a))),t.push(monaco.languages.registerDocumentRangeFormattingEditProvider(u,new r.DocumentRangeFormattingEditProvider(a))),t.push(new r.DiagnosticsAdapter(u,a,e)),t.push(monaco.languages.setLanguageConfiguration(u,i))};var i={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:monaco.languages.IndentAction.Indent}}]}}); | ||
!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vs/language/yaml/workerManager",["require","exports"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){var t=this;this._defaults=e,this._worker=null,this._idleCheckInterval=setInterval(function(){return t._checkIfIdle()},3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(function(){return t._stopWorker()})}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){this._worker&&(Date.now()-this._lastUsedTime>12e4&&this._stopWorker())},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/yaml/yamlWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var e,t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._getClient().then(function(t){e=t}).then(function(e){return t._worker.withSyncedResources(n)}).then(function(t){return e})},e}();t.WorkerManager=n}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-languageserver-types/main",["require","exports"],e)}(function(e,t){"use strict";var n,r,i,o,a,u,s,c,d,l;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.create=function(e,t){return{line:e,character:t}},e.is=function(e){var t=e;return _.objectLiteral(t)&&_.number(t.line)&&_.number(t.character)}}(n=t.Position||(t.Position={})),function(e){e.create=function(e,t,r,i){if(_.number(e)&&_.number(t)&&_.number(r)&&_.number(i))return{start:n.create(e,t),end:n.create(r,i)};if(n.is(e)&&n.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+r+", "+i+"]")},e.is=function(e){var t=e;return _.objectLiteral(t)&&n.is(t.start)&&n.is(t.end)}}(r=t.Range||(t.Range={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return _.defined(t)&&r.is(t.range)&&(_.string(t.uri)||_.undefined(t.uri))}}(i=t.Location||(t.Location={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return _.number(t.red)&&_.number(t.green)&&_.number(t.blue)&&_.number(t.alpha)}}(o=t.Color||(t.Color={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return r.is(t.range)&&o.is(t.color)}}(t.ColorInformation||(t.ColorInformation={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return _.string(t.label)&&(_.undefined(t.textEdit)||c.is(t))&&(_.undefined(t.additionalTextEdits)||_.typedArray(t.additionalTextEdits,c.is))}}(t.ColorPresentation||(t.ColorPresentation={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(t.FoldingRangeKind||(t.FoldingRangeKind={})),function(e){e.create=function(e,t,n,r,i){var o={startLine:e,endLine:t};return _.defined(n)&&(o.startCharacter=n),_.defined(r)&&(o.endCharacter=r),_.defined(i)&&(o.kind=i),o},e.is=function(e){var t=e;return _.number(t.startLine)&&_.number(t.startLine)&&(_.undefined(t.startCharacter)||_.number(t.startCharacter))&&(_.undefined(t.endCharacter)||_.number(t.endCharacter))&&(_.undefined(t.kind)||_.string(t.kind))}}(t.FoldingRange||(t.FoldingRange={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return _.defined(t)&&i.is(t.location)&&_.string(t.message)}}(a=t.DiagnosticRelatedInformation||(t.DiagnosticRelatedInformation={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(t.DiagnosticSeverity||(t.DiagnosticSeverity={})),function(e){e.create=function(e,t,n,r,i,o){var a={range:e,message:t};return _.defined(n)&&(a.severity=n),_.defined(r)&&(a.code=r),_.defined(i)&&(a.source=i),_.defined(o)&&(a.relatedInformation=o),a},e.is=function(e){var t=e;return _.defined(t)&&r.is(t.range)&&_.string(t.message)&&(_.number(t.severity)||_.undefined(t.severity))&&(_.number(t.code)||_.string(t.code)||_.undefined(t.code))&&(_.string(t.source)||_.undefined(t.source))&&(_.undefined(t.relatedInformation)||_.typedArray(t.relatedInformation,a.is))}}(u=t.Diagnostic||(t.Diagnostic={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return _.defined(n)&&n.length>0&&(i.arguments=n),i},e.is=function(e){var t=e;return _.defined(t)&&_.string(t.title)&&_.string(t.command)}}(s=t.Command||(t.Command={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return _.objectLiteral(t)&&_.string(t.newText)&&r.is(t.range)}}(c=t.TextEdit||(t.TextEdit={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return _.defined(t)&&f.is(t.textDocument)&&Array.isArray(t.edits)}}(d=t.TextDocumentEdit||(t.TextDocumentEdit={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||_.typedArray(t.documentChanges,d.is))}}(l=t.WorkspaceEdit||(t.WorkspaceEdit={}));var f,g,m,p,h=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(c.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(c.replace(e,t))},e.prototype.delete=function(e){this.edits.push(c.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),v=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach(function(e){var n=new h(e.edits);t._textEditChanges[e.textDocument.uri]=n}):e.changes&&Object.keys(e.changes).forEach(function(n){var r=new h(e.changes[n]);t._textEditChanges[n]=r}))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(f.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for versioned document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new h(i),this._textEditChanges[t.uri]=r}return r}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new h(i),this._textEditChanges[e]=r}return r},e}();t.WorkspaceChange=v,function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return _.defined(t)&&_.string(t.uri)}}(t.TextDocumentIdentifier||(t.TextDocumentIdentifier={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return _.defined(t)&&_.string(t.uri)&&_.number(t.version)}}(f=t.VersionedTextDocumentIdentifier||(t.VersionedTextDocumentIdentifier={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return _.defined(t)&&_.string(t.uri)&&_.string(t.languageId)&&_.number(t.version)&&_.string(t.text)}}(t.TextDocumentItem||(t.TextDocumentItem={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(g=t.MarkupKind||(t.MarkupKind={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(g=t.MarkupKind||(t.MarkupKind={})),function(e){e.is=function(e){var t=e;return _.objectLiteral(e)&&g.is(t.kind)&&_.string(t.value)}}(m=t.MarkupContent||(t.MarkupContent={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(t.CompletionItemKind||(t.CompletionItemKind={})),function(e){e.PlainText=1,e.Snippet=2}(t.InsertTextFormat||(t.InsertTextFormat={})),function(e){e.create=function(e){return{label:e}}}(t.CompletionItem||(t.CompletionItem={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(t.CompletionList||(t.CompletionList={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return _.string(t)||_.objectLiteral(t)&&_.string(t.language)&&_.string(t.value)}}(p=t.MarkedString||(t.MarkedString={})),function(e){e.is=function(e){var t=e;return _.objectLiteral(t)&&(m.is(t.contents)||p.is(t.contents)||_.typedArray(t.contents,p.is))&&(void 0===e.range||r.is(e.range))}}(t.Hover||(t.Hover={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(t.ParameterInformation||(t.ParameterInformation={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return _.defined(t)&&(i.documentation=t),_.defined(n)?i.parameters=n:i.parameters=[],i}}(t.SignatureInformation||(t.SignatureInformation={})),function(e){e.Text=1,e.Read=2,e.Write=3}(t.DocumentHighlightKind||(t.DocumentHighlightKind={})),function(e){e.create=function(e,t){var n={range:e};return _.number(t)&&(n.kind=t),n}}(t.DocumentHighlight||(t.DocumentHighlight={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(t.SymbolKind||(t.SymbolKind={})),function(e){e.create=function(e,t,n,r,i){var o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o}}(t.SymbolInformation||(t.SymbolInformation={}));var y=function(){return function(){}}();t.DocumentSymbol=y,function(e){e.create=function(e,t,n,r,i,o){var a={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(a.children=o),a},e.is=function(e){var t=e;return t&&_.string(t.name)&&_.number(t.kind)&&r.is(t.range)&&r.is(t.selectionRange)&&(void 0===t.detail||_.string(t.detail))&&(void 0===t.deprecated||_.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))}}(y=t.DocumentSymbol||(t.DocumentSymbol={})),t.DocumentSymbol=y,function(e){e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports"}(t.CodeActionKind||(t.CodeActionKind={})),function(e){e.create=function(e,t){var n={diagnostics:e};return void 0!==t&&null!==t&&(n.only=t),n},e.is=function(e){var t=e;return _.defined(t)&&_.typedArray(t.diagnostics,u.is)&&(void 0===t.only||_.typedArray(t.only,_.string))}}(t.CodeActionContext||(t.CodeActionContext={})),function(e){e.create=function(e,t,n){var r={title:e};return s.is(t)?r.command=t:r.edit=t,void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&_.string(t.title)&&(void 0===t.diagnostics||_.typedArray(t.diagnostics,u.is))&&(void 0===t.kind||_.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||s.is(t.command))&&(void 0===t.edit||l.is(t.edit))}}(t.CodeAction||(t.CodeAction={})),function(e){e.create=function(e,t){var n={range:e};return _.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return _.defined(t)&&r.is(t.range)&&(_.undefined(t.command)||s.is(t.command))}}(t.CodeLens||(t.CodeLens={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return _.defined(t)&&_.number(t.tabSize)&&_.boolean(t.insertSpaces)}}(t.FormattingOptions||(t.FormattingOptions={}));var b=function(){return function(){}}();t.DocumentLink=b,function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return _.defined(t)&&r.is(t.range)&&(_.undefined(t.target)||_.string(t.target))}}(b=t.DocumentLink||(t.DocumentLink={})),t.DocumentLink=b,t.EOL=["\n","\r\n","\r"],function(e){e.create=function(e,t,n,r){return new C(e,t,n,r)},e.is=function(e){var t=e;return!!(_.defined(t)&&_.string(t.uri)&&(_.undefined(t.languageId)||_.string(t.languageId))&&_.number(t.lineCount)&&_.func(t.getText)&&_.func(t.positionAt)&&_.func(t.offsetAt))},e.applyEdits=function(e,t){for(var n=e.getText(),r=function e(t,n){if(t.length<=1)return t;var r=t.length/2|0,i=t.slice(0,r),o=t.slice(r);e(i,n),e(o,n);for(var a=0,u=0,s=0;a<i.length&&u<o.length;){var c=n(i[a],o[u]);t[s++]=c<=0?i[a++]:o[u++]}for(;a<i.length;)t[s++]=i[a++];for(;u<o.length;)t[s++]=o[u++];return t}(t,function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}),i=n.length,o=r.length-1;o>=0;o--){var a=r[o],u=e.offsetAt(a.range.start),s=e.offsetAt(a.range.end);if(!(s<=i))throw new Error("Ovelapping edit");n=n.substring(0,u)+a.newText+n.substring(s,n.length),i=u}return n}}(t.TextDocument||(t.TextDocument={})),function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3}(t.TextDocumentSaveReason||(t.TextDocumentSaveReason={}));var _,C=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=null}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=null},e.prototype.getLineOffsets=function(){if(null===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),r=0,i=t.length;if(0===i)return n.create(0,e);for(;r<i;){var o=Math.floor((r+i)/2);t[o]>e?i=o:r=o+1}var a=r-1;return n.create(a,e-t[a])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(_||(_={}))}),define("vscode-languageserver-types",["vscode-languageserver-types/main"],function(e){return e}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vs/language/yaml/languageFeatures",["require","exports","vscode-languageserver-types"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("vscode-languageserver-types"),r=monaco.Range,i=function(){function e(e,t,n){var r=this;this._languageId=e,this._worker=t,this._disposables=[],this._listener=Object.create(null);var i=function(e){var t,n=e.getModeId();n===r._languageId&&(r._listener[e.uri.toString()]=e.onDidChangeContent(function(){clearTimeout(t),t=setTimeout(function(){return r._doValidate(e.uri,n)},500)}),r._doValidate(e.uri,n))},o=function(e){monaco.editor.setModelMarkers(e,r._languageId,[]);var t=e.uri.toString(),n=r._listener[t];n&&(n.dispose(),delete r._listener[t])};this._disposables.push(monaco.editor.onDidCreateModel(i)),this._disposables.push(monaco.editor.onWillDisposeModel(function(e){o(e),r._resetSchema(e.uri)})),this._disposables.push(monaco.editor.onDidChangeModelLanguage(function(e){o(e.model),i(e.model),r._resetSchema(e.model.uri)})),this._disposables.push(n.onDidChange(function(e){monaco.editor.getModels().forEach(function(e){e.getModeId()===r._languageId&&(o(e),i(e))})})),this._disposables.push({dispose:function(){for(var e in monaco.editor.getModels().forEach(o),r._listener)r._listener[e].dispose()}}),monaco.editor.getModels().forEach(i)}return e.prototype.dispose=function(){this._disposables.forEach(function(e){return e&&e.dispose()}),this._disposables=[]},e.prototype._resetSchema=function(e){this._worker().then(function(t){t.resetSchema(e.toString())})},e.prototype._doValidate=function(e,t){this._worker(e).then(function(r){return r.doValidation(e.toString()).then(function(r){var i=r.map(function(e){return r="number"==typeof(t=e).code?String(t.code):t.code,{severity:function(e){switch(e){case n.DiagnosticSeverity.Error:return monaco.MarkerSeverity.Error;case n.DiagnosticSeverity.Warning:return monaco.MarkerSeverity.Warning;case n.DiagnosticSeverity.Information:return monaco.MarkerSeverity.Info;case n.DiagnosticSeverity.Hint:return monaco.MarkerSeverity.Hint;default:return monaco.MarkerSeverity.Info}}(t.severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message,code:r,source:t.source};var t,r}),o=monaco.editor.getModel(e);o.getModeId()===t&&monaco.editor.setModelMarkers(o,t,i)})}).then(void 0,function(e){console.error(e)})},e}();function o(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function a(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function u(e){if(e)return new r(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function s(e){if(e)return{range:u(e.range),text:e.newText}}t.DiagnosticsAdapter=i;var c=function(){function e(e){this._worker=e}return Object.defineProperty(e.prototype,"triggerCharacters",{get:function(){return[" ",":"]},enumerable:!0,configurable:!0}),e.prototype.provideCompletionItems=function(e,t,r,i){e.getWordUntilPosition(t);var a=e.uri;return this._worker(a).then(function(e){return e.doComplete(a.toString(),o(t))}).then(function(e){if(e){var t=e.items.map(function(e){var t={label:e.label,insertText:e.insertText||e.label,sortText:e.sortText,filterText:e.filterText,documentation:e.documentation,detail:e.detail,kind:function(e){var t=monaco.languages.CompletionItemKind;switch(e){case n.CompletionItemKind.Text:return t.Text;case n.CompletionItemKind.Method:return t.Method;case n.CompletionItemKind.Function:return t.Function;case n.CompletionItemKind.Constructor:return t.Constructor;case n.CompletionItemKind.Field:return t.Field;case n.CompletionItemKind.Variable:return t.Variable;case n.CompletionItemKind.Class:return t.Class;case n.CompletionItemKind.Interface:return t.Interface;case n.CompletionItemKind.Module:return t.Module;case n.CompletionItemKind.Property:return t.Property;case n.CompletionItemKind.Unit:return t.Unit;case n.CompletionItemKind.Value:return t.Value;case n.CompletionItemKind.Enum:return t.Enum;case n.CompletionItemKind.Keyword:return t.Keyword;case n.CompletionItemKind.Snippet:return t.Snippet;case n.CompletionItemKind.Color:return t.Color;case n.CompletionItemKind.File:return t.File;case n.CompletionItemKind.Reference:return t.Reference}return t.Property}(e.kind)};return e.textEdit&&(t.range=u(e.textEdit.range),t.insertText=e.textEdit.newText),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(s)),e.insertTextFormat===n.InsertTextFormat.Snippet&&(t.insertTextRules=monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet),t});return{isIncomplete:e.isIncomplete,suggestions:t}}})},e}();function d(e){return"string"==typeof e?{value:e}:(t=e)&&"object"==typeof t&&"string"==typeof t.kind?"plaintext"===e.kind?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+"\n"+e.value+"\n```\n"};var t}t.CompletionAdapter=c;var l=function(){function e(e){this._worker=e}return e.prototype.provideHover=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.doHover(r.toString(),o(t))}).then(function(e){if(e)return{range:u(e.range),contents:function(e){if(e)return Array.isArray(e)?e.map(d):[d(e)]}(e.contents)}})},e}();t.HoverAdapter=l;var f=function(){function e(e){this._worker=e}return e.prototype.provideDocumentSymbols=function(e,t){var r=e.uri;return this._worker(r).then(function(e){return e.findDocumentSymbols(r.toString())}).then(function(e){if(e)return e.map(function(e){return function e(t){return{detail:"",range:u(t.range),name:t.name,kind:function(e){var t=monaco.languages.SymbolKind;switch(e){case n.SymbolKind.File:return t.Array;case n.SymbolKind.Module:return t.Module;case n.SymbolKind.Namespace:return t.Namespace;case n.SymbolKind.Package:return t.Package;case n.SymbolKind.Class:return t.Class;case n.SymbolKind.Method:return t.Method;case n.SymbolKind.Property:return t.Property;case n.SymbolKind.Field:return t.Field;case n.SymbolKind.Constructor:return t.Constructor;case n.SymbolKind.Enum:return t.Enum;case n.SymbolKind.Interface:return t.Interface;case n.SymbolKind.Function:return t.Function;case n.SymbolKind.Variable:return t.Variable;case n.SymbolKind.Constant:return t.Constant;case n.SymbolKind.String:return t.String;case n.SymbolKind.Number:return t.Number;case n.SymbolKind.Boolean:return t.Boolean;case n.SymbolKind.Array:return t.Array}return t.Function}(t.kind),selectionRange:u(t.selectionRange),children:t.children.map(function(t){return e(t)})}}(e)})})},e}();function g(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}t.DocumentSymbolAdapter=f;var m=function(){function e(e){this._worker=e}return e.prototype.provideDocumentFormattingEdits=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.format(r.toString(),null,g(t)).then(function(e){if(e&&0!==e.length)return e.map(s)})})},e}();t.DocumentFormattingEditProvider=m;var p=function(){function e(e){this._worker=e}return e.prototype.provideDocumentRangeFormattingEdits=function(e,t,n,r){var i=e.uri;return this._worker(i).then(function(e){return e.format(i.toString(),a(t),g(n)).then(function(e){if(e&&0!==e.length)return e.map(s)})})},e}();t.DocumentRangeFormattingEditProvider=p;var h=function(){function e(e){this._worker=e}return e.prototype.provideDocumentColors=function(e,t){var n=e.uri;return this._worker(n).then(function(e){return e.findDocumentColors(n.toString())}).then(function(e){if(e)return e.map(function(e){return{color:e.color,range:u(e.range)}})})},e.prototype.provideColorPresentations=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.getColorPresentations(r.toString(),t.color,a(t.range))}).then(function(e){if(e)return e.map(function(e){var t={label:e.label};return e.textEdit&&(t.textEdit=s(e.textEdit)),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(s)),t})})},e}();t.DocumentColorAdapter=h});var __read=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},__spread=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e};!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vs/language/yaml/yamlMode",["require","exports","./workerManager","./languageFeatures"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("./workerManager"),r=e("./languageFeatures");t.setupMode=function(e){var t=[],o=new n.WorkerManager(e);t.push(o);var a=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.getLanguageServiceWorker.apply(o,__spread(e))},u=e.languageId;t.push(monaco.languages.registerCompletionItemProvider(u,new r.CompletionAdapter(a))),t.push(monaco.languages.registerHoverProvider(u,new r.HoverAdapter(a))),t.push(monaco.languages.registerDocumentSymbolProvider(u,new r.DocumentSymbolAdapter(a))),t.push(monaco.languages.registerDocumentFormattingEditProvider(u,new r.DocumentFormattingEditProvider(a))),t.push(monaco.languages.registerDocumentRangeFormattingEditProvider(u,new r.DocumentRangeFormattingEditProvider(a))),t.push(new r.DiagnosticsAdapter(u,a,e)),t.push(monaco.languages.setLanguageConfiguration(u,i))};var i={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:monaco.languages.IndentAction.Indent}}]}}); |
{ | ||
"name": "monaco-yaml", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "YAML plugin for the Monaco Editor", | ||
@@ -13,6 +13,6 @@ "author": "Kevin Decker <kpdecker@gmail.com> (http://incaseofstairs.com)", | ||
"type": "git", | ||
"url": "https://github.com/kpdecker/monaco-yaml" | ||
"url": "https://github.com/pengx17/monaco-yaml" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/kpdecker/monaco-yaml/issues" | ||
"url": "https://github.com/pengx17/monaco-yaml/issues" | ||
}, | ||
@@ -25,3 +25,3 @@ "devDependencies": { | ||
"jsonc-parser": "^2.0.2", | ||
"monaco-editor-core": "0.15.0", | ||
"monaco-editor-core": "0.15.5", | ||
"monaco-languages": "1.6.0", | ||
@@ -28,0 +28,0 @@ "monaco-plugin-helpers": "^1.0.2", |
@@ -23,6 +23,5 @@ # Monaco YAML | ||
* `git clone https://github.com/kpdecker/monaco-yaml` | ||
* `git clone https://github.com/pengx17/monaco-yaml` | ||
* `cd monaco-yaml` | ||
* `yarn` | ||
* `yarn watch` | ||
* open `$/monaco-yaml/test/index.html` in your favorite browser. | ||
@@ -44,2 +43,2 @@ | ||
## License | ||
[MIT](https://github.com/kpdecker/monaco-yaml/blob/master/LICENSE.md) | ||
[MIT](https://github.com/pengx17/monaco-yaml/blob/master/LICENSE.md) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
936587
16577
43