You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(language-service): skip .value auto insert outside script blocks - #6274
Template interpolations are generated into the same script_ virtual code as <script setup>, so the dotValue plugin ran for them too. The script block loop only skipped the shouldSkip check when the offset was outside every block, and then still went on to isRefAtPosition, which now sees a ref there. This returns early when the source offset is not inside <script> or <script setup>.
Thank you for looking into #6272. It is fixed by #6402, so I am closing this one.
This pull request stops the .value auto insert for the whole template. That removes the wrong insert for a top-level ref, but also the right one for refs the template does not unwrap. With this branch built, both of these no longer get .value (3.3.11 inserted it):
The cause was one level down: since #6184 the template reads a setup binding as __VLS_unwrap(x) or x.value, and the check still asked for the type of the identifier x alone, which is the Ref. #6402 asks for the type of the generated read, which gives the three cases their right answers; they are in its tests.
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
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.
Fixes #6272
Template interpolations are generated into the same
script_virtual code as<script setup>, so the dotValue plugin ran for them too. The script block loop only skipped theshouldSkipcheck when the offset was outside every block, and then still went on toisRefAtPosition, which now sees a ref there. This returns early when the source offset is not inside<script>or<script setup>.