@volar/typescript
Advanced tools
Comparing version 2.4.0-alpha.1 to 2.4.0-alpha.2
import { Language } from '@volar/language-core'; | ||
import type * as ts from 'typescript'; | ||
import { URI } from 'vscode-uri'; | ||
import type { TypeScriptExtraServiceScript } from '../..'; | ||
@@ -8,5 +7,5 @@ import type { createSys } from './createSys'; | ||
} | ||
export declare function createLanguageServiceHost(ts: typeof import('typescript'), sys: ReturnType<typeof createSys> | ts.System, language: Language<URI>, asUri: (fileName: string) => URI, projectHost: TypeScriptProjectHost): { | ||
export declare function createLanguageServiceHost<T>(ts: typeof import('typescript'), sys: ReturnType<typeof createSys> | ts.System, language: Language<T>, asScriptId: (fileName: string) => T, projectHost: TypeScriptProjectHost): { | ||
languageServiceHost: ts.LanguageServiceHost; | ||
getExtraServiceScript: (fileName: string) => TypeScriptExtraServiceScript | undefined; | ||
}; |
@@ -7,3 +7,3 @@ "use strict"; | ||
const resolveModuleName_1 = require("../resolveModuleName"); | ||
function createLanguageServiceHost(ts, sys, language, asUri, projectHost) { | ||
function createLanguageServiceHost(ts, sys, language, asScriptId, projectHost) { | ||
const scriptVersions = new language_core_1.FileMap(sys.useCaseSensitiveFileNames); | ||
@@ -86,3 +86,3 @@ let lastProjectVersion; | ||
} | ||
const sourceScript = language.scripts.get(asUri(fileName)); | ||
const sourceScript = language.scripts.get(asScriptId(fileName)); | ||
if (sourceScript?.generated) { | ||
@@ -124,3 +124,3 @@ const serviceScript = sourceScript.generated.languagePlugin.typescript?.getServiceScript(sourceScript.generated.root); | ||
const moduleCache = ts.createModuleResolutionCache(languageServiceHost.getCurrentDirectory(), languageServiceHost.useCaseSensitiveFileNames?.() ? s => s : s => s.toLowerCase(), languageServiceHost.getCompilationSettings()); | ||
const resolveModuleName = (0, resolveModuleName_1.createResolveModuleName)(ts, languageServiceHost, language.plugins, fileName => language.scripts.get(asUri(fileName))); | ||
const resolveModuleName = (0, resolveModuleName_1.createResolveModuleName)(ts, languageServiceHost, language.plugins, fileName => language.scripts.get(asScriptId(fileName))); | ||
let lastSysVersion = 'version' in sys ? sys.version : undefined; | ||
@@ -166,3 +166,3 @@ languageServiceHost.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, options, sourceFile) => { | ||
for (const fileName of projectHost.getScriptFileNames()) { | ||
const sourceScript = language.scripts.get(asUri(fileName)); | ||
const sourceScript = language.scripts.get(asScriptId(fileName)); | ||
if (sourceScript?.generated) { | ||
@@ -206,3 +206,3 @@ const serviceScript = sourceScript.generated.languagePlugin.typescript?.getServiceScript(sourceScript.generated.root); | ||
} | ||
const sourceScript = language.scripts.get(asUri(fileName)); | ||
const sourceScript = language.scripts.get(asScriptId(fileName)); | ||
if (sourceScript?.generated) { | ||
@@ -231,3 +231,3 @@ const serviceScript = sourceScript.generated.languagePlugin.typescript?.getServiceScript(sourceScript.generated.root); | ||
} | ||
const sourceScript = language.scripts.get(asUri(fileName)); | ||
const sourceScript = language.scripts.get(asScriptId(fileName)); | ||
if (sourceScript?.generated) { | ||
@@ -244,3 +244,3 @@ const serviceScript = sourceScript.generated.languagePlugin.typescript?.getServiceScript(sourceScript.generated.root); | ||
if (isOpenedFile) { | ||
const sourceScript = language.scripts.get(asUri(fileName)); | ||
const sourceScript = language.scripts.get(asScriptId(fileName)); | ||
if (sourceScript && !sourceScript.generated) { | ||
@@ -247,0 +247,0 @@ if (!version.map.has(sourceScript.snapshot)) { |
{ | ||
"name": "@volar/typescript", | ||
"version": "2.4.0-alpha.1", | ||
"version": "2.4.0-alpha.2", | ||
"license": "MIT", | ||
@@ -15,3 +15,3 @@ "files": [ | ||
"dependencies": { | ||
"@volar/language-core": "2.4.0-alpha.1", | ||
"@volar/language-core": "2.4.0-alpha.2", | ||
"path-browserify": "^1.0.1", | ||
@@ -23,5 +23,5 @@ "vscode-uri": "^3.0.8" | ||
"@types/path-browserify": "latest", | ||
"@volar/language-service": "2.4.0-alpha.1" | ||
"@volar/language-service": "2.4.0-alpha.2" | ||
}, | ||
"gitHead": "c096c457fea026fcd432b82224026f747fab571b" | ||
"gitHead": "62914047f925b79391fee6e4f697705b77641baf" | ||
} |
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
241289
5040
+ Added@volar/language-core@2.4.0-alpha.2(transitive)
+ Added@volar/source-map@2.4.0-alpha.2(transitive)
- Removed@volar/language-core@2.4.0-alpha.1(transitive)
- Removed@volar/source-map@2.4.0-alpha.1(transitive)