You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
20 KiB
1 line
20 KiB
5 years ago
|
webpackJsonp([168],{3331:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupMode=function(e){function t(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.getLanguageServiceWorker.apply(n,e)}var n=new i.a(e),r=e.languageId;monaco.languages.registerCompletionItemProvider(r,new o.a(t)),monaco.languages.registerDocumentHighlightProvider(r,new o.d(t)),monaco.languages.registerLinkProvider(r,new o.e(t)),monaco.languages.registerFoldingRangeProvider(r,new o.g(t)),"html"===r&&(monaco.languages.registerDocumentFormattingEditProvider(r,new o.c(t)),monaco.languages.registerDocumentRangeFormattingEditProvider(r,new o.f(t)),new o.b(r,t,e))};var i=n(3332),o=n(3333)},3332:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=(i.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},i.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},i.prototype._checkIfIdle=function(){this._worker&&12e4<Date.now()-this._lastUsedTime&&this._stopWorker()},i.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/html/htmlWorker",createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client},i.prototype.getLanguageServiceWorker=function(){for(var t,n=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return this._getClient().then(function(e){t=e}).then(function(e){return n._worker.withSyncedResources(r)}).then(function(e){return t})},i);function i(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()})}},3333:function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return d}),n.d(t,"d",function(){return l}),n.d(t,"e",function(){return h}),n.d(t,"c",function(){return v}),n.d(t,"f",function(){return _}),n.d(t,"g",function(){return k});var o=n(3334),r=monaco.Range,i=(a.prototype.dispose=function(){this._disposables.forEach(function(e){return e&&e.dispose()}),this._disposables=[]},a.prototype._doValidate=function(n,r){this._worker(n).then(function(e){return e.doValidation(n.toString()).then(function(e){var t=e.map(function(e){return n="number"==typeof(t=e).code?String(t.code):t.code,{severity:function(e){switch(e){case o.b.Error:return monaco.MarkerSeverity.Error;case o.b.Warning:return monaco.MarkerSeverity.Warning;case o.b.Information:return monaco.MarkerSeverity.Info;case o.b.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:n,source:t.source};var t,n});monaco.editor.setModelMarkers(monaco.editor.getModel(n),r,t)})}).then(void 0,function(e){console.error(e)})},a);function a(e,t,n){var r=this;this._languageId=e,this._worker=t,this._disposables=[],this._listener=Object.create(null);function i(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))}function o(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)})),this._disposables.push(monaco.editor.onDidChangeModelLanguage(function(e){o(e.model),i(e.model)})),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(){fo
|