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(language-core): remove fileName property for VirtualFile #124

Merged
merged 11 commits into from
Jan 17, 2024

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Jan 9, 2024

Motivation

fileName is a concept specific to TypeScript, it should not be part of the dependencies of virtual code.

Changes

  • The VirtualFile interface has been renamed to VirtualCode.
  • There is no longer a VirtualFile.typescript property, now you need to return the virtual code for the TypeScript LanguageService through LanguagePlugin.typescript.getScript().
  • It is no longer allowed to generate multiple virtual ts files for a single file.
  • ServiceEnvironment.fileNameToUri, ServiceEnvironment.uriToFileName have been moved to ServiceEnvironment.typescript.fileNameToUri, ServiceEnvironment.typescript.uriToFileName.
  • The uri specific to virtual code is now [source_file_uri]?virtualCodeId=[virtual_code_id]. For example: file:///GitHub/volar-starter/src/App.vue?virtualCodeId=script

For actual changes, you can refer to: volarjs/starter@403a3d3

@johnsoncodehk johnsoncodehk marked this pull request as ready for review January 17, 2024 03:47
@johnsoncodehk johnsoncodehk mentioned this pull request Jan 17, 2024
41 tasks
johnsoncodehk added a commit to volarjs/starter that referenced this pull request Jan 17, 2024
@johnsoncodehk johnsoncodehk merged commit 9497afc into master Jan 17, 2024
6 checks passed
@johnsoncodehk johnsoncodehk deleted the removeFileName branch January 17, 2024 06:27
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.

None yet

1 participant