-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Update import on file rename #2651
Conversation
so that unopened file can also be checked
I see a new confirm UI in 1.53 insider. I think I can remove the custom confirmation. And we can wait until that was released and use the official confirmation instead. |
vscode 1.53 add confirmation for rename file so change annotation works on will rename
Hey, I'm really looking forward, but never touched development of VSCode plugins. If it's helpful for you, could you tell me how to test this? Again, thank you for this missing feature :-) |
You can check out my branch and follow the doc here. |
I'm so sorry about no immediate feedback provided. I always thought there would be a conflict with VSCode typescript integration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help.
Finally got the time to try it out. It works! I can't wait for the official release :-) |
vscode 1.53 would always ask confirmation and provide option for preview
About this maybe we can filter out all the edits to js and ts files? |
I've checked out the latest commit and might be doing sth. wrong, but it's not working anymore:
|
btw, is there any way to stop the operation so that the file does not get moved? |
I can't reproduce this. Is it not working at all? or it's only in a specific situation? Also, I have pulled the latest commits of the master branch to resolve the merging conflict. You'll have to run yarn again.
The confirm windows of vscode 1.53 have a skip option. it would skip all the edits. And you can undo rename file like a normal undo(Ctrl+Z). |
If both renamed file and updating file are not vue file, let typescript extension handle it.
If the test is not a problem, perhaps we can observe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, If no any question, I will merge it.
no longer needed to redirect to new file because this is run before actual file rename
391a58a
to
272085e
Compare
|
we can't use getSourceDoc here. It doesn't have the info we need.
? getUserPreferences(updateCurrentVueTextDocument(sourceFileToSourceDoc(oldPath, sourceFile)).scriptDoc) | ||
: getUserPreferencesByLanguageId(oldPath.endsWith('.js') ? 'javascript' : 'typescript'); | ||
const preferences = getUserPreferencesByLanguageId( | ||
(sourceFile as any).scriptKind === tsModule.ScriptKind.JS ? 'javascript' : 'typescript' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use sourceFileToSourceDoc
or getSourceDoc
here. It would treat the script content as a vue file. Thus it would get a default script content instead. It only works sometimes because of the caching.
I was hesitant about whether to use this typescript internal API or expose another getScriptKind
function from serviceHost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing you mean getLanguageModelCache
......
I also want to remove this cache.
I think we can keep the way you write for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasonlyu123 If you don't have any problem, I will release it in new version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
related to #820
have to introduce some new API to
IScriptHost
andProjectService
because the request is not similar to the existing features.Haven't done the integration test Because I end up using theapplyEdit
request. I can't find a set of vscode API that can be used to test it. Maybe we can just test it in the server test?Looking forward to feedbacks if anyone can found some strange behavior.