Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(tsc): rework based on first-party TS API #3795

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

johnsoncodehk
Copy link
Member

  • vue-tsc core code is re-implemented based on createProgram API
  • Instead of additionally importing typescript, capture the typescript method from the tsc.js context:
    var ts = new Proxy({}, { get(_target, p, _receiver) {return eval(p); } } )
  • Language-agnostic parts have been moved to @volar/typescript feat(typescript): add preset implementations volarjs/volar.js#108
  • vue-tsc is consistent with the typescript plugin. It no longer distinguishes between .vue and .vue.ts file names. Instead, it uses the .vue file name uniformly, but provides the content of .vue.ts. This should resolve perf(tsc): support vue files with project reference delcaration #3751
  • The tsc context is missing some typescript methods, and language-core needs to avoid using the missing methods:
    • node.forEachChild -> ts.forEachChild(node, ...
    • node.text -> sourceFile.text.substring(...)
    • sourceFile.getChildCount() -> ast.statements.length
    • node.getStart() -> ts.getTokenPosOfNode(node, sourceFile)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant