@volar/language-service
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -57,3 +57,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
sourceFile = (0, reactivity_1.shallowReactive)(sourceFile); | ||
const sourceFileDoc = (0, documents_1.parseSourceFileDocument)(options.env.rootUri, sourceFile); | ||
const sourceFileDoc = (0, documents_1.parseSourceFileDocument)(sourceFile); | ||
cache = [sourceFileDoc, languageModule]; | ||
@@ -60,0 +60,0 @@ vueDocuments.set(document, cache); |
@@ -43,3 +43,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
}; | ||
const textDocumentMapper = (0, documents_1.parseSourceFileDocuments)(options.env.rootUri, options.context.mapper); | ||
const textDocumentMapper = (0, documents_1.parseSourceFileDocuments)(options.context.mapper); | ||
const documents = new WeakMap(); | ||
@@ -90,3 +90,3 @@ const documentVersions = new Map(); | ||
findTypeDefinition: definition.register(context, 'findTypeDefinition', data => !!data.definition, data => !!data.definition), | ||
findImplementations: definition.register(context, 'findImplementations', data => !!data.references, data => false), | ||
findImplementations: definition.register(context, 'findImplementations', data => !!data.references, () => false), | ||
prepareRename: renamePrepare.register(context), | ||
@@ -93,0 +93,0 @@ doRename: rename.register(context), |
@@ -6,3 +6,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return (document, position, options) => { | ||
return (0, featureWorkers_1.documentArgFeatureWorker)(context, document, position, sourceMap => true, (position, sourceMap) => sourceMap.toGeneratedPositions(position, data => !!data.completion), (plugin, document, position) => { var _a; return (_a = plugin.doAutoInsert) === null || _a === void 0 ? void 0 : _a.call(plugin, document, position, options); }, (data, sourceMap) => { | ||
return (0, featureWorkers_1.documentArgFeatureWorker)(context, document, position, () => true, (position, sourceMap) => sourceMap.toGeneratedPositions(position, data => !!data.completion), (plugin, document, position) => { var _a; return (_a = plugin.doAutoInsert) === null || _a === void 0 ? void 0 : _a.call(plugin, document, position, options); }, (data, sourceMap) => { | ||
if (typeof data === 'string') | ||
@@ -9,0 +9,0 @@ return data; |
@@ -7,3 +7,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return (document, position) => { | ||
return (0, featureWorkers_1.documentArgFeatureWorker)(context, document, position, sourceMap => true, (position, sourceMap) => sourceMap.toGeneratedPositions(position, data => !!data.completion), (plugin, document, position) => { var _a; return (_a = plugin.findLinkedEditingRanges) === null || _a === void 0 ? void 0 : _a.call(plugin, document, position); }, (data, sourceMap) => ({ | ||
return (0, featureWorkers_1.documentArgFeatureWorker)(context, document, position, () => true, (position, sourceMap) => sourceMap.toGeneratedPositions(position, data => !!data.completion), (plugin, document, position) => { var _a; return (_a = plugin.findLinkedEditingRanges) === null || _a === void 0 ? void 0 : _a.call(plugin, document, position); }, (data, sourceMap) => ({ | ||
wordPattern: data.wordPattern, | ||
@@ -10,0 +10,0 @@ ranges: data.ranges.map(range => sourceMap.toSourceRange(range)).filter(shared.notEmpty), |
@@ -5,3 +5,2 @@ import { DocumentRegistry, EmbeddedFile, PositionCapabilities, SourceFile, TeleportMappingData } from '@volar/language-core'; | ||
import { TextDocument } from 'vscode-languageserver-textdocument'; | ||
import { URI } from 'vscode-uri'; | ||
export type SourceFileDocuments = ReturnType<typeof parseSourceFileDocuments>; | ||
@@ -41,3 +40,3 @@ export type SourceFileDocument = ReturnType<typeof parseSourceFileDocument>; | ||
} | ||
export declare function parseSourceFileDocuments(rootUri: URI, mapper: DocumentRegistry): { | ||
export declare function parseSourceFileDocuments(mapper: DocumentRegistry): { | ||
getAll: () => { | ||
@@ -73,3 +72,3 @@ uri: string; | ||
}; | ||
export declare function parseSourceFileDocument(rootUri: URI, sourceFile: SourceFile): { | ||
export declare function parseSourceFileDocument(sourceFile: SourceFile): { | ||
uri: string; | ||
@@ -76,0 +75,0 @@ file: SourceFile; |
@@ -138,3 +138,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TeleportSourceMap = TeleportSourceMap; | ||
function parseSourceFileDocuments(rootUri, mapper) { | ||
function parseSourceFileDocuments(mapper) { | ||
const _sourceFiles = new WeakMap(); | ||
@@ -191,3 +191,3 @@ // reactivity | ||
if (!vueDocument) { | ||
vueDocument = parseSourceFileDocument(rootUri, sourceFile); | ||
vueDocument = parseSourceFileDocument(sourceFile); | ||
_sourceFiles.set(sourceFile, vueDocument); | ||
@@ -202,3 +202,3 @@ } | ||
exports.parseSourceFileDocuments = parseSourceFileDocuments; | ||
function parseSourceFileDocument(rootUri, sourceFile) { | ||
function parseSourceFileDocument(sourceFile) { | ||
let documentVersion = 0; | ||
@@ -209,3 +209,3 @@ const embeddedDocumentVersions = new Map(); | ||
// computed | ||
const document = (0, reactivity_1.computed)(() => vscode_languageserver_textdocument_1.TextDocument.create(shared.getUriByPath(rootUri, sourceFile.fileName), sourceFile.fileName.endsWith('.md') ? 'markdown' : 'vue', documentVersion++, sourceFile.text)); | ||
const document = (0, reactivity_1.computed)(() => vscode_languageserver_textdocument_1.TextDocument.create(shared.getUriByPath(sourceFile.fileName), sourceFile.fileName.endsWith('.md') ? 'markdown' : 'vue', documentVersion++, sourceFile.text)); | ||
const allSourceMaps = (0, reactivity_1.computed)(() => { | ||
@@ -230,3 +230,3 @@ const result = []; | ||
return { | ||
uri: shared.getUriByPath(rootUri, sourceFile.fileName), | ||
uri: shared.getUriByPath(sourceFile.fileName), | ||
file: sourceFile, | ||
@@ -254,3 +254,3 @@ getSourceMap, | ||
if (!document || document.getText() !== embeddedFile.text) { | ||
const uri = shared.getUriByPath(rootUri, embeddedFile.fileName); | ||
const uri = shared.getUriByPath(embeddedFile.fileName); | ||
const newVersion = ((_a = embeddedDocumentVersions.get(uri.toLowerCase())) !== null && _a !== void 0 ? _a : 0) + 1; | ||
@@ -257,0 +257,0 @@ embeddedDocumentVersions.set(uri.toLowerCase(), newVersion); |
@@ -28,3 +28,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
let codeActions = yield (0, featureWorkers_1.languageFeatureWorker)(context, uri, { range, codeActionContext }, (arg, sourceMap) => { | ||
let codeActions = yield (0, featureWorkers_1.languageFeatureWorker)(context, uri, { range, codeActionContext }, (_arg, sourceMap) => { | ||
var _a, _b; | ||
@@ -31,0 +31,0 @@ if (!sourceMap.embeddedFile.capabilities.codeAction) |
@@ -18,3 +18,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var _a; | ||
return (_a = yield (0, featureWorkers_1.languageFeatureWorker)(context, uri, undefined, (arg, sourceMap) => [arg], (plugin, document, arg, sourceMap) => __awaiter(this, void 0, void 0, function* () { | ||
return (_a = yield (0, featureWorkers_1.languageFeatureWorker)(context, uri, undefined, (arg) => [arg], (plugin, document) => __awaiter(this, void 0, void 0, function* () { | ||
var _b, _c; | ||
@@ -21,0 +21,0 @@ const codeLens = yield ((_c = (_b = plugin.codeLens) === null || _b === void 0 ? void 0 : _b.on) === null || _c === void 0 ? void 0 : _c.call(_b, document)); |
@@ -17,3 +17,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return (uri, position) => { | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, position, (position, sourceMap) => sourceMap.toGeneratedPositions(position, isValidMappingData), (plugin, document, position, sourceMap) => __awaiter(this, void 0, void 0, function* () { | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, position, (position, sourceMap) => sourceMap.toGeneratedPositions(position, isValidMappingData), (plugin, document, position) => __awaiter(this, void 0, void 0, function* () { | ||
const recursiveChecker = dedupe.createLocationSet(); | ||
@@ -20,0 +20,0 @@ const result = []; |
@@ -19,3 +19,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
// note https://github.com/johnsoncodehk/volar/issues/2009 | ||
data => typeof data.rename === 'object' ? !!data.rename.normalize : !!data.rename), (plugin, document, position, sourceMap, vueDocument) => __awaiter(this, void 0, void 0, function* () { | ||
data => typeof data.rename === 'object' ? !!data.rename.normalize : !!data.rename), (plugin, document, position) => __awaiter(this, void 0, void 0, function* () { | ||
const recursiveChecker = dedupe.createLocationSet(); | ||
@@ -22,0 +22,0 @@ const result = []; |
@@ -17,3 +17,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var _a; | ||
const pluginLinks = (_a = yield (0, featureWorkers_1.languageFeatureWorker)(context, uri, undefined, (arg, sourceMap) => [arg], (plugin, document, arg) => { var _a; return (_a = plugin.findDocumentLinks) === null || _a === void 0 ? void 0 : _a.call(plugin, document); }, (data, sourceMap) => data.map(link => { | ||
const pluginLinks = (_a = yield (0, featureWorkers_1.languageFeatureWorker)(context, uri, undefined, (arg) => [arg], (plugin, document) => { var _a; return (_a = plugin.findDocumentLinks) === null || _a === void 0 ? void 0 : _a.call(plugin, document); }, (data, sourceMap) => data.map(link => { | ||
if (!sourceMap) | ||
@@ -20,0 +20,0 @@ return link; |
@@ -22,3 +22,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return (_b = yield ((_a = plugin.findFileReferences) === null || _a === void 0 ? void 0 : _a.call(plugin, document))) !== null && _b !== void 0 ? _b : []; | ||
}), (data, sourceMap) => data.map(reference => { | ||
}), (data) => data.map(reference => { | ||
const map = context.documents.sourceMapFromEmbeddedDocumentUri(reference.uri); | ||
@@ -25,0 +25,0 @@ if (!map) { |
@@ -26,3 +26,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, range, (arg, sourceMap) => { | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, range, (_arg, sourceMap) => { | ||
/** | ||
@@ -51,3 +51,3 @@ * copy from ./codeActions.ts | ||
return []; | ||
}, (plugin, document, arg, sourceMap) => { | ||
}, (plugin, document, arg) => { | ||
var _a, _b; | ||
@@ -54,0 +54,0 @@ return (_b = (_a = plugin.inlayHints) === null || _a === void 0 ? void 0 : _a.on) === null || _b === void 0 ? void 0 : _b.call(_a, document, arg); |
@@ -16,3 +16,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return (uri, position) => { | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, position, (position, sourceMap) => sourceMap.toGeneratedPositions(position, data => !!data.references), (plugin, document, position, sourceMap, vueDocument) => __awaiter(this, void 0, void 0, function* () { | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, position, (position, sourceMap) => sourceMap.toGeneratedPositions(position, data => !!data.references), (plugin, document, position) => __awaiter(this, void 0, void 0, function* () { | ||
const recursiveChecker = dedupe.createLocationSet(); | ||
@@ -51,3 +51,3 @@ const result = []; | ||
} | ||
}), (data, sourceMap) => { | ||
}), (data) => { | ||
const results = []; | ||
@@ -54,0 +54,0 @@ for (const reference of data) { |
@@ -30,3 +30,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
; | ||
}, (plugin, document, arg, sourceMap) => __awaiter(this, void 0, void 0, function* () { | ||
}, (plugin, document, arg) => __awaiter(this, void 0, void 0, function* () { | ||
const recursiveChecker = dedupe.createLocationSet(); | ||
@@ -90,3 +90,3 @@ let result; | ||
} | ||
}), (data, sourceMap) => { | ||
}), (data) => { | ||
return embeddedEditToSourceEdit(data, context.documents); | ||
@@ -93,0 +93,0 @@ }, (workspaceEdits) => { |
@@ -6,3 +6,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return (uri, position, signatureHelpContext) => { | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, position, (position, sourceMap) => sourceMap.toGeneratedPositions(position, data => !!data.completion), (plugin, document, position) => { var _a; return (_a = plugin.getSignatureHelp) === null || _a === void 0 ? void 0 : _a.call(plugin, document, position, signatureHelpContext); }, (data, sourceMap) => data); | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, position, (position, sourceMap) => sourceMap.toGeneratedPositions(position, data => !!data.completion), (plugin, document, position) => { var _a; return (_a = plugin.getSignatureHelp) === null || _a === void 0 ? void 0 : _a.call(plugin, document, position, signatureHelpContext); }, (data) => data); | ||
}; | ||
@@ -9,0 +9,0 @@ } |
@@ -153,3 +153,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
}, (plugin, document, arg, sourceMap) => __awaiter(this, void 0, void 0, function* () { | ||
}, (plugin, document) => __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c, _d, _e; | ||
@@ -156,0 +156,0 @@ if (token) { |
{ | ||
"name": "@volar/language-service", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"main": "out/index.js", | ||
@@ -16,7 +16,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/language-core": "1.0.11", | ||
"@volar/shared": "1.0.11", | ||
"@volar/source-map": "1.0.11", | ||
"@volar/transforms": "1.0.11", | ||
"@volar/typescript-faster": "1.0.11", | ||
"@volar/language-core": "1.0.12", | ||
"@volar/shared": "1.0.12", | ||
"@volar/source-map": "1.0.12", | ||
"@volar/transforms": "1.0.12", | ||
"@volar/typescript-faster": "1.0.12", | ||
"@vue/reactivity": "^3.2.45", | ||
@@ -29,3 +29,3 @@ "vscode-html-languageservice": "^5.0.3", | ||
}, | ||
"gitHead": "aff3d7c0896a391412a605597adca7d796e9accf" | ||
"gitHead": "2426aa8ec6731a6f6d88086da7021a32d9306de3" | ||
} |
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
190657
3481
+ Added@volar/language-core@1.0.12(transitive)
+ Added@volar/shared@1.0.12(transitive)
+ Added@volar/source-map@1.0.12(transitive)
+ Added@volar/transforms@1.0.12(transitive)
+ Added@volar/typescript-faster@1.0.12(transitive)
- Removed@volar/language-core@1.0.11(transitive)
- Removed@volar/shared@1.0.11(transitive)
- Removed@volar/source-map@1.0.11(transitive)
- Removed@volar/transforms@1.0.11(transitive)
- Removed@volar/typescript-faster@1.0.11(transitive)
Updated@volar/language-core@1.0.12
Updated@volar/shared@1.0.12
Updated@volar/source-map@1.0.12
Updated@volar/transforms@1.0.12