VS Code issues on save - visual-studio-code

This problem is very weird to describe...
Sometimes null characters are added to the end of the open document.
Other times lines are deleted from the end of the document.
I feel like these must be related in a way.
I cannot reliably reproduce the error. But it seems to be connected to when I save the document since it happens much more frequently when autosave is enabled.
Installed extensions are:
Python,
Jupyter,
GithubCopilot,
R
The problem appears as soon as the jupyter extension is enabled.
The funny thing is I have the exact same setup on my desktop with absolutely no problems.
I tried removing visual studio code and the files created in the following folders:
%APPDATA%\Code and %USERPROFILE%.vscode - along with the other extension files like .jupyter.
Reinstalled everything.
Same problem.

You may install the Prettier extension. Prettier would suggest you add a blank line at the end of files so it may prevent cutting the final line in your saved files. I usually use this method.
You can find it on VS Code Marketplace or the documentation.

Related

VS Code shows multiple copies of the same file when browsing

I keep having this problem that VS Code is showing me multiple copies of the same file in my recently opened section. And I don't know how to get rid of this again 🙃
I've tried enabling workbench.editor.revealIfOpen to no effect.
Any inputs on how to only show one copy of the same file in recently opened?
Turns out this was because the extra copies where opened with a wrong path, it had ./ as a prefix. And vscode treats these as unique copies. It's been fixed for the ReScript extension in this pull request.

How do I turn off "Contains emphasized items" in Visual Studio code?

I need to figure out how to turn off emphasized items in Visual Studio Code
This might sound like a strange requirement, but in my workflow vscode functions as less an IDE than a cross-platform ViM-esque frontend with lots of remote development tools built-in.
Due to this use case, I don't need or want the linting features to show up in the file browser. How might I accomplish this?
Attempts to solve the problem
I've run out of search terms here and cannot find an answer.
Searches including terms in this question's title yielded little
SO-specific search queries also yielded little
This seems to be somewhat related, at least as a representation of the "feature" I'm referencing: VS code containes emphasized items but no error
VSCode "preferences" do not appear to show what I'm looking for, likely an issue with me not searching for the right variable name.
In my experience with VSCode it has been wonderfully customize-able, so I'm guessing there's a setting somewhere ready to be modified to accomplish this. Any help much appreciated, thanks!
My use case was a bit different: after viewing some files in a git submodule those files became linted, and errors and warnings cluttered up my VS Code Explorer file browser window on files I had no intention of ever handling. I basically wanted a way to clear out those lint warnings, and found it here. The solution is to reload the window:
CtrlShiftP on Windows/Linux, ⌘ShiftP on Mac -- then select "Developer: Reload Window"
One by-product of reloading the window is that it clears out those unwanted warnings (at least until the next time I visit the file). It also has the effect of clearing out warnings on files that I would normally want to see, of course, but chances are I'll be visiting those files again soon, so it's fine. Not a perfect solution, but it works for me and my use-case; hopefully it can help others.
I don't know how to turn it off, but I had this on multiple folders and I fixed it by renaming the folder to a random name, then naming it back to the name it was before and the error would go away.
If you have this issuse then uninstall extention then CtrlShiftP on Windows/Linux, ⌘ShiftP on Mac -- then select "Developer: Reload Window" then type developer: relode page this issuse automatically resovle
i have this issuse then i uninstall extension then this issuse resolve.
I was able to permanently prevent this by adding the files to the .gitignore file. It seems that this happens in a cloned repository when you add new files.

TSlint lists Problems in VSCode for Git Diff files

My Problem
When I compare two versions of a file with VS Code and the built-in Git features TSLint does not ignore the revisions but marks the errors. Since the diff files are located in AppData\Local\Temp on Windows the path checking fails and other things as well.
However, most annoying is not the red line in the file view but that they are listed in the Problem Panel and I get like 20+ problems just because opening one file revision and they won't go away until I reopen VS Code, so they add up during time.
That makes the panel useless for me, since I see lots of pseudo-problems, I won't notice an actual problem.
What I tried
I tried in my settings.json
"tslint.exclude": ["**/AppData/**"]
but that didn't work out.
Any suggestions would be much appreciated.
Well, it appears that this is an issue with the GitLens extension which will be fixed with the upcoming version:
this issue has been fixed in the GitLens 9 release which will be coming very soon.
~ eamodio
(Source: https://github.com/eamodio/vscode-gitlens/issues/430#issuecomment-440731347)

VS Code - changing tab disables extensions. What am I doing wrong?

Using Visual Studio Code I have installed a few extensions (like Guidelines showing vertical dotted lines between pairs of matching brackets). When I start VS Code I can see all my extensions working fine in the Editor window.
However, when I switch to another tab within VS Code, I no longer see the Guidelines or evidence of any extension working in the new editor tab. Worst of all, when I then switch back to my original tab, all the guidelines etc that were there a few seconds ago are gone!
To fix the issue I have to restart VS Code. This can't be right! Has anyone hit the same problem?
I have tried uninstalling VS Code where it warns me some components could not be uninstalled and I have to do them manually. It doesn't tell me which. When I then reinstall, the extensions are visible (without me reinstalling them) but again I hit the same issues as above.
Please help?
Seems like having too many extensions installed, or perhaps one that is misbehaving behind the scenes, causes this problem. Reduce the number of installed extensions. Use Help->Developer Tools -> Console to see if there are any messages relating to the Extensions server

jekyll won't process markdown even with non-BOM files

I'm trying to set up a simple blog on via Visual Studio and Jekyll but Jekyll can't seem to parse markdown for my posts correctly. Here's the result for my file as is.
Notice that per Visual Studio, this currently is saved with BOM but still builds.
I'm aware that files need to have NO BOM (Byte Order Marker) so I've tried saving it without it but still can't get any results. Anyone have any ideas?
EDIT: Here's backtrace output per comments:
EDIT2: I've tried all the possible line endings available and still can't seem to get anything going. Per #Waylan 's comments I looked into issue #3304 but it seems it isn't fully resolved. Check out this issue if you'd like to add any comments
Seems this was occurring because I was adding via Visual Studio.
You must add the files as a regular text file in Windows Explorer - then you'll be able to edit them in Visual Studio as you like.
Hopefully we'll get support for this in later version of Jekyll or Visual Studio will change whatever it is that's causing the issue. I've made note of the issue with Jekyll already here though if anyone would like to add on to it