User:Imbushuo/MonacoEditor/MediaWikiIntelliSense.min.js

var MwMonacoExtension;(function(MwMonacoExtension){var TitleAutoCompletionSource=function{function TitleAutoCompletionSource{this.m_matchRule=/\[\[(.*)$/}return Object.defineProperty(TitleAutoCompletionSource.prototype,"matchRule",{get:function{return this.m_matchRule},enumerable:!0,configurable:!0}),TitleAutoCompletionSource.prototype.getCandidateItemsAsync=function(input){return new monaco.Promise(function(complete,error){mw.loader.using("mediawiki.api").then(function{var apiQuery=new mw.Api,pageResults=apiQuery.get({action:"query",format:"json",list:"allpages",utf8:1,formatversion:2,apprefix:input}).then(function(response){var completionItems=[];response.query&&response.query.allpages&&(response.query.allpages.forEach(function(p){completionItems.push({documentation:"",label:p.title,insertText:p.title,kind:monaco.languages.CompletionItemKind.Field})}),complete(completionItems))},function{error([])})})})},TitleAutoCompletionSource};MwMonacoExtension.TitleAutoCompletionSource=TitleAutoCompletionSource})(MwMonacoExtension||(MwMonacoExtension={})); //# sourceMappingURL=MediaWikiIntelliSense.min.js.map