Skip to content

Commit

Permalink
fix(typescript): remove _getLanguageId param for runTsc
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Apr 30, 2024
1 parent 9c07dfe commit c77c6a9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions packages/typescript/lib/quickstart/runTsc.ts
Expand Up @@ -4,17 +4,13 @@ import type { LanguagePlugin } from '@volar/language-core';

export let getLanguagePlugins: (ts: typeof import('typescript'), options: ts.CreateProgramOptions) => LanguagePlugin[] = () => [];

export let getLanguageId: (fileName: string) => string = () => 'ts';

export function runTsc(
tscPath: string,
extensions: string[],
_getLanguagePlugins: typeof getLanguagePlugins,
_getLanguageId: typeof getLanguageId,
) {

getLanguagePlugins = _getLanguagePlugins;
getLanguageId = _getLanguageId;

const proxyApiPath = require.resolve('../node/proxyCreateProgram');
const readFileSync = fs.readFileSync;
Expand All @@ -36,7 +32,6 @@ export function runTsc(
`new Proxy({}, { get(_target, p, _receiver) { return eval(p); } } )`,
`_createProgram`,
`require(${JSON.stringify(__filename)}).getLanguagePlugins`,
`require(${JSON.stringify(__filename)}).getLanguageId`,
].join(', ')
+ `);\n`
+ s.replace('createProgram', '_createProgram')
Expand Down

0 comments on commit c77c6a9

Please sign in to comment.