New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@volar/language-server

Package Overview
Dependencies
Maintainers
1
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volar/language-server - npm Package Compare versions

Comparing version 2.3.0-alpha.15 to 2.3.0

2

lib/register/registerEditorFeatures.js

@@ -33,3 +33,3 @@ "use strict";

const languageService = (await server.project.getLanguageService(uri));
return languageService.doDocumentDrop(uri, position, dataTransferMap, token);
return languageService.getDocumentDropEdits(uri, position, dataTransferMap, token);
});

@@ -36,0 +36,0 @@ server.connection.onRequest(protocol_1.GetMatchTsConfigRequest.type, async (params) => {

@@ -19,3 +19,3 @@ "use strict";

return await worker(uri, token, languageService => {
return languageService.format(uri, params.options, undefined, undefined, token);
return languageService.getDocumentFormattingEdits(uri, params.options, undefined, undefined, token);
});

@@ -26,3 +26,3 @@ });

return await worker(uri, token, languageService => {
return languageService.format(uri, params.options, params.range, undefined, token);
return languageService.getDocumentFormattingEdits(uri, params.options, params.range, undefined, token);
});

@@ -33,3 +33,3 @@ });

return await worker(uri, token, languageService => {
return languageService.format(uri, params.options, undefined, params, token);
return languageService.getDocumentFormattingEdits(uri, params.options, undefined, params, token);
});

@@ -52,3 +52,3 @@ });

return await worker(uri, token, languageService => {
return languageService.findLinkedEditingRanges(uri, params.position, token);
return languageService.getLinkedEditingRanges(uri, params.position, token);
});

@@ -59,3 +59,3 @@ });

return await worker(uri, token, languageService => {
return languageService.findDocumentSymbols(uri, token);
return languageService.getDocumentSymbols(uri, token);
});

@@ -66,3 +66,3 @@ });

return await worker(uri, token, languageService => {
return languageService.findDocumentColors(uri, token);
return languageService.getDocumentColors(uri, token);
});

@@ -81,3 +81,3 @@ });

lastCompleteLs = languageService;
const list = await languageService.doComplete(uri, params.position, params.context, token);
const list = await languageService.getCompletionItems(uri, params.position, params.context, token);
for (const item of list.items) {

@@ -91,3 +91,3 @@ fixTextEdit(item);

if (lastCompleteUri && lastCompleteLs) {
item = await lastCompleteLs.doCompletionResolve(item, token);
item = await lastCompleteLs.resolveCompletionItem(item, token);
fixTextEdit(item);

@@ -100,3 +100,3 @@ }

return await worker(uri, token, languageService => {
return languageService.doHover(uri, params.position, token);
return languageService.getHover(uri, params.position, token);
});

@@ -113,3 +113,3 @@ });

return await worker(uri, token, async (languageService) => {
const result = await languageService.prepareRename(uri, params.position, token);
const result = await languageService.getRenameRange(uri, params.position, token);
if (result && 'message' in result) {

@@ -124,3 +124,3 @@ return new vscode.ResponseError(0, result.message);

return await worker(uri, token, languageService => {
return languageService.doRename(uri, params.position, params.newName, token);
return languageService.getRenameEdits(uri, params.position, params.newName, token);
});

@@ -132,7 +132,7 @@ });

lastCodeLensLs = languageService;
return languageService.doCodeLens(uri, token);
return languageService.getCodeLenses(uri, token);
});
});
server.connection.onCodeLensResolve(async (codeLens, token) => {
return await lastCodeLensLs?.doCodeLensResolve(codeLens, token) ?? codeLens;
return await lastCodeLensLs?.resolveCodeLens(codeLens, token) ?? codeLens;
});

