monaco-languageclient
Advanced tools
Comparing version 0.0.1-alpha.5 to 0.0.1-alpha.6
@@ -53,1 +53,2 @@ "use strict"; | ||
exports.ConsoleWindow = ConsoleWindow; | ||
//# sourceMappingURL=console-window.js.map |
@@ -564,1 +564,2 @@ "use strict"; | ||
exports.ProtocolToMonacoConverter = ProtocolToMonacoConverter; | ||
//# sourceMappingURL=converter.js.map |
@@ -82,1 +82,2 @@ "use strict"; | ||
exports.MonacoModelDiagnostics = MonacoModelDiagnostics; | ||
//# sourceMappingURL=diagnostic-collection.js.map |
@@ -33,1 +33,2 @@ "use strict"; | ||
exports.DisposableCollection = DisposableCollection; | ||
//# sourceMappingURL=disposable.js.map |
@@ -18,1 +18,2 @@ "use strict"; | ||
__export(require("vscode-base-languageclient/lib/connection")); | ||
//# sourceMappingURL=index.js.map |
@@ -14,2 +14,3 @@ import { Languages, DiagnosticCollection, CompletionItemProvider, DocumentIdentifier, HoverProvider, SignatureHelpProvider, DefinitionProvider, ReferenceProvider, DocumentHighlightProvider, DocumentSymbolProvider, CodeActionProvider, CodeLensProvider, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, RenameProvider, CompletionClientCapabilities, DocumentFilter, DocumentSelector } from "vscode-base-languageclient/lib/services"; | ||
export declare function testGlob(pattern: string, value: string): boolean; | ||
export declare function getLanguages(): string[]; | ||
export declare class MonacoLanguages implements Languages { | ||
@@ -16,0 +17,0 @@ protected readonly p2m: ProtocolToMonacoConverter; |
@@ -37,2 +37,13 @@ "use strict"; | ||
exports.testGlob = testGlob; | ||
function getLanguages() { | ||
var languages = []; | ||
for (var _i = 0, _a = monaco.languages.getLanguages().map(function (l) { return l.id; }); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
if (languages.indexOf(language) === -1) { | ||
languages.push(language); | ||
} | ||
} | ||
return languages; | ||
} | ||
exports.getLanguages = getLanguages; | ||
var MonacoLanguages = (function () { | ||
@@ -61,6 +72,7 @@ function MonacoLanguages(p2m, m2p) { | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _a = 0, _b = monaco.languages.getLanguages(); _a < _b.length; _a++) { | ||
for (var _a = 0, _b = getLanguages(); _a < _b.length; _a++) { | ||
var language = _b[_a]; | ||
providers.push(monaco.languages.registerCompletionItemProvider(language.id, completionProvider)); | ||
providers.push(monaco.languages.registerCompletionItemProvider(language, completionProvider)); | ||
} | ||
; | ||
return providers; | ||
@@ -92,5 +104,5 @@ }; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerHoverProvider(language.id, hoverProvider)); | ||
providers.push(monaco.languages.registerHoverProvider(language, hoverProvider)); | ||
} | ||
@@ -118,5 +130,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _a = 0, _b = monaco.languages.getLanguages(); _a < _b.length; _a++) { | ||
for (var _a = 0, _b = getLanguages(); _a < _b.length; _a++) { | ||
var language = _b[_a]; | ||
providers.push(monaco.languages.registerSignatureHelpProvider(language.id, signatureHelpProvider)); | ||
providers.push(monaco.languages.registerSignatureHelpProvider(language, signatureHelpProvider)); | ||
} | ||
@@ -146,5 +158,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerDefinitionProvider(language.id, definitionProvider)); | ||
providers.push(monaco.languages.registerDefinitionProvider(language, definitionProvider)); | ||
} | ||
@@ -168,5 +180,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerReferenceProvider(language.id, referenceProvider)); | ||
providers.push(monaco.languages.registerReferenceProvider(language, referenceProvider)); | ||
} | ||
@@ -190,5 +202,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerDocumentHighlightProvider(language.id, documentHighlightProvider)); | ||
providers.push(monaco.languages.registerDocumentHighlightProvider(language, documentHighlightProvider)); | ||
} | ||
@@ -212,5 +224,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerDocumentSymbolProvider(language.id, documentSymbolProvider)); | ||
providers.push(monaco.languages.registerDocumentSymbolProvider(language, documentSymbolProvider)); | ||
} | ||
@@ -234,5 +246,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerCodeActionProvider(language.id, codeActionProvider)); | ||
providers.push(monaco.languages.registerCodeActionProvider(language, codeActionProvider)); | ||
} | ||
@@ -256,5 +268,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerCodeLensProvider(language.id, codeLensProvider)); | ||
providers.push(monaco.languages.registerCodeLensProvider(language, codeLensProvider)); | ||
} | ||
@@ -285,5 +297,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerDocumentFormattingEditProvider(language.id, documentFormattingEditProvider)); | ||
providers.push(monaco.languages.registerDocumentFormattingEditProvider(language, documentFormattingEditProvider)); | ||
} | ||
@@ -307,5 +319,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerDocumentRangeFormattingEditProvider(language.id, documentRangeFormattingEditProvider)); | ||
providers.push(monaco.languages.registerDocumentRangeFormattingEditProvider(language, documentRangeFormattingEditProvider)); | ||
} | ||
@@ -333,5 +345,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _a = 0, _b = monaco.languages.getLanguages(); _a < _b.length; _a++) { | ||
for (var _a = 0, _b = getLanguages(); _a < _b.length; _a++) { | ||
var language = _b[_a]; | ||
providers.push(monaco.languages.registerOnTypeFormattingEditProvider(language.id, onTypeFormattingEditProvider)); | ||
providers.push(monaco.languages.registerOnTypeFormattingEditProvider(language, onTypeFormattingEditProvider)); | ||
} | ||
@@ -361,5 +373,5 @@ return providers; | ||
var providers = new disposable_1.DisposableCollection(); | ||
for (var _i = 0, _a = monaco.languages.getLanguages(); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = getLanguages(); _i < _a.length; _i++) { | ||
var language = _a[_i]; | ||
providers.push(monaco.languages.registerRenameProvider(language.id, renameProvider)); | ||
providers.push(monaco.languages.registerRenameProvider(language, renameProvider)); | ||
} | ||
@@ -402,1 +414,2 @@ return providers; | ||
exports.MonacoLanguages = MonacoLanguages; | ||
//# sourceMappingURL=languages.js.map |
@@ -17,1 +17,2 @@ "use strict"; | ||
exports.createMonacoServices = createMonacoServices; | ||
//# sourceMappingURL=services.js.map |
@@ -90,1 +90,2 @@ "use strict"; | ||
exports.MonacoWorkspace = MonacoWorkspace; | ||
//# sourceMappingURL=workspace.js.map |
{ | ||
"name": "monaco-languageclient", | ||
"version": "0.0.1-alpha.5", | ||
"version": "0.0.1-alpha.6", | ||
"description": "Monaco Language client implementation", | ||
@@ -5,0 +5,0 @@ "author": "TypeFox GmbH (http://www.typefox.io)", |
@@ -45,2 +45,12 @@ /* -------------------------------------------------------------------------------------------- | ||
export function getLanguages(): string[] { | ||
const languages = []; | ||
for (const language of monaco.languages.getLanguages().map(l => l.id)) { | ||
if (languages.indexOf(language) === -1) { | ||
languages.push(language); | ||
} | ||
} | ||
return languages; | ||
} | ||
export class MonacoLanguages implements Languages { | ||
@@ -70,5 +80,5 @@ | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerCompletionItemProvider(language.id, completionProvider)); | ||
} | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerCompletionItemProvider(language, completionProvider)) | ||
}; | ||
return providers; | ||
@@ -97,4 +107,4 @@ } | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerHoverProvider(language.id, hoverProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerHoverProvider(language, hoverProvider)); | ||
} | ||
@@ -119,4 +129,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerSignatureHelpProvider(language.id, signatureHelpProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerSignatureHelpProvider(language, signatureHelpProvider)); | ||
} | ||
@@ -143,4 +153,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerDefinitionProvider(language.id, definitionProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerDefinitionProvider(language, definitionProvider)); | ||
} | ||
@@ -165,4 +175,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerReferenceProvider(language.id, referenceProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerReferenceProvider(language, referenceProvider)); | ||
} | ||
@@ -187,4 +197,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerDocumentHighlightProvider(language.id, documentHighlightProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerDocumentHighlightProvider(language, documentHighlightProvider)); | ||
} | ||
@@ -209,4 +219,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerDocumentSymbolProvider(language.id, documentSymbolProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerDocumentSymbolProvider(language, documentSymbolProvider)); | ||
} | ||
@@ -231,4 +241,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerCodeActionProvider(language.id, codeActionProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerCodeActionProvider(language, codeActionProvider)); | ||
} | ||
@@ -253,4 +263,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerCodeLensProvider(language.id, codeLensProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerCodeLensProvider(language, codeLensProvider)); | ||
} | ||
@@ -282,4 +292,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerDocumentFormattingEditProvider(language.id, documentFormattingEditProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerDocumentFormattingEditProvider(language, documentFormattingEditProvider)); | ||
} | ||
@@ -301,7 +311,7 @@ return providers; | ||
registerDocumentRangeFormattingEditProvider(selector: DocumentSelector, provider: DocumentRangeFormattingEditProvider): Disposable { | ||
registerDocumentRangeFormattingEditProvider(selector: DocumentSelector, provider: DocumentRangeFormattingEditProvider): Disposable { | ||
const documentRangeFormattingEditProvider = this.createDocumentRangeFormattingEditProvider(selector, provider); | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerDocumentRangeFormattingEditProvider(language.id, documentRangeFormattingEditProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerDocumentRangeFormattingEditProvider(language, documentRangeFormattingEditProvider)); | ||
} | ||
@@ -326,4 +336,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerOnTypeFormattingEditProvider(language.id, onTypeFormattingEditProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerOnTypeFormattingEditProvider(language, onTypeFormattingEditProvider)); | ||
} | ||
@@ -350,4 +360,4 @@ return providers; | ||
const providers = new DisposableCollection(); | ||
for (const language of monaco.languages.getLanguages()) { | ||
providers.push(monaco.languages.registerRenameProvider(language.id, renameProvider)); | ||
for (const language of getLanguages()) { | ||
providers.push(monaco.languages.registerRenameProvider(language, renameProvider)); | ||
} | ||
@@ -354,0 +364,0 @@ return providers; |
175624
36
2667