@codingame/monaco-languageclient
Advanced tools
Comparing version 0.16.0 to 0.16.1
import type * as monaco from 'monaco-editor-core'; | ||
import * as ls from 'vscode-languageserver-protocol'; | ||
import { CodeActionParams, CodeLensParams, DocumentFormattingParams, DocumentOnTypeFormattingParams, DocumentRangeFormattingParams, ReferenceParams, RenameParams, TextDocumentPositionParams, Position, TextDocumentIdentifier, CompletionItem, CompletionList, CompletionParams, CompletionContext, CompletionTriggerKind, Range, Diagnostic, CompletionItemKind, Hover, SignatureHelp, SignatureInformation, ParameterInformation, Definition, DefinitionLink, Location, DocumentHighlight, SymbolInformation, DocumentSymbolParams, CodeActionContext, DiagnosticSeverity, Command, CodeLens, FormattingOptions, TextEdit, WorkspaceEdit, DocumentLinkParams, DocumentLink, MarkedString, MarkupContent, ColorInformation, ColorPresentation, FoldingRange, DiagnosticRelatedInformation, SymbolKind, DocumentSymbol, CodeAction, SignatureHelpContext, SignatureHelpTriggerKind, SemanticTokens, InsertTextMode, AnnotatedTextEdit, ChangeAnnotation } from './services'; | ||
import { CodeActionParams, CodeLensParams, DocumentFormattingParams, DocumentOnTypeFormattingParams, DocumentRangeFormattingParams, ReferenceParams, RenameParams, TextDocumentPositionParams, Position, TextDocumentIdentifier, CompletionItem, CompletionList, CompletionParams, CompletionContext, CompletionTriggerKind, Range, Diagnostic, CompletionItemKind, Hover, SignatureHelp, SignatureInformation, ParameterInformation, Definition, DefinitionLink, Location, DocumentHighlight, SymbolInformation, DocumentSymbolParams, CodeActionContext, DiagnosticSeverity, Command, CodeLens, FormattingOptions, TextEdit, WorkspaceEdit, DocumentLinkParams, DocumentLink, MarkedString, MarkupContent, ColorInformation, ColorPresentation, FoldingRange, DiagnosticRelatedInformation, SymbolKind, DocumentSymbol, CodeAction, SignatureHelpContext, SignatureHelpTriggerKind, SemanticTokens, InsertTextMode, AnnotatedTextEdit, ChangeAnnotation, CodeDescription } from './services'; | ||
export declare type RecursivePartial<T> = { | ||
@@ -8,3 +8,3 @@ [P in keyof T]?: RecursivePartial<T[P]>; | ||
export interface ProtocolDocumentLink extends monaco.languages.ILink { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -15,3 +15,3 @@ export declare namespace ProtocolDocumentLink { | ||
export interface ProtocolCodeLens extends monaco.languages.CodeLens { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -22,3 +22,3 @@ export declare namespace ProtocolCodeLens { | ||
export interface ProtocolCompletionItem extends monaco.languages.CompletionItem { | ||
data?: any; | ||
data?: unknown; | ||
fromEdit?: boolean; | ||
@@ -33,4 +33,11 @@ documentationFormat?: string; | ||
} | ||
export interface ProtocolIMarkerData extends monaco.editor.IMarkerData { | ||
data?: unknown; | ||
codeDescription?: CodeDescription; | ||
} | ||
export declare namespace ProtocolIMarkerData { | ||
function is(item: any): item is ProtocolIMarkerData; | ||
} | ||
export interface ProtocolCodeAction extends monaco.languages.CodeAction { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -168,5 +175,5 @@ export declare namespace ProtocolCodeAction { | ||
asDiagnostics(diagnostics: undefined): undefined; | ||
asDiagnostics(diagnostics: Diagnostic[]): monaco.editor.IMarkerData[]; | ||
asDiagnostics(diagnostics: Diagnostic[] | undefined): monaco.editor.IMarkerData[] | undefined; | ||
asDiagnostic(diagnostic: Diagnostic): monaco.editor.IMarkerData; | ||
asDiagnostics(diagnostics: Diagnostic[]): ProtocolIMarkerData[]; | ||
asDiagnostics(diagnostics: Diagnostic[] | undefined): ProtocolIMarkerData[] | undefined; | ||
asDiagnostic(diagnostic: Diagnostic): ProtocolIMarkerData; | ||
asRelatedInformations(relatedInformation?: DiagnosticRelatedInformation[]): monaco.editor.IRelatedInformation[] | undefined; | ||
@@ -173,0 +180,0 @@ asRelatedInformation(relatedInformation: DiagnosticRelatedInformation): monaco.editor.IRelatedInformation; |
define(["require", "exports", "vscode-languageserver-protocol", "vscode-languageserver-protocol/lib/common/utils/is", "./services"], function (require, exports, ls, Is, services_1) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ProtocolToMonacoConverter = exports.MonacoToProtocolConverter = exports.ProtocolCodeAction = exports.ProtocolCompletionItem = exports.ProtocolCodeLens = exports.ProtocolDocumentLink = void 0; | ||
exports.ProtocolToMonacoConverter = exports.MonacoToProtocolConverter = exports.ProtocolCodeAction = exports.ProtocolIMarkerData = exports.ProtocolCompletionItem = exports.ProtocolCodeLens = exports.ProtocolDocumentLink = void 0; | ||
var ProtocolDocumentLink; | ||
@@ -26,2 +26,9 @@ (function (ProtocolDocumentLink) { | ||
})(ProtocolCompletionItem = exports.ProtocolCompletionItem || (exports.ProtocolCompletionItem = {})); | ||
var ProtocolIMarkerData; | ||
(function (ProtocolIMarkerData) { | ||
function is(item) { | ||
return !!item && 'data' in item; | ||
} | ||
ProtocolIMarkerData.is = is; | ||
})(ProtocolIMarkerData = exports.ProtocolIMarkerData || (exports.ProtocolIMarkerData = {})); | ||
var ProtocolCodeAction; | ||
@@ -153,3 +160,3 @@ (function (ProtocolCodeAction) { | ||
asCompletionItem(item) { | ||
var _a; | ||
var _a, _b; | ||
const result = { label: item.label }; | ||
@@ -190,3 +197,5 @@ const protocolItem = ProtocolCompletionItem.is(item) ? item : undefined; | ||
} | ||
// TODO if (item.preselect === true || item.preselect === false) { result.preselect = item.preselect; } | ||
if (item.preselect === true || item.preselect === false) { | ||
result.preselect = item.preselect; | ||
} | ||
if (protocolItem) { | ||
@@ -200,2 +209,5 @@ if (protocolItem.data !== undefined) { | ||
} | ||
if (item.tags) { | ||
result.tags = (_b = item.tags) === null || _b === void 0 ? void 0 : _b.slice(); | ||
} | ||
return result; | ||
@@ -315,3 +327,8 @@ } | ||
const severity = this.asDiagnosticSeverity(marker.severity); | ||
return services_1.Diagnostic.create(range, marker.message, severity, marker.code, marker.source); | ||
const diag = services_1.Diagnostic.create(range, marker.message, severity, marker.code, marker.source); | ||
if (ProtocolIMarkerData.is(marker)) { | ||
diag.data = marker.data; | ||
diag.codeDescription = marker.codeDescription; | ||
} | ||
return diag; | ||
} | ||
@@ -840,3 +857,6 @@ asDiagnostics(markers) { | ||
endColumn: diagnostic.range.end.character + 1, | ||
relatedInformation: this.asRelatedInformations(diagnostic.relatedInformation) | ||
relatedInformation: this.asRelatedInformations(diagnostic.relatedInformation), | ||
codeDescription: diagnostic.codeDescription, | ||
tags: diagnostic.tags, | ||
data: diagnostic.data | ||
}; | ||
@@ -930,3 +950,8 @@ } | ||
} | ||
result.insertTextMode = item.insertTextMode; | ||
if (item.insertTextMode) { | ||
result.insertTextMode = item.insertTextMode; | ||
} | ||
if (item.tags) { | ||
result.tags = item.tags; | ||
} | ||
return result; | ||
@@ -933,0 +958,0 @@ } |
@@ -363,3 +363,3 @@ /* -------------------------------------------------------------------------------------------- | ||
match(selector, document) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -385,3 +385,3 @@ } | ||
registerCompletionItemProvider(selector, provider, ...triggerCharacters) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -406,3 +406,3 @@ } | ||
registerCodeActionsProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -424,3 +424,3 @@ } | ||
registerCodeLensProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -443,3 +443,3 @@ } | ||
registerDefinitionProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -458,3 +458,3 @@ } | ||
registerImplementationProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -473,3 +473,3 @@ } | ||
registerTypeDefinitionProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -488,3 +488,3 @@ } | ||
registerDeclarationProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -503,3 +503,3 @@ } | ||
registerHoverProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -518,3 +518,3 @@ } | ||
registerDocumentHighlightProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -533,3 +533,3 @@ } | ||
registerDocumentSymbolProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -559,3 +559,3 @@ } | ||
registerReferenceProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -574,3 +574,3 @@ } | ||
registerRenameProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -589,3 +589,3 @@ } | ||
registerDocumentFormattingEditProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -604,3 +604,3 @@ } | ||
registerDocumentRangeFormattingEditProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -619,3 +619,3 @@ } | ||
registerOnTypeFormattingEditProvider(selector, provider, firstTriggerCharacter, ...moreTriggerCharacter) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -634,3 +634,3 @@ } | ||
registerSignatureHelpProvider(selector, provider, firstItem, ...remaining) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -660,3 +660,3 @@ } | ||
registerDocumentLinkProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -679,3 +679,3 @@ } | ||
registerColorProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -700,3 +700,3 @@ } | ||
registerFoldingRangeProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -715,3 +715,3 @@ } | ||
registerSelectionRangeProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -731,3 +731,3 @@ } | ||
registerDocumentSemanticTokensProvider(selector, provider, legend) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -749,3 +749,3 @@ } | ||
registerDocumentRangeSemanticTokensProvider(selector, provider, legend) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -752,0 +752,0 @@ } |
define(["require", "exports", "./vscode-api", "./services"], function (require, exports, vscode_api_1, services_1) { | ||
"use strict"; | ||
return (0, vscode_api_1.createVSCodeApi)(services_1.Services.get); | ||
return vscode_api_1.createVSCodeApi(services_1.Services.get); | ||
}); | ||
//# sourceMappingURL=vscode-compatibility.js.map |
import type * as monaco from 'monaco-editor-core'; | ||
import * as ls from 'vscode-languageserver-protocol'; | ||
import { CodeActionParams, CodeLensParams, DocumentFormattingParams, DocumentOnTypeFormattingParams, DocumentRangeFormattingParams, ReferenceParams, RenameParams, TextDocumentPositionParams, Position, TextDocumentIdentifier, CompletionItem, CompletionList, CompletionParams, CompletionContext, CompletionTriggerKind, Range, Diagnostic, CompletionItemKind, Hover, SignatureHelp, SignatureInformation, ParameterInformation, Definition, DefinitionLink, Location, DocumentHighlight, SymbolInformation, DocumentSymbolParams, CodeActionContext, DiagnosticSeverity, Command, CodeLens, FormattingOptions, TextEdit, WorkspaceEdit, DocumentLinkParams, DocumentLink, MarkedString, MarkupContent, ColorInformation, ColorPresentation, FoldingRange, DiagnosticRelatedInformation, SymbolKind, DocumentSymbol, CodeAction, SignatureHelpContext, SignatureHelpTriggerKind, SemanticTokens, InsertTextMode, AnnotatedTextEdit, ChangeAnnotation } from './services'; | ||
import { CodeActionParams, CodeLensParams, DocumentFormattingParams, DocumentOnTypeFormattingParams, DocumentRangeFormattingParams, ReferenceParams, RenameParams, TextDocumentPositionParams, Position, TextDocumentIdentifier, CompletionItem, CompletionList, CompletionParams, CompletionContext, CompletionTriggerKind, Range, Diagnostic, CompletionItemKind, Hover, SignatureHelp, SignatureInformation, ParameterInformation, Definition, DefinitionLink, Location, DocumentHighlight, SymbolInformation, DocumentSymbolParams, CodeActionContext, DiagnosticSeverity, Command, CodeLens, FormattingOptions, TextEdit, WorkspaceEdit, DocumentLinkParams, DocumentLink, MarkedString, MarkupContent, ColorInformation, ColorPresentation, FoldingRange, DiagnosticRelatedInformation, SymbolKind, DocumentSymbol, CodeAction, SignatureHelpContext, SignatureHelpTriggerKind, SemanticTokens, InsertTextMode, AnnotatedTextEdit, ChangeAnnotation, CodeDescription } from './services'; | ||
export declare type RecursivePartial<T> = { | ||
@@ -8,3 +8,3 @@ [P in keyof T]?: RecursivePartial<T[P]>; | ||
export interface ProtocolDocumentLink extends monaco.languages.ILink { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -15,3 +15,3 @@ export declare namespace ProtocolDocumentLink { | ||
export interface ProtocolCodeLens extends monaco.languages.CodeLens { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -22,3 +22,3 @@ export declare namespace ProtocolCodeLens { | ||
export interface ProtocolCompletionItem extends monaco.languages.CompletionItem { | ||
data?: any; | ||
data?: unknown; | ||
fromEdit?: boolean; | ||
@@ -33,4 +33,11 @@ documentationFormat?: string; | ||
} | ||
export interface ProtocolIMarkerData extends monaco.editor.IMarkerData { | ||
data?: unknown; | ||
codeDescription?: CodeDescription; | ||
} | ||
export declare namespace ProtocolIMarkerData { | ||
function is(item: any): item is ProtocolIMarkerData; | ||
} | ||
export interface ProtocolCodeAction extends monaco.languages.CodeAction { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -168,5 +175,5 @@ export declare namespace ProtocolCodeAction { | ||
asDiagnostics(diagnostics: undefined): undefined; | ||
asDiagnostics(diagnostics: Diagnostic[]): monaco.editor.IMarkerData[]; | ||
asDiagnostics(diagnostics: Diagnostic[] | undefined): monaco.editor.IMarkerData[] | undefined; | ||
asDiagnostic(diagnostic: Diagnostic): monaco.editor.IMarkerData; | ||
asDiagnostics(diagnostics: Diagnostic[]): ProtocolIMarkerData[]; | ||
asDiagnostics(diagnostics: Diagnostic[] | undefined): ProtocolIMarkerData[] | undefined; | ||
asDiagnostic(diagnostic: Diagnostic): ProtocolIMarkerData; | ||
asRelatedInformations(relatedInformation?: DiagnosticRelatedInformation[]): monaco.editor.IRelatedInformation[] | undefined; | ||
@@ -173,0 +180,0 @@ asRelatedInformation(relatedInformation: DiagnosticRelatedInformation): monaco.editor.IRelatedInformation; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ProtocolToMonacoConverter = exports.MonacoToProtocolConverter = exports.ProtocolCodeAction = exports.ProtocolCompletionItem = exports.ProtocolCodeLens = exports.ProtocolDocumentLink = void 0; | ||
exports.ProtocolToMonacoConverter = exports.MonacoToProtocolConverter = exports.ProtocolCodeAction = exports.ProtocolIMarkerData = exports.ProtocolCompletionItem = exports.ProtocolCodeLens = exports.ProtocolDocumentLink = void 0; | ||
const ls = require("vscode-languageserver-protocol"); | ||
@@ -28,2 +28,9 @@ const Is = require("vscode-languageserver-protocol/lib/common/utils/is"); | ||
})(ProtocolCompletionItem = exports.ProtocolCompletionItem || (exports.ProtocolCompletionItem = {})); | ||
var ProtocolIMarkerData; | ||
(function (ProtocolIMarkerData) { | ||
function is(item) { | ||
return !!item && 'data' in item; | ||
} | ||
ProtocolIMarkerData.is = is; | ||
})(ProtocolIMarkerData = exports.ProtocolIMarkerData || (exports.ProtocolIMarkerData = {})); | ||
var ProtocolCodeAction; | ||
@@ -155,3 +162,3 @@ (function (ProtocolCodeAction) { | ||
asCompletionItem(item) { | ||
var _a; | ||
var _a, _b; | ||
const result = { label: item.label }; | ||
@@ -192,3 +199,5 @@ const protocolItem = ProtocolCompletionItem.is(item) ? item : undefined; | ||
} | ||
// TODO if (item.preselect === true || item.preselect === false) { result.preselect = item.preselect; } | ||
if (item.preselect === true || item.preselect === false) { | ||
result.preselect = item.preselect; | ||
} | ||
if (protocolItem) { | ||
@@ -202,2 +211,5 @@ if (protocolItem.data !== undefined) { | ||
} | ||
if (item.tags) { | ||
result.tags = (_b = item.tags) === null || _b === void 0 ? void 0 : _b.slice(); | ||
} | ||
return result; | ||
@@ -317,3 +329,8 @@ } | ||
const severity = this.asDiagnosticSeverity(marker.severity); | ||
return services_1.Diagnostic.create(range, marker.message, severity, marker.code, marker.source); | ||
const diag = services_1.Diagnostic.create(range, marker.message, severity, marker.code, marker.source); | ||
if (ProtocolIMarkerData.is(marker)) { | ||
diag.data = marker.data; | ||
diag.codeDescription = marker.codeDescription; | ||
} | ||
return diag; | ||
} | ||
@@ -842,3 +859,6 @@ asDiagnostics(markers) { | ||
endColumn: diagnostic.range.end.character + 1, | ||
relatedInformation: this.asRelatedInformations(diagnostic.relatedInformation) | ||
relatedInformation: this.asRelatedInformations(diagnostic.relatedInformation), | ||
codeDescription: diagnostic.codeDescription, | ||
tags: diagnostic.tags, | ||
data: diagnostic.data | ||
}; | ||
@@ -932,3 +952,8 @@ } | ||
} | ||
result.insertTextMode = item.insertTextMode; | ||
if (item.insertTextMode) { | ||
result.insertTextMode = item.insertTextMode; | ||
} | ||
if (item.tags) { | ||
result.tags = item.tags; | ||
} | ||
return result; | ||
@@ -935,0 +960,0 @@ } |
@@ -368,3 +368,3 @@ "use strict"; | ||
match(selector, document) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -390,3 +390,3 @@ } | ||
registerCompletionItemProvider(selector, provider, ...triggerCharacters) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -411,3 +411,3 @@ } | ||
registerCodeActionsProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -429,3 +429,3 @@ } | ||
registerCodeLensProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -448,3 +448,3 @@ } | ||
registerDefinitionProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -463,3 +463,3 @@ } | ||
registerImplementationProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -478,3 +478,3 @@ } | ||
registerTypeDefinitionProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -493,3 +493,3 @@ } | ||
registerDeclarationProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -508,3 +508,3 @@ } | ||
registerHoverProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -523,3 +523,3 @@ } | ||
registerDocumentHighlightProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -538,3 +538,3 @@ } | ||
registerDocumentSymbolProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -564,3 +564,3 @@ } | ||
registerReferenceProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -579,3 +579,3 @@ } | ||
registerRenameProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -594,3 +594,3 @@ } | ||
registerDocumentFormattingEditProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -609,3 +609,3 @@ } | ||
registerDocumentRangeFormattingEditProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -624,3 +624,3 @@ } | ||
registerOnTypeFormattingEditProvider(selector, provider, firstTriggerCharacter, ...moreTriggerCharacter) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -639,3 +639,3 @@ } | ||
registerSignatureHelpProvider(selector, provider, firstItem, ...remaining) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -665,3 +665,3 @@ } | ||
registerDocumentLinkProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -684,3 +684,3 @@ } | ||
registerColorProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -705,3 +705,3 @@ } | ||
registerFoldingRangeProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -720,3 +720,3 @@ } | ||
registerSelectionRangeProvider(selector, provider) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -736,3 +736,3 @@ } | ||
registerDocumentSemanticTokensProvider(selector, provider, legend) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -754,3 +754,3 @@ } | ||
registerDocumentRangeSemanticTokensProvider(selector, provider, legend) { | ||
if (!(0, services_1.isDocumentSelector)(selector)) { | ||
if (!services_1.isDocumentSelector(selector)) { | ||
throw new Error('unexpected selector: ' + JSON.stringify(selector)); | ||
@@ -757,0 +757,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
const services_1 = require("./services"); | ||
module.exports = (0, vscode_api_1.createVSCodeApi)(services_1.Services.get); | ||
module.exports = vscode_api_1.createVSCodeApi(services_1.Services.get); | ||
//# sourceMappingURL=vscode-compatibility.js.map |
{ | ||
"name": "@codingame/monaco-languageclient", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"description": "Monaco Language client implementation", | ||
@@ -5,0 +5,0 @@ "author": "TypeFox GmbH (http://www.typefox.io)", |
@@ -22,3 +22,3 @@ /* -------------------------------------------------------------------------------------------- | ||
DiagnosticRelatedInformation, MarkupKind, SymbolKind, DocumentSymbol, CodeAction, SignatureHelpContext, SignatureHelpTriggerKind, | ||
SemanticTokens, InsertTextMode, AnnotatedTextEdit, ChangeAnnotation | ||
SemanticTokens, InsertTextMode, AnnotatedTextEdit, ChangeAnnotation, CodeDescription | ||
} from './services'; | ||
@@ -31,3 +31,3 @@ | ||
export interface ProtocolDocumentLink extends monaco.languages.ILink { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -41,3 +41,3 @@ export namespace ProtocolDocumentLink { | ||
export interface ProtocolCodeLens extends monaco.languages.CodeLens { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -51,3 +51,3 @@ export namespace ProtocolCodeLens { | ||
export interface ProtocolCompletionItem extends monaco.languages.CompletionItem { | ||
data?: any; | ||
data?: unknown; | ||
fromEdit?: boolean; | ||
@@ -64,5 +64,14 @@ documentationFormat?: string; | ||
} | ||
export interface ProtocolIMarkerData extends monaco.editor.IMarkerData { | ||
data?: unknown; | ||
codeDescription?: CodeDescription; | ||
} | ||
export namespace ProtocolIMarkerData { | ||
export function is(item: any): item is ProtocolIMarkerData { | ||
return !!item && 'data' in item; | ||
} | ||
} | ||
export interface ProtocolCodeAction extends monaco.languages.CodeAction { | ||
data?: any; | ||
data?: unknown; | ||
} | ||
@@ -244,3 +253,3 @@ export namespace ProtocolCodeAction { | ||
if (item.command) { result.command = this.asCommand(item.command); } | ||
// TODO if (item.preselect === true || item.preselect === false) { result.preselect = item.preselect; } | ||
if (item.preselect === true || item.preselect === false) { result.preselect = item.preselect; } | ||
if (protocolItem) { | ||
@@ -254,2 +263,3 @@ if (protocolItem.data !== undefined) { | ||
} | ||
if (item.tags) { result.tags = item.tags?.slice(); } | ||
return result; | ||
@@ -383,3 +393,8 @@ } | ||
const severity = this.asDiagnosticSeverity(marker.severity); | ||
return Diagnostic.create(range, marker.message, severity, marker.code as string, marker.source); | ||
const diag = Diagnostic.create(range, marker.message, severity, marker.code as string, marker.source); | ||
if (ProtocolIMarkerData.is(marker)) { | ||
diag.data = marker.data | ||
diag.codeDescription = marker.codeDescription; | ||
} | ||
return diag | ||
} | ||
@@ -946,5 +961,5 @@ | ||
asDiagnostics(diagnostics: undefined): undefined; | ||
asDiagnostics(diagnostics: Diagnostic[]): monaco.editor.IMarkerData[]; | ||
asDiagnostics(diagnostics: Diagnostic[] | undefined): monaco.editor.IMarkerData[] | undefined; | ||
asDiagnostics(diagnostics: Diagnostic[] | undefined): monaco.editor.IMarkerData[] | undefined { | ||
asDiagnostics(diagnostics: Diagnostic[]): ProtocolIMarkerData[]; | ||
asDiagnostics(diagnostics: Diagnostic[] | undefined): ProtocolIMarkerData[] | undefined; | ||
asDiagnostics(diagnostics: Diagnostic[] | undefined): ProtocolIMarkerData[] | undefined { | ||
if (!diagnostics) { | ||
@@ -956,3 +971,3 @@ return undefined; | ||
asDiagnostic(diagnostic: Diagnostic): monaco.editor.IMarkerData { | ||
asDiagnostic(diagnostic: Diagnostic): ProtocolIMarkerData { | ||
return { | ||
@@ -967,3 +982,6 @@ code: typeof diagnostic.code === "number" ? diagnostic.code.toString() : diagnostic.code, | ||
endColumn: diagnostic.range.end.character + 1, | ||
relatedInformation: this.asRelatedInformations(diagnostic.relatedInformation) | ||
relatedInformation: this.asRelatedInformations(diagnostic.relatedInformation), | ||
codeDescription: diagnostic.codeDescription, | ||
tags: diagnostic.tags, | ||
data: diagnostic.data | ||
} | ||
@@ -1042,3 +1060,4 @@ } | ||
} | ||
result.insertTextMode = item.insertTextMode | ||
if (item.insertTextMode) { result.insertTextMode = item.insertTextMode; } | ||
if (item.tags) { result.tags = item.tags; } | ||
return result; | ||
@@ -1045,0 +1064,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
867975
11217
138