@volar/typescript 2.4.25 → 2.4.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,13 +30,10 @@ function decorateLanguageServiceHost(ts, language, languageServiceHost) {
|
|
|
30
30
|
}
|
|
31
31
|
if (pluginExtensions.length) {
|
|
32
32
|
const resolveModuleName = (0, resolveModuleName_1.createResolveModuleName)(ts, ts.sys.getFileSize, languageServiceHost, language.plugins, fileName => language.scripts.get(fileName));
|
|
33
|
-
const
|
|
34
|
-
? (fileName) => fileName
|
|
35
|
-
: (fileName) => fileName.toLowerCase();
|
|
36
|
-
const moduleResolutionCache = ts.createModuleResolutionCache(languageServiceHost.getCurrentDirectory(), getCanonicalFileName, languageServiceHost.getCompilationSettings());
|
|
33
|
+
const moduleResolutionCache = languageServiceHost.getModuleResolutionCache?.();
|
|
37
34
|
if (resolveModuleNameLiterals) {
|
|
38
35
|
languageServiceHost.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, ...rest) => {
|
|
39
|
-
const disposeFixup = (0, utils_1.fixupImpliedNodeFormatForFile)(ts, pluginExtensions, containingSourceFile, moduleResolutionCache
|
|
36
|
+
const disposeFixup = (0, utils_1.fixupImpliedNodeFormatForFile)(ts, pluginExtensions, containingSourceFile, moduleResolutionCache?.getPackageJsonInfoCache(), languageServiceHost, options);
|
|
40
37
|
try {
|
|
41
38
|
if (moduleLiterals.every(name => !pluginExtensions.some(ext => name.text.endsWith(ext)))) {
|
|
42
39
|
return resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, ...rest);
|
package/lib/node/utils.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import type { Language, SourceScript } from '@volar/language-core';
|
|
|
2
2
|
import type * as ts from 'typescript';
|
|
3
3
|
import type { TypeScriptServiceScript } from '../..';
|
|
4
4
|
export declare function getServiceScript(language: Language<string>, fileName: string): [serviceScript: TypeScriptServiceScript, targetScript: SourceScript<string>, sourceScript: SourceScript<string>] | [serviceScript: undefined, sourceScript: SourceScript<string>, sourceScript: SourceScript<string>] | [serviceScript: undefined, sourceScript: undefined, targetScript: undefined];
|
|
5
|
-
export declare function fixupImpliedNodeFormatForFile(ts: typeof import('typescript'), pluginExtensions: string[], sourceFile: ts.SourceFile, packageJsonInfoCache: ts.PackageJsonInfoCache, host: ts.ModuleResolutionHost, options: ts.CompilerOptions): (() => undefined) | undefined;
|
|
5
|
+
export declare function fixupImpliedNodeFormatForFile(ts: typeof import('typescript'), pluginExtensions: string[], sourceFile: ts.SourceFile, packageJsonInfoCache: ts.PackageJsonInfoCache | undefined, host: ts.ModuleResolutionHost, options: ts.CompilerOptions): (() => undefined) | undefined;
|
package/lib/node/utils.js
CHANGED
|
@@ -36,8 +36,8 @@ function fixupImpliedNodeFormatForFile(ts, pluginExtensions, sourceFile, package
|
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
const asTs = sourceFile.fileName + '.ts';
|
|
39
|
-
// Use
|
|
40
|
-
const impliedNodeFormat = ts.
|
|
39
|
+
// Use getImpliedNodeFormatForFileWorker instead of getImpliedNodeFormatForFile for runTsc() compatibility
|
|
40
|
+
const impliedNodeFormat = ts.getImpliedNodeFormatForFileWorker?.(asTs, packageJsonInfoCache, host, options)?.impliedNodeFormat;
|
|
41
41
|
if (impliedNodeFormat === undefined) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/typescript",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.27",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,13 +12,12 @@
|
|
|
12
12
|
"directory": "packages/typescript"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@volar/language-core": "2.4.
|
|
15
|
+
"@volar/language-core": "2.4.27",
|
|
16
16
|
"path-browserify": "^1.0.1",
|
|
17
17
|
"vscode-uri": "^3.0.8"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/path-browserify": "latest",
|
|
21
|
-
"@volar/language-service": "2.4.
|
|
22
|
-
}
|
|
23
|
-
"gitHead": "cff5cbf8cfe438e27b2ccbc15248937308ff21a7"
|
|
21
|
+
"@volar/language-service": "2.4.27"
|
|
22
|
+
}
|
|
24
23
|
}
|