@@ -143,3 +143,3 @@ server.connection.onCodeAction(async (params, token) => {

lastCodeActionLs = languageService;
let codeActions = await languageService.doCodeActions(uri, params.range, params.context, token) ?? [];
let codeActions = await languageService.getCodeActions(uri, params.range, params.context, token) ?? [];
for (const codeAction of codeActions) {

@@ -160,3 +160,3 @@ if (codeAction.data && typeof codeAction.data === 'object') {

server.connection.onCodeActionResolve(async (codeAction, token) => {
return await lastCodeActionLs.doCodeActionResolve(codeAction, token) ?? codeAction;
return await lastCodeActionLs?.resolveCodeAction(codeAction, token) ?? codeAction;
});

@@ -166,3 +166,3 @@ server.connection.onReferences(async (params, token) => {

return await worker(uri, token, languageService => {
return languageService.findReferences(uri, params.position, { includeDeclaration: true }, token);
return languageService.getReferences(uri, params.position, { includeDeclaration: true }, token);
});

@@ -173,3 +173,3 @@ });

return await worker(uri, token, languageService => {
return languageService.findFileReferences(uri, token);
return languageService.getFileReferences(uri, token);
});

@@ -180,3 +180,3 @@ });

return await worker(uri, token, languageService => {
return languageService.findImplementations(uri, params.position, token);
return languageService.getImplementations(uri, params.position, token);
});

@@ -187,3 +187,3 @@ });

return await worker(uri, token, languageService => {
return languageService.findDefinition(uri, params.position, token);
return languageService.getDefinition(uri, params.position, token);
});

@@ -194,3 +194,3 @@ });

return await worker(uri, token, languageService => {
return languageService.findTypeDefinition(uri, params.position, token);
return languageService.getTypeDefinition(uri, params.position, token);
});

@@ -201,3 +201,3 @@ });

return await worker(uri, token, languageService => {
return languageService.findDocumentHighlights(uri, params.position, token);
return languageService.getDocumentHighlights(uri, params.position, token);
});

@@ -209,7 +209,7 @@ });

lastDocumentLinkLs = languageService;
return languageService.findDocumentLinks(uri, token);
return languageService.getDocumentLinks(uri, token);
});
});
server.connection.onDocumentLinkResolve(async (link, token) => {
return await lastDocumentLinkLs.doDocumentLinkResolve(link, token);
return await lastDocumentLinkLs?.resolveDocumentLink(link, token);
});

@@ -222,6 +222,7 @@ server.connection.onWorkspaceSymbol(async (params, token) => {

}
results = results.concat(await languageService.findWorkspaceSymbols(params.query, token));
results = results.concat(await languageService.getWorkspaceSymbols(params.query, token));
}
return results;
});
// TODO: onWorkspaceSymbolResolve
server.connection.languages.callHierarchy.onPrepare(async (params, token) => {

@@ -231,10 +232,10 @@ const uri = vscode_uri_1.URI.parse(params.textDocument.uri);

lastCallHierarchyLs = languageService;
return languageService.callHierarchy.doPrepare(uri, params.position, token);
return languageService.getCallHierarchyItems(uri, params.position, token);
}) ?? [];
});
server.connection.languages.callHierarchy.onIncomingCalls(async (params, token) => {
return await lastCallHierarchyLs?.callHierarchy.getIncomingCalls(params.item, token) ?? [];
return await lastCallHierarchyLs?.getCallHierarchyIncomingCalls(params.item, token) ?? [];
});
server.connection.languages.callHierarchy.onOutgoingCalls(async (params, token) => {
return await lastCallHierarchyLs?.callHierarchy.getOutgoingCalls(params.item, token) ?? [];
return await lastCallHierarchyLs?.getCallHierarchyOutgoingCalls(params.item, token) ?? [];
});

@@ -256,3 +257,3 @@ server.connection.languages.semanticTokens.on(async (params, token, _, resultProgress) => {

const result = await worker(uri, token, languageService => {
return languageService.doValidation(uri, token, errors => {
return languageService.getDiagnostics(uri, token, errors => {
// resultProgressReporter is undefined in vscode

@@ -274,2 +275,13 @@ resultProgressReporter?.report({

});
server.connection.languages.diagnostics.onWorkspace(async (_params, token) => {
const items = [];
for (const languageService of await server.project.getExistingLanguageServices()) {
if (token.isCancellationRequested) {
break;
}
const result = await languageService.getWorkspaceDiagnostics(token);
items.push(...result);
}
return { items };
});
server.connection.languages.inlayHint.on(async (params, token) => {

@@ -283,3 +295,3 @@ const uri = vscode_uri_1.URI.parse(params.textDocument.uri);

server.connection.languages.inlayHint.resolve(async (hint, token) => {
return await lastInlayHintLs.doInlayHintResolve(hint, token);
return await lastInlayHintLs?.resolveInlayHint(hint, token) ?? hint;
});

@@ -291,3 +303,3 @@ server.connection.workspace.onWillRenameFiles(async (params, token) => {

return await worker(oldUri, token, languageService => {
return languageService.getEditsForFileRename(oldUri, newUri, token) ?? null;
return languageService.getFileRenameEdits(oldUri, newUri, token) ?? null;
}) ?? null;

@@ -305,3 +317,3 @@ }));

return await worker(uri, token, languageService => {
return languageService.doAutoInsert(uri, params.selection, params.change, token);
return languageService.getAutoInsertSnippet(uri, params.selection, params.change, token);
});

@@ -308,0 +320,0 @@ });

@@ -112,28 +112,28 @@ "use strict";

},
selectionRangeProvider: capabilitiesArr.some(data => data.selectionRangeProvider) ? true : undefined,
foldingRangeProvider: capabilitiesArr.some(data => data.foldingRangeProvider) ? true : undefined,
linkedEditingRangeProvider: capabilitiesArr.some(data => data.linkedEditingRangeProvider) ? true : undefined,
colorProvider: capabilitiesArr.some(data => data.colorProvider) ? true : undefined,
documentSymbolProvider: capabilitiesArr.some(data => data.documentSymbolProvider) ? true : undefined,
documentFormattingProvider: capabilitiesArr.some(data => data.documentFormattingProvider) ? true : undefined,
documentRangeFormattingProvider: capabilitiesArr.some(data => data.documentFormattingProvider) ? true : undefined,
referencesProvider: capabilitiesArr.some(data => data.referencesProvider) ? true : undefined,
implementationProvider: capabilitiesArr.some(data => data.implementationProvider) ? true : undefined,
definitionProvider: capabilitiesArr.some(data => data.definitionProvider) ? true : undefined,
typeDefinitionProvider: capabilitiesArr.some(data => data.typeDefinitionProvider) ? true : undefined,
callHierarchyProvider: capabilitiesArr.some(data => data.callHierarchyProvider) ? true : undefined,
hoverProvider: capabilitiesArr.some(data => data.hoverProvider) ? true : undefined,
documentHighlightProvider: capabilitiesArr.some(data => data.documentHighlightProvider) ? true : undefined,
workspaceSymbolProvider: capabilitiesArr.some(data => data.workspaceSymbolProvider) ? true : undefined,
selectionRangeProvider: capabilitiesArr.some(data => data.selectionRangeProvider) || undefined,
foldingRangeProvider: capabilitiesArr.some(data => data.foldingRangeProvider) || undefined,
linkedEditingRangeProvider: capabilitiesArr.some(data => data.linkedEditingRangeProvider) || undefined,
colorProvider: capabilitiesArr.some(data => data.colorProvider) || undefined,
documentSymbolProvider: capabilitiesArr.some(data => data.documentSymbolProvider) || undefined,
documentFormattingProvider: capabilitiesArr.some(data => data.documentFormattingProvider) || undefined,
documentRangeFormattingProvider: capabilitiesArr.some(data => data.documentFormattingProvider) || undefined,
referencesProvider: capabilitiesArr.some(data => data.referencesProvider) || undefined,
implementationProvider: capabilitiesArr.some(data => data.implementationProvider) || undefined,
definitionProvider: capabilitiesArr.some(data => data.definitionProvider) || undefined,
typeDefinitionProvider: capabilitiesArr.some(data => data.typeDefinitionProvider) || undefined,
callHierarchyProvider: capabilitiesArr.some(data => data.callHierarchyProvider) || undefined,
hoverProvider: capabilitiesArr.some(data => data.hoverProvider) || undefined,
documentHighlightProvider: capabilitiesArr.some(data => data.documentHighlightProvider) || undefined,
workspaceSymbolProvider: capabilitiesArr.some(data => data.workspaceSymbolProvider) || undefined,
renameProvider: capabilitiesArr.some(data => data.renameProvider)
? { prepareProvider: capabilitiesArr.some(data => data.renameProvider?.prepareProvider) }
? { prepareProvider: capabilitiesArr.some(data => data.renameProvider?.prepareProvider) || undefined }
: undefined,
documentLinkProvider: capabilitiesArr.some(data => data.documentLinkProvider)
? { resolveProvider: capabilitiesArr.some(data => data.documentLinkProvider?.resolveProvider) }
? { resolveProvider: capabilitiesArr.some(data => data.documentLinkProvider?.resolveProvider) || undefined }
: undefined,
codeLensProvider: capabilitiesArr.some(data => data.codeLensProvider)
? { resolveProvider: capabilitiesArr.some(data => data.codeLensProvider?.resolveProvider) }
? { resolveProvider: capabilitiesArr.some(data => data.codeLensProvider?.resolveProvider) || undefined }
: undefined,
inlayHintProvider: capabilitiesArr.some(data => data.inlayHintProvider)
? { resolveProvider: capabilitiesArr.some(data => data.inlayHintProvider?.resolveProvider) }
? { resolveProvider: capabilitiesArr.some(data => data.inlayHintProvider?.resolveProvider) || undefined }
: undefined,

@@ -148,3 +148,3 @@ signatureHelpProvider: capabilitiesArr.some(data => data.signatureHelpProvider)

? {
resolveProvider: capabilitiesArr.some(data => data.completionProvider?.resolveProvider),
resolveProvider: capabilitiesArr.some(data => data.completionProvider?.resolveProvider) || undefined,
triggerCharacters: [...new Set(capabilitiesArr.map(data => data.completionProvider?.triggerCharacters ?? []).flat())],

@@ -165,3 +165,3 @@ }

? {
resolveProvider: capabilitiesArr.some(data => data.codeActionProvider?.resolveProvider),
resolveProvider: capabilitiesArr.some(data => data.codeActionProvider?.resolveProvider) || undefined,
codeActionKinds: capabilitiesArr.some(data => data.codeActionProvider?.codeActionKinds)

@@ -175,3 +175,3 @@ ? [...new Set(capabilitiesArr.map(data => data.codeActionProvider?.codeActionKinds ?? []).flat())]

interFileDependencies: true,
workspaceDiagnostics: false,
workspaceDiagnostics: capabilitiesArr.some(data => data.diagnosticProvider?.workspaceDiagnostics),
}

@@ -447,3 +447,3 @@ : undefined,

const languageService = (await projects.getLanguageService(uri));
const errors = await languageService.doValidation(uri, cancel, result => {
const errors = await languageService.getDiagnostics(uri, cancel, result => {
connection.sendDiagnostics({ uri: uriStr, diagnostics: result, version });

@@ -450,0 +450,0 @@ });

{
"name": "@volar/language-server",
"version": "2.3.0-alpha.15",
"version": "2.3.0",
"license": "MIT",

@@ -15,6 +15,6 @@ "files": [

"dependencies": {
"@volar/language-core": "2.3.0-alpha.15",
"@volar/language-service": "2.3.0-alpha.15",
"@volar/snapshot-document": "2.3.0-alpha.15",
"@volar/typescript": "2.3.0-alpha.15",
"@volar/language-core": "2.3.0",
"@volar/language-service": "2.3.0",
"@volar/snapshot-document": "2.3.0",
"@volar/typescript": "2.3.0",
"path-browserify": "^1.0.1",

@@ -30,3 +30,3 @@ "request-light": "^0.7.0",

},
"gitHead": "25ab3f45d1c74f52904c703378b04a6ecbda9535"
"gitHead": "4f6488605e22e0f76ea877460848a443fd3e8762"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc