@volar/language-service
Advanced tools
Comparing version 1.0.0-alpha.3 to 1.0.0-alpha.4
@@ -12,2 +12,3 @@ import { createEmbeddedLanguageServiceHost, LanguageServiceHost } from '@volar/language-core'; | ||
env: PluginContext['env']; | ||
documentRegistry: ts.DocumentRegistry | undefined; | ||
}): LanguageServiceContext; | ||
@@ -14,0 +15,0 @@ export declare function createLanguageService(context: LanguageServiceContext): { |
@@ -32,3 +32,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
const ts = options.host.getTypeScriptModule(); | ||
const tsLs = ts.createLanguageService(options.context.typescriptLanguageServiceHost); | ||
const tsLs = ts.createLanguageService(options.context.typescriptLanguageServiceHost, options.documentRegistry); | ||
tsFaster.decorate(ts, options.context.typescriptLanguageServiceHost, tsLs); | ||
@@ -35,0 +35,0 @@ let plugins; |
@@ -12,3 +12,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.register = void 0; | ||
const shared = require("@volar/shared"); | ||
const featureWorkers_1 = require("../utils/featureWorkers"); | ||
@@ -54,14 +53,18 @@ const dedupe = require("../utils/dedupe"); | ||
} | ||
}), (data, sourceMap) => data.map(reference => { | ||
var _a; | ||
const referenceSourceMap = context.documents.sourceMapFromEmbeddedDocumentUri(reference.uri); | ||
if (referenceSourceMap) { | ||
const range = (_a = referenceSourceMap.getSourceRange(reference.range.start, reference.range.end, data => !!data.references)) === null || _a === void 0 ? void 0 : _a[0]; | ||
if (!range) | ||
return; | ||
reference.uri = referenceSourceMap.sourceDocument.uri; | ||
reference.range = range; | ||
}), (data, sourceMap) => { | ||
const results = []; | ||
for (const reference of data) { | ||
const referenceSourceMap = context.documents.sourceMapFromEmbeddedDocumentUri(reference.uri); | ||
if (referenceSourceMap) { | ||
for (const [range] of referenceSourceMap.getSourceRanges(reference.range.start, reference.range.end, data => !!data.references)) { | ||
results.push({ | ||
uri: referenceSourceMap.sourceDocument.uri, | ||
range, | ||
}); | ||
} | ||
} | ||
results.push(reference); | ||
} | ||
return reference; | ||
}).filter(shared.notEmpty), arr => dedupe.withLocations(arr.flat())); | ||
return results; | ||
}, arr => dedupe.withLocations(arr.flat())); | ||
}; | ||
@@ -68,0 +71,0 @@ } |
{ | ||
"name": "@volar/language-service", | ||
"version": "1.0.0-alpha.3", | ||
"version": "1.0.0-alpha.4", | ||
"main": "out/index.js", | ||
@@ -19,7 +19,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/language-core": "1.0.0-alpha.3", | ||
"@volar/shared": "1.0.0-alpha.3", | ||
"@volar/source-map": "1.0.0-alpha.3", | ||
"@volar/transforms": "1.0.0-alpha.3", | ||
"@volar/typescript-faster": "1.0.0-alpha.3", | ||
"@volar/language-core": "1.0.0-alpha.4", | ||
"@volar/shared": "1.0.0-alpha.4", | ||
"@volar/source-map": "1.0.0-alpha.4", | ||
"@volar/transforms": "1.0.0-alpha.4", | ||
"@volar/typescript-faster": "1.0.0-alpha.4", | ||
"@vue/reactivity": "^3.2.38", | ||
@@ -33,3 +33,3 @@ "upath": "^2.0.1", | ||
}, | ||
"gitHead": "55a1d3fa143411dd4520020f407e427df4e4e26a" | ||
"gitHead": "712fc3178ed7a7414da73e940c5c5e8b54eebea1" | ||
} |
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
191919
3446
+ Added@volar/code-gen@1.0.0-alpha.4(transitive)
+ Added@volar/language-core@1.0.0-alpha.4(transitive)
+ Added@volar/shared@1.0.0-alpha.4(transitive)
+ Added@volar/source-map@1.0.0-alpha.4(transitive)
+ Added@volar/transforms@1.0.0-alpha.4(transitive)
+ Added@volar/typescript-faster@1.0.0-alpha.4(transitive)
- Removed@volar/code-gen@1.0.0-alpha.3(transitive)
- Removed@volar/language-core@1.0.0-alpha.3(transitive)
- Removed@volar/shared@1.0.0-alpha.3(transitive)
- Removed@volar/source-map@1.0.0-alpha.3(transitive)
- Removed@volar/transforms@1.0.0-alpha.3(transitive)
- Removed@volar/typescript-faster@1.0.0-alpha.3(transitive)
Updated@volar/shared@1.0.0-alpha.4