Skip to content

refactor(language-core): remove fileName property for VirtualFile#124

Merged
johnsoncodehk merged 11 commits intomasterfrom
removeFileName
Jan 17, 2024
Merged

refactor(language-core): remove fileName property for VirtualFile#124
johnsoncodehk merged 11 commits intomasterfrom
removeFileName

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
42 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
@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.

1 participant