docs(vue-ts): update note on vue type support in ts#6165
Merged
Conversation
Shinigami92
previously approved these changes
Dec 18, 2021
Contributor
Author
|
updated it because there is no need to explicitly enable take over mode which simplifies it a little |
Shinigami92
previously approved these changes
Dec 18, 2021
jeffydc
reviewed
Dec 20, 2021
Contributor
jeffydc
left a comment
There was a problem hiding this comment.
Should we add a link to vuejs/language-tools#471 ?
| Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette. | ||
| Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps: | ||
|
|
||
| 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette, look for `TypeScript and JavaScript Language Features`, then right click and disable for the workspace. By default, Take Over mode will enable itself if the default TypeScript extension is disabled. |
Contributor
There was a problem hiding this comment.
To match with Volar docs
Suggested change
| 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette, look for `TypeScript and JavaScript Language Features`, then right click and disable for the workspace. By default, Take Over mode will enable itself if the default TypeScript extension is disabled. | |
| 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled. |
Contributor
Author
There was a problem hiding this comment.
it is clearer this way
| Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps: | ||
|
|
||
| 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette, look for `TypeScript and JavaScript Language Features`, then right click and disable for the workspace. By default, Take Over mode will enable itself if the default TypeScript extension is disabled. | ||
| 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette |
Contributor
There was a problem hiding this comment.
Suggested change
| 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette | |
| 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. |
jeffydc
previously approved these changes
Dec 28, 2021
volar changed from using ts plugin to take over mode, as documented here: vuejs/language-tools#471
johnsoncodehk
approved these changes
Mar 13, 2022
patak-cat
approved these changes
Mar 13, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
volar changed from using ts plugin to take over mode, as documented here: vuejs/language-tools#471
Description
updates documentation on how to get better type support for
.vuefiles in vscode when using the vue-ts templateAdditional context
volar updated their way of providing type support for vue templates to use take over mode, as documented here: vuejs/language-tools#471. they have had this since version 0.27.17, which was probably released around 3 months ago looking at the tags on their repository
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).