@volar/typescript
Advanced tools
Comparing version 2.4.0-alpha.12 to 2.4.0-alpha.13
@@ -7,2 +7,5 @@ import type * as ts from 'typescript'; | ||
}; | ||
export declare function runTsc(tscPath: string, extensions: string[], _getLanguagePlugins: typeof getLanguagePlugins): void; | ||
export declare function runTsc(tscPath: string, extensionsOrOptions: string[] | { | ||
supportedExtensions: string[]; | ||
extensionsToRemove: string[]; | ||
}, _getLanguagePlugins: typeof getLanguagePlugins): void; |
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.getLanguagePlugins = getLanguagePlugins; | ||
function runTsc(tscPath, extensions, _getLanguagePlugins) { | ||
function runTsc(tscPath, extensionsOrOptions, _getLanguagePlugins) { | ||
exports.getLanguagePlugins = _getLanguagePlugins; | ||
@@ -16,7 +16,15 @@ const proxyApiPath = require.resolve('../node/proxyCreateProgram'); | ||
let tsc = readFileSync(...args); | ||
const supportedExtensions = Array.isArray(extensionsOrOptions) ? extensionsOrOptions : extensionsOrOptions.supportedExtensions; | ||
const extensionsToRemove = Array.isArray(extensionsOrOptions) ? [] : extensionsOrOptions.extensionsToRemove; | ||
// add allow extensions | ||
const extsText = extensions.map(ext => `"${ext}"`).join(', '); | ||
tsc = replace(tsc, /supportedTSExtensions = .*(?=;)/, s => s + `.concat([[${extsText}]])`); | ||
tsc = replace(tsc, /supportedJSExtensions = .*(?=;)/, s => s + `.concat([[${extsText}]])`); | ||
tsc = replace(tsc, /allSupportedExtensions = .*(?=;)/, s => s + `.concat([[${extsText}]])`); | ||
if (supportedExtensions.length) { | ||
const extsText = supportedExtensions.map(ext => `"${ext}"`).join(', '); | ||
tsc = replace(tsc, /supportedTSExtensions = .*(?=;)/, s => s + `.concat([[${extsText}]])`); | ||
tsc = replace(tsc, /supportedJSExtensions = .*(?=;)/, s => s + `.concat([[${extsText}]])`); | ||
tsc = replace(tsc, /allSupportedExtensions = .*(?=;)/, s => s + `.concat([[${extsText}]])`); | ||
} | ||
if (extensionsToRemove.length) { | ||
const extsText = extensionsToRemove.map(ext => `"${ext}"`).join(', '); | ||
tsc = replace(tsc, /extensionsToRemove = .*(?=;)/, s => s + `.concat([${extsText}])`); | ||
} | ||
// proxy createProgram | ||
@@ -23,0 +31,0 @@ tsc = replace(tsc, /function createProgram\(.+\) {/, s => `var createProgram = require(${JSON.stringify(proxyApiPath)}).proxyCreateProgram(` |
{ | ||
"name": "@volar/typescript", | ||
"version": "2.4.0-alpha.12", | ||
"version": "2.4.0-alpha.13", | ||
"license": "MIT", | ||
@@ -15,3 +15,3 @@ "files": [ | ||
"dependencies": { | ||
"@volar/language-core": "2.4.0-alpha.12", | ||
"@volar/language-core": "2.4.0-alpha.13", | ||
"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.12" | ||
"@volar/language-service": "2.4.0-alpha.13" | ||
}, | ||
"gitHead": "9418f0c81cef5ca13b21bf43a49bef67c6cb2993" | ||
"gitHead": "5f6d5d8ec51a5dda702d071c283e9133254cae97" | ||
} |
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
200766
4276
+ Added@volar/language-core@2.4.0-alpha.13(transitive)
+ Added@volar/source-map@2.4.0-alpha.13(transitive)
- Removed@volar/language-core@2.4.0-alpha.12(transitive)
- Removed@volar/source-map@2.4.0-alpha.12(transitive)