-
-
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
Formatting fails after diff #694
Comments
is this only for the current file or does it also stops working in other files? .js or other .vue files? |
@cannap Only on the current file (any file type .js / .vue / .styl), i.e. if you diff a file and then continue working on that file, formatting and autocomplete and emmet and other features do not work until you restart VSCode (or disable/enable vetur) which is really frustrating as you can imagine. I am surprised nobody else has reported this. I don't dare to diff because of this issue and I am ocd about code formatting. |
@cannap I cannot repro it on macOS. I'll try Windows. |
OK I looked closer. We do not have range formatter. You can only format whole file. |
@octref What does that mean ? Maybe there is a misunderstanding. Just because DIFF is opened upon checking in a file, it should not break the formatter after DIFF is closed and I continue working on that file. I have to close VSCode. Restart it. Start my webpack dev server and all that takes few minutes every time I want to diff and see what I've coded ? And why do you close bugs so nonchalantly as if it is not a bug. Just curious. (new to open source/github) |
Oh sorry, I thought you were trying to format that selection (which Vetur does not support). It seems you were formatting the whole document indeed. However I cannot reproduce this issue on either macOS or Windows. Does this repro on https://github.com/octref/veturpack? |
And are you using anything like |
The original bug seems to be about formatter not working in diff editor. This seems to have been solved in latest version of VS Code. |
The original bug is that any time the Compare module is used (the diff), all formatting stops working inside and post using the Compare in a regular Editor window. See GIF, I am pressing CTRL S and also tried formatting using the right-click menu. Using vscode on windows 64bit version: 1.25.1 (no updates available) and it is not fixed. |
Hmm...Here is what i have. |
The bug does not reproduce meaning I have the same exact behavior as your GIF above IF AND ONLY IF I use git like you. My environment is corporate with TFS 2017 (TFVC). I copied my project's source code to a new location and init-ed a git for it. Made changes in each of the workspaces (git and tfvc) and when using git, formatting kept working in a diff. I made sure that I made the Workspace VSCode settings was at bare minimum
It is really hard to tell where exactly this fails but this narrows it down a lot. P.S. @cannap this bug I am reporting and still seeing only applies to .vue files maybe in older versions of vscode it didn't work across the board so I am sorry for that confusion. NOTE: It is NOT just during the DIFF that formatting does not work, but ever since a diff until I kill the instance of vscode, formatting does not work. Here is my full set of settings I usually employ in my projects and they don't affect anything - bug or issue exists regardless:
|
@onelifenyc I think that might be a problem between TFVC and VS Code's formatting engine. So, in short, your problem is that if you are using TFVC and have made changes to a file, formatting stops working — correct? Is it only for external formatters (like those provided in an extension), or do they apply to VS Code's own formatters too (html, css)? I suggest opening an issue at https://github.com/microsoft/vscode. Also it would be great if you can try installing another formatter like Prettier and try formatting a file, to make sure this is a bug for all external formatters. |
Hi - The issue as I stated is only with .vue files IN and AFTER a DIFF which is what one does before checking in. JS files can be formatted in a diff and after without an issue and so can my .styl files. That is why I filed the issue here because it is specific to .vue files and/or vetur as the default extension I use for VueJS. I did install the one you suggested but what do I need to turn off and where. Seems to be a lot of formatters in play:
so what to disable and edit in settings to be able to have a good test with the and I need entire .vue file formatted not the js or stylus or vue-html/html? |
OK. So that's not a VS Code issue. Can you do a failed format and see if there's any output from Help -> Toggle Developer Tools? |
Basically I have labeled the screenshots as I reproduce the issue: 0 - on startup, there is a TFVC issue but I don't think it is related. I will have to open an issue with them. The result of that error is that it does not show my pending changes in the source control tab of vscode until I do a refresh. It started breaking recently. 1, 2 - open file, format works, close file. 3, 4 - open diff from source control tab, right click - format document, also CTRL+S, etc. made more changes, no formatting. close the file, opened it in regular edit window, tried formatting, not working. full log : |
Thanks for the info! This helps a lot with isolating the issue. Can you run Also, if you disable all other extensions but Vetur, does this happen? |
I will try tomorrow. Thanks. |
Also, the grammar issue might have already been fixed in Insider version: https://code.visualstudio.com/insiders/, which is scheduled to release next week. |
This issue still exists! With the latest version of vscode for windows 1.28.2, the moment I open a diff (new behavior, hence this comment):
When I try to "Format Document" this message comes up:
Log and Screenshot of Dev Tools attached |
The problem seems to be that TFVC opens the diff editor with a non-local, read-only resource: https://github.com/microsoft/azure-repos-vscode/blob/b4494021aac42a2542385d981258cfa28d08f9d2/src/tfvc/scm/resource.ts Which I can't edit (send format result to). You should open an issue for them. |
Info
Opening an issue from discussion in #561
Workspace Settings:
Problem
Output -> Vue Language Server
BEFORE DIFFING
AFTER DIFFING (BUG)
Reproducible Case
See GIFs
emmet expansions also do not work.
The text was updated successfully, but these errors were encountered: