vscode-typescript-languageservice
Advanced tools
Comparing version 0.27.9 to 0.27.10
@@ -22,10 +22,12 @@ "use strict"; | ||
let result = []; | ||
for (const error of context.diagnostics) { | ||
try { | ||
const codeFixes = languageService.getCodeFixesAtPosition(fileName, document.offsetAt(error.range.start), document.offsetAt(error.range.end), [Number(error.code)], formatOptions, preferences); | ||
for (const codeFix of codeFixes) { | ||
result = result.concat(transformCodeFix(codeFix, [error])); | ||
if (!context.only || matchOnlyKind(vscode.CodeActionKind.QuickFix)) { | ||
for (const error of context.diagnostics) { | ||
try { | ||
const codeFixes = languageService.getCodeFixesAtPosition(fileName, document.offsetAt(error.range.start), document.offsetAt(error.range.end), [Number(error.code)], formatOptions, preferences); | ||
for (const codeFix of codeFixes) { | ||
result = result.concat(transformCodeFix(codeFix, [error], context.only ? vscode.CodeActionKind.QuickFix : vscode.CodeActionKind.Empty)); | ||
} | ||
} | ||
catch { } | ||
} | ||
catch { } | ||
} | ||
@@ -138,10 +140,10 @@ if (context.only) { | ||
} | ||
function transformCodeFix(codeFix, diagnostics) { | ||
function transformCodeFix(codeFix, diagnostics, kind) { | ||
const edit = rename_1.fileTextChangesToWorkspaceEdit(codeFix.changes, getTextDocument); | ||
const codeActions = []; | ||
const fix = vscode.CodeAction.create(codeFix.description, edit, vscode.CodeActionKind.QuickFix); | ||
const fix = vscode.CodeAction.create(codeFix.description, edit, kind); | ||
fix.diagnostics = diagnostics; | ||
codeActions.push(fix); | ||
if (codeFix.fixAllDescription && codeFix.fixId) { | ||
const fixAll = vscode.CodeAction.create(codeFix.fixAllDescription, vscode.CodeActionKind.QuickFix); | ||
const fixAll = vscode.CodeAction.create(codeFix.fixAllDescription, kind); | ||
const data = { | ||
@@ -148,0 +150,0 @@ uri, |
{ | ||
"name": "vscode-typescript-languageservice", | ||
"version": "0.27.9", | ||
"version": "0.27.10", | ||
"main": "out/index.js", | ||
@@ -19,3 +19,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/shared": "^0.27.9", | ||
"@volar/shared": "^0.27.10", | ||
"upath": "^2.0.1", | ||
@@ -25,3 +25,3 @@ "vscode-languageserver": "^8.0.0-next.2", | ||
}, | ||
"gitHead": "987cd47ddacaa802b28671a0b3fa18107a40e208" | ||
"gitHead": "c9efdbe3f1824230d5f414018f05fc7711e9f830" | ||
} |
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
115166
2263
Updated@volar/shared@^0.27.10