@volar/language-service
Advanced tools
Comparing version 1.2.0-alpha.7 to 1.2.0-alpha.8
@@ -47,3 +47,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
function createLanguageServiceContext(host, languageContext, config, env, getLanguageService, documentRegistry) { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
const ts = (_a = host.getTypeScriptModule) === null || _a === void 0 ? void 0 : _a.call(host); | ||
@@ -82,2 +82,3 @@ const tsLs = ts === null || ts === void 0 ? void 0 : ts.createLanguageService(languageContext.typescript.languageServiceHost, documentRegistry); | ||
rules: (_b = config.rules) !== null && _b !== void 0 ? _b : {}, | ||
rulesSettings: (_c = config.rulesSettings) !== null && _c !== void 0 ? _c : {}, | ||
typescript: ts && tsLs ? { | ||
@@ -84,0 +85,0 @@ module: ts, |
@@ -6,2 +6,2 @@ import * as vscode from 'vscode-languageserver-protocol'; | ||
export declare function mergeWorkspaceEdits(original: vscode.WorkspaceEdit, ...others: vscode.WorkspaceEdit[]): void; | ||
export declare function embeddedEditToSourceEdit(tsResult: vscode.WorkspaceEdit, vueDocuments: DocumentsAndSourceMaps): vscode.WorkspaceEdit | undefined; | ||
export declare function embeddedEditToSourceEdit(tsResult: vscode.WorkspaceEdit, documents: DocumentsAndSourceMaps): vscode.WorkspaceEdit | undefined; |
@@ -134,3 +134,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.mergeWorkspaceEdits = mergeWorkspaceEdits; | ||
function embeddedEditToSourceEdit(tsResult, vueDocuments) { | ||
function embeddedEditToSourceEdit(tsResult, documents) { | ||
var _a, _b, _c; | ||
@@ -142,7 +142,7 @@ const sourceResult = {}; | ||
const tsAnno = tsResult.changeAnnotations[tsUri]; | ||
if (!vueDocuments.hasVirtualFileByUri(tsUri)) { | ||
if (!documents.hasVirtualFileByUri(tsUri)) { | ||
sourceResult.changeAnnotations[tsUri] = tsAnno; | ||
} | ||
else { | ||
for (const [_, map] of vueDocuments.getMapsByVirtualFileUri(tsUri)) { | ||
for (const [_, map] of documents.getMapsByVirtualFileUri(tsUri)) { | ||
// TODO: check capability? | ||
@@ -156,3 +156,3 @@ const uri = map.sourceFileDocument.uri; | ||
(_b = sourceResult.changes) !== null && _b !== void 0 ? _b : (sourceResult.changes = {}); | ||
if (!vueDocuments.hasVirtualFileByUri(tsUri)) { | ||
if (!documents.hasVirtualFileByUri(tsUri)) { | ||
sourceResult.changes[tsUri] = tsResult.changes[tsUri]; | ||
@@ -162,3 +162,3 @@ hasResult = true; | ||
} | ||
for (const [_, map] of vueDocuments.getMapsByVirtualFileUri(tsUri)) { | ||
for (const [_, map] of documents.getMapsByVirtualFileUri(tsUri)) { | ||
const tsEdits = tsResult.changes[tsUri]; | ||
@@ -190,4 +190,4 @@ for (const tsEdit of tsEdits) { | ||
if (vscode.TextDocumentEdit.is(tsDocEdit)) { | ||
if (vueDocuments.hasVirtualFileByUri(tsDocEdit.textDocument.uri)) { | ||
for (const [_, map] of vueDocuments.getMapsByVirtualFileUri(tsDocEdit.textDocument.uri)) { | ||
if (documents.hasVirtualFileByUri(tsDocEdit.textDocument.uri)) { | ||
for (const [_, map] of documents.getMapsByVirtualFileUri(tsDocEdit.textDocument.uri)) { | ||
sourceEdit = vscode.TextDocumentEdit.create({ | ||
@@ -230,7 +230,7 @@ uri: map.sourceFileDocument.uri, | ||
else if (vscode.RenameFile.is(tsDocEdit)) { | ||
if (!vueDocuments.hasVirtualFileByUri(tsDocEdit.oldUri)) { | ||
if (!documents.hasVirtualFileByUri(tsDocEdit.oldUri)) { | ||
sourceEdit = tsDocEdit; | ||
} | ||
else { | ||
for (const [_, map] of vueDocuments.getMapsByVirtualFileUri(tsDocEdit.oldUri)) { | ||
for (const [_, map] of documents.getMapsByVirtualFileUri(tsDocEdit.oldUri)) { | ||
// TODO: check capability? | ||
@@ -242,7 +242,7 @@ sourceEdit = vscode.RenameFile.create(map.sourceFileDocument.uri, tsDocEdit.newUri /* TODO: remove .ts? */, tsDocEdit.options, tsDocEdit.annotationId); | ||
else if (vscode.DeleteFile.is(tsDocEdit)) { | ||
if (!vueDocuments.hasVirtualFileByUri(tsDocEdit.uri)) { | ||
if (!documents.hasVirtualFileByUri(tsDocEdit.uri)) { | ||
sourceEdit = tsDocEdit; | ||
} | ||
else { | ||
for (const [_, map] of vueDocuments.getMapsByVirtualFileUri(tsDocEdit.uri)) { | ||
for (const [_, map] of documents.getMapsByVirtualFileUri(tsDocEdit.uri)) { | ||
// TODO: check capability? | ||
@@ -249,0 +249,0 @@ sourceEdit = vscode.DeleteFile.create(map.sourceFileDocument.uri, tsDocEdit.options, tsDocEdit.annotationId); |
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
for (const range of ranges) { | ||
const vueRange = getOtherRange({ | ||
const otherRange = getOtherRange({ | ||
start: { line: range.startLine, character: (_a = range.startCharacter) !== null && _a !== void 0 ? _a : 0 }, | ||
end: { line: range.endLine, character: (_b = range.endCharacter) !== null && _b !== void 0 ? _b : 0 }, | ||
}); | ||
if (vueRange) { | ||
range.startLine = vueRange.start.line; | ||
range.endLine = vueRange.end.line; | ||
if (otherRange) { | ||
range.startLine = otherRange.start.line; | ||
range.endLine = otherRange.end.line; | ||
if (range.startCharacter !== undefined) | ||
range.startCharacter = vueRange.start.character; | ||
range.startCharacter = otherRange.start.character; | ||
if (range.endCharacter !== undefined) | ||
range.endCharacter = vueRange.end.character; | ||
range.endCharacter = otherRange.end.character; | ||
result.push(range); | ||
@@ -20,0 +20,0 @@ } |
@@ -42,2 +42,4 @@ import { LanguageContext, LanguageModule, LanguageServiceHost } from '@volar/language-core'; | ||
/** @private */ | ||
rulesSettings: RulesSettings; | ||
/** @private */ | ||
getTextDocument(uri: string): TextDocument | undefined; | ||
@@ -167,2 +169,3 @@ /** @private */ | ||
onDidChangeConfiguration?: ConfigurationHost['onDidChangeConfiguration']; | ||
settings: RulesSettings; | ||
ruleId: string; | ||
@@ -172,2 +175,4 @@ document: TextDocument; | ||
} | ||
export interface RulesSettings { | ||
} | ||
export interface RuleFix { | ||
@@ -189,2 +194,3 @@ kinds?: ('' | 'quickfix' | 'refactor' | 'refactor.extract' | 'refactor.inline' | 'refactor.rewrite' | 'source' | 'source.organizeImports' | 'source.fixAll')[]; | ||
}; | ||
rulesSettings?: RulesSettings; | ||
} |
@@ -18,3 +18,2 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
; | ||
; | ||
//# sourceMappingURL=types.js.map |
@@ -99,2 +99,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
onDidChangeConfiguration: (_g = context.env.configurationHost) === null || _g === void 0 ? void 0 : _g.onDidChangeConfiguration, | ||
settings: context.rulesSettings, | ||
// document context | ||
@@ -142,2 +143,3 @@ ruleId: '', | ||
onDidChangeConfiguration: (_c = context.env.configurationHost) === null || _c === void 0 ? void 0 : _c.onDidChangeConfiguration, | ||
settings: context.rulesSettings, | ||
// document context | ||
@@ -144,0 +146,0 @@ ruleId: '', |
{ | ||
"name": "@volar/language-service", | ||
"version": "1.2.0-alpha.7", | ||
"version": "1.2.0-alpha.8", | ||
"main": "out/index.js", | ||
@@ -16,6 +16,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/language-core": "1.2.0-alpha.7", | ||
"@volar/shared": "1.2.0-alpha.7", | ||
"@volar/source-map": "1.2.0-alpha.7", | ||
"@volar/typescript-faster": "1.2.0-alpha.7", | ||
"@volar/language-core": "1.2.0-alpha.8", | ||
"@volar/shared": "1.2.0-alpha.8", | ||
"@volar/source-map": "1.2.0-alpha.8", | ||
"@volar/typescript-faster": "1.2.0-alpha.8", | ||
"vscode-html-languageservice": "^5.0.3", | ||
@@ -27,3 +27,3 @@ "vscode-json-languageservice": "^5.1.3", | ||
}, | ||
"gitHead": "5811cdb90f68a2db0166aafadcce3f953156c9a3" | ||
"gitHead": "9437b4560f35d2a153a9e2ae0dd0f64285bbb3b3" | ||
} |
212218
3870
+ Added@volar/language-core@1.2.0-alpha.8(transitive)
+ Added@volar/shared@1.2.0-alpha.8(transitive)
+ Added@volar/source-map@1.2.0-alpha.8(transitive)
+ Added@volar/typescript-faster@1.2.0-alpha.8(transitive)
- Removed@volar/language-core@1.2.0-alpha.7(transitive)
- Removed@volar/shared@1.2.0-alpha.7(transitive)
- Removed@volar/source-map@1.2.0-alpha.7(transitive)
- Removed@volar/typescript-faster@1.2.0-alpha.7(transitive)
Updated@volar/shared@1.2.0-alpha.8