-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Refactoring in VS Code destroys and/or falsifies .vue file! #1273
Comments
I keep getting this prompt but don't know why.
|
@yoyo837 Please check here. |
It may be related to the plugin Sync feature of |
Also keep getting |
See #1273 (comment). I fixed it. If the Sync feature of |
could you elaborate, not sure what steps to take |
I mean https://code.visualstudio.com/docs/editor/settings-sync.
|
Check |
Off topic:@YoRolling's solution worked for me to get rid of the warning pop-up, because the problem was workspace-related. The other solutions didn't work. On topic:Perhaps related: While renaming a .ts file itself, I clicked the "Show Preview" button in the message box that appeared. When clicking one of the change lines with checkboxes, no matter whether for a .ts or a .vue file, the following was shown in the refactor-preview tab: After clicking the "Discard" button (instead of "Apply"), irritatingly I got another message box:
|
This is a very serious bug! It may also change logic without the developer noticing.
I tried to write specific steps for reproduction and at first the bug was reproducible. But as I went, the bug disappeared and I couldn't understand why.
I had a file
MyComposable.ts
with code like this:...and a file
MyComponent.vue
that used the composable:When I refactored
foo
fromtype MyComposable
inMyComposable.ts
by renaming it with F2, the spots inMyComponent.vue
where the new name was inserted were wrong, they were shifted into different lines, between unrelatedif
and comment parts! When I removed the empty line inMyComponent.vue
between-->
and<!--
at the time the bug didn't yet disappear, the inserting spots were influenced (shifted differently). At some point, the problem also happened when I renamedmyComposable
fromMyComponent.vue
.Then, I did some things like duplicating
MyComposable.vue
into a new fileFoo.vue
. In that file, a new bug happened where renaming didn't work at all and VS Code told me with a little bottom-right error pop-up: "Rename failed to apply edits". I don't exactly remember how it all took place exactly, but I also deletedFoo.vue
in VS Code, closed VS Code, renamedMyComposable.vue
toFoo.vue
and reopened VS Code. Then, VS Code told me with a bottom-right warning pop-up: "The 2 extension(s) below, in workspace recommendations have issues: johnsoncodehk.volar (not found in marketplace) johnsoncodehk.vscode-typescript-vue-plugin (not found in marketplace)". The still opened tab ofMyComposable.vue
didn't show code in my monospace font, but a little message in a proportional sans-serif font; I think it said that the file didn't exist anymore. When I openedFoo.vue
, renaming also always failed with the message: "Rename failed to apply edits".Then, the bug disappeared and the warning pop-up is now shown on every start of VS Code. The bug also wasn't reproducible anymore when going back in the bug test repository to earlier commits where the bug previously happened, also not after a fresh VS Code start with the earlier commit.
A third bug that happened some time in between the previously described actions was that I began to first mention the composable function
useMyComposable()
, clicked the light bulb icon and chose to add an import for it; but the import was added in an XML comment (between<!--
and-->
). I could do this multiple times and every time an additional import line was added in the comment.The text was updated successfully, but these errors were encountered: