vscode-languageclient
Advanced tools
Comparing version 7.0.0 to 7.1.0-next.1
export * from 'vscode-languageserver-protocol'; | ||
export { Converter as Code2ProtocolConverter } from './codeConverter'; | ||
export { Converter as Code2ProtocolConverter, FileFormattingOptions } from './codeConverter'; | ||
export { Converter as Protocol2CodeConverter } from './protocolConverter'; | ||
export * from './client'; | ||
export * from './commonClient'; |
@@ -30,3 +30,3 @@ "use strict"; | ||
}, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, token, error, null); | ||
}); | ||
@@ -48,3 +48,3 @@ }; | ||
}, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, token, error, null); | ||
}); | ||
@@ -66,3 +66,3 @@ }; | ||
}, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, token, error, null); | ||
}); | ||
@@ -69,0 +69,0 @@ }; |
@@ -382,3 +382,3 @@ import { TextDocumentChangeEvent, TextDocument, Disposable, OutputChannel, FileSystemWatcher as VFileSystemWatcher, DiagnosticCollection, Diagnostic as VDiagnostic, Uri, ProviderResult, CancellationToken, Position as VPosition, Location as VLocation, Range as VRange, CompletionItem as VCompletionItem, CompletionList as VCompletionList, SignatureHelp as VSignatureHelp, SignatureHelpContext as VSignatureHelpContext, Definition as VDefinition, DefinitionLink as VDefinitionLink, DocumentHighlight as VDocumentHighlight, SymbolInformation as VSymbolInformation, CodeActionContext as VCodeActionContext, Command as VCommand, CodeLens as VCodeLens, FormattingOptions as VFormattingOptions, TextEdit as VTextEdit, WorkspaceEdit as VWorkspaceEdit, Hover as VHover, CodeAction as VCodeAction, DocumentSymbol as VDocumentSymbol, DocumentLink as VDocumentLink, TextDocumentWillSaveEvent, WorkspaceFolder as VWorkspaceFolder, CompletionContext as VCompletionContext, CompletionItemProvider, HoverProvider, SignatureHelpProvider, DefinitionProvider, ReferenceProvider, DocumentHighlightProvider, CodeActionProvider, DocumentSymbolProvider, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, RenameProvider, DocumentLinkProvider, DocumentColorProvider, DeclarationProvider, FoldingRangeProvider, ImplementationProvider, SelectionRangeProvider, TypeDefinitionProvider, WorkspaceSymbolProvider, CallHierarchyProvider, FileWillCreateEvent, FileWillRenameEvent, FileWillDeleteEvent, FileCreateEvent, FileDeleteEvent, FileRenameEvent, LinkedEditingRangeProvider } from 'vscode'; | ||
register(data: RegistrationData<RO>): void; | ||
protected abstract registerLanguageProvider(options: RO): [Disposable, PR]; | ||
protected abstract registerLanguageProvider(options: RO, id: string): [Disposable, PR]; | ||
unregister(id: string): void; | ||
@@ -402,7 +402,2 @@ dispose(): void; | ||
} | ||
declare module 'vscode' { | ||
interface CodeActionProvider<T extends CodeAction = CodeAction> { | ||
resolveCodeAction?(codeAction: T, token: CancellationToken): ProviderResult<T>; | ||
} | ||
} | ||
export interface MessageTransports { | ||
@@ -573,3 +568,4 @@ reader: MessageReader; | ||
private handleApplyWorkspaceEdit; | ||
handleFailedRequest<T>(type: MessageSignature, error: any, defaultValue: T): T; | ||
private static RequestsToCancelOnContentModified; | ||
handleFailedRequest<T>(type: MessageSignature, token: CancellationToken | undefined, error: any, defaultValue: T): T; | ||
private static Canceled; | ||
@@ -576,0 +572,0 @@ private makeCancelError; |
@@ -46,3 +46,3 @@ import * as code from 'vscode'; | ||
asDiagnostics(items: code.Diagnostic[]): proto.Diagnostic[]; | ||
asCompletionItem(item: code.CompletionItem): proto.CompletionItem; | ||
asCompletionItem(item: code.CompletionItem, labelDetailsSupport?: boolean): proto.CompletionItem; | ||
asSymbolKind(item: code.SymbolKind): proto.SymbolKind; | ||
@@ -49,0 +49,0 @@ asSymbolTag(item: code.SymbolTag): proto.SymbolTag; |
@@ -409,4 +409,18 @@ "use strict"; | ||
} | ||
function asCompletionItem(item) { | ||
let result = { label: item.label }; | ||
function asCompletionItem(item, labelDetailsSupport = false) { | ||
let labelDetails; | ||
let label; | ||
if (item.label2 !== undefined) { | ||
label = item.label2.name; | ||
if (labelDetailsSupport) { | ||
labelDetails = { parameters: item.label2.parameters, qualifier: item.label2.qualifier, type: item.label2.type }; | ||
} | ||
} | ||
else { | ||
label = item.label; | ||
} | ||
let result = { label: label }; | ||
if (labelDetails !== undefined) { | ||
result.labelDetails = labelDetails; | ||
} | ||
let protocolItem = item instanceof protocolCompletionItem_1.default ? item : undefined; | ||
@@ -413,0 +427,0 @@ if (item.detail) { |
@@ -42,3 +42,3 @@ "use strict"; | ||
return client.sendRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, requestParams, token).then(this.asColorPresentations.bind(this), (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, token, error, null); | ||
}); | ||
@@ -58,3 +58,3 @@ }; | ||
return client.sendRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, requestParams, token).then(this.asColorInformations.bind(this), (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, token, error, null); | ||
}); | ||
@@ -61,0 +61,0 @@ }; |
@@ -53,6 +53,9 @@ "use strict"; | ||
// Exporting proposed protocol. | ||
const proposed_diagnostic_1 = require("./proposed.diagnostic"); | ||
var ProposedFeatures; | ||
(function (ProposedFeatures) { | ||
function createAll(_client) { | ||
let result = []; | ||
let result = [ | ||
new proposed_diagnostic_1.DiagnosticFeature(_client) | ||
]; | ||
return result; | ||
@@ -59,0 +62,0 @@ } |
@@ -39,3 +39,3 @@ "use strict"; | ||
return client.sendRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then(client.protocol2CodeConverter.asDeclarationResult, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, token, error, null); | ||
}); | ||
@@ -42,0 +42,0 @@ }; |
@@ -43,3 +43,3 @@ "use strict"; | ||
return client.sendRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, requestParams, token).then(FoldingRangeFeature.asFoldingRanges, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, token, error, null); | ||
}); | ||
@@ -46,0 +46,0 @@ }; |
@@ -39,3 +39,3 @@ "use strict"; | ||
return client.sendRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then(client.protocol2CodeConverter.asDefinitionResult, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, token, error, null); | ||
}); | ||
@@ -42,0 +42,0 @@ }; |
@@ -39,3 +39,3 @@ "use strict"; | ||
return client.sendRequest(proto.LinkedEditingRangeRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then(client.protocol2CodeConverter.asLinkedEditingRanges, (error) => { | ||
return client.handleFailedRequest(proto.LinkedEditingRangeRequest.type, error, null); | ||
return client.handleFailedRequest(proto.LinkedEditingRangeRequest.type, token, error, null); | ||
}); | ||
@@ -42,0 +42,0 @@ }; |
@@ -223,3 +223,3 @@ "use strict"; | ||
const result = []; | ||
for (let tag of tags) { | ||
for (const tag of tags) { | ||
const converted = asCompletionItemTag(tag); | ||
@@ -233,4 +233,8 @@ if (converted !== undefined) { | ||
function asCompletionItem(item) { | ||
let tags = asCompletionItemTags(item.tags); | ||
let result = new protocolCompletionItem_1.default(item.label); | ||
const tags = asCompletionItemTags(item.tags); | ||
const result = new protocolCompletionItem_1.default(item.label); | ||
const label2 = asCompletionItemLabel(item); | ||
if (label2 !== undefined) { | ||
result.label2 = label2; | ||
} | ||
if (item.detail) { | ||
@@ -246,3 +250,3 @@ result.detail = item.detail; | ||
} | ||
let insertText = asCompletionInsertText(item); | ||
const insertText = asCompletionInsertText(item); | ||
if (insertText) { | ||
@@ -295,2 +299,10 @@ result.insertText = insertText.text; | ||
} | ||
function asCompletionItemLabel(item) { | ||
if (vscode_languageserver_protocol_1.CompletionItemLabelDetails.is(item.labelDetails)) { | ||
return { name: item.label, parameters: item.labelDetails.parameters, qualifier: item.labelDetails.qualifier, type: item.labelDetails.type }; | ||
} | ||
else { | ||
return undefined; | ||
} | ||
} | ||
function asCompletionInsertText(item) { | ||
@@ -297,0 +309,0 @@ if (item.textEdit) { |
@@ -42,3 +42,3 @@ "use strict"; | ||
return client.sendRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, requestParams, token).then((ranges) => client.protocol2CodeConverter.asSelectionRanges(ranges), (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, token, error, null); | ||
}); | ||
@@ -45,0 +45,0 @@ }; |
@@ -102,3 +102,3 @@ "use strict"; | ||
}, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, token, error, null); | ||
}); | ||
@@ -127,3 +127,3 @@ }; | ||
}, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, token, error, null); | ||
}); | ||
@@ -152,3 +152,3 @@ }; | ||
}, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, token, error, null); | ||
}); | ||
@@ -155,0 +155,0 @@ }; |
@@ -40,3 +40,3 @@ "use strict"; | ||
return client.sendRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then(client.protocol2CodeConverter.asDefinitionResult, (error) => { | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, error, null); | ||
return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, token, error, null); | ||
}); | ||
@@ -43,0 +43,0 @@ }; |
@@ -30,3 +30,3 @@ "use strict"; | ||
__exportStar(require("../common/api"), exports); | ||
const REQUIRED_VSCODE_VERSION = '^1.52.0'; // do not change format, updated by `updateVSCode` script | ||
const REQUIRED_VSCODE_VERSION = '^1.53.0'; // do not change format, updated by `updateVSCode` script | ||
var Executable; | ||
@@ -33,0 +33,0 @@ (function (Executable) { |
{ | ||
"name": "vscode-languageclient", | ||
"description": "VSCode Language client implementation", | ||
"version": "7.0.0", | ||
"version": "7.1.0-next.1", | ||
"author": "Microsoft Corporation", | ||
"license": "MIT", | ||
"engines": { | ||
"vscode": "^1.52.0" | ||
"vscode": "^1.53.0" | ||
}, | ||
@@ -32,3 +32,3 @@ "repository": { | ||
"semver": "^7.3.4", | ||
"vscode-languageserver-protocol": "3.16.0" | ||
"vscode-languageserver-protocol": "3.17.0-next.1" | ||
}, | ||
@@ -42,2 +42,3 @@ "scripts": { | ||
"watch": "node ../build/bin/tsc -b ./tsconfig-watch.json -w", | ||
"lint": "node ../node_modules/eslint/bin/eslint.js ./src/**/*.ts", | ||
"test": "cd ../client-node-tests && npm test && cd ../client", | ||
@@ -44,0 +45,0 @@ "clean": "node ../node_modules/rimraf/bin.js lib", |
@@ -7,2 +7,43 @@ /* -------------------------------------------------------------------------------------------- | ||
declare module 'vscode' { | ||
export interface CompletionItem { | ||
/** | ||
* Will be merged into CompletionItem#label | ||
*/ | ||
label2?: CompletionItemLabel; | ||
} | ||
export interface CompletionItemLabel { | ||
/** | ||
* The function or variable. Rendered leftmost. | ||
*/ | ||
name: string; | ||
/** | ||
* The parameters without the return type. Render after `name`. | ||
*/ | ||
parameters?: string; | ||
/** | ||
* The fully qualified name, like package name or file path. Rendered after `signature`. | ||
*/ | ||
qualifier?: string; | ||
/** | ||
* The return-type of a function or type of a property/variable. Rendered rightmost. | ||
*/ | ||
type?: string; | ||
} | ||
export interface OpenEditorInfo { | ||
name: string; | ||
resource: Uri; | ||
} | ||
export namespace window { | ||
export const openEditors: ReadonlyArray<OpenEditorInfo>; | ||
// todo@API proper event type | ||
export const onDidChangeOpenEditors: Event<void>; | ||
} | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
395344
75
8214
2
+ Addedvscode-jsonrpc@6.1.0-next.1(transitive)
+ Addedvscode-languageserver-protocol@3.17.0-next.1(transitive)
+ Addedvscode-languageserver-types@3.17.0-next.1(transitive)
- Removedvscode-jsonrpc@6.0.0(transitive)
- Removedvscode-languageserver-protocol@3.16.0(transitive)
- Removedvscode-languageserver-types@3.16.0(transitive)