Why does my cursor jump to the last line of code when I create new tags? For example, when I type a comment in HTML, as soon as I type the !, it jumps to the bottom. What setting do I have to change to prevent this from happening? It is very annoying. I am just starting to use VS Code so sorry if this is a really simple fix.
I had a similar issue. The Flow Language Support extension was causing it. I disabled it, and then the issue was gone.
I had the same issue when I first started using vscode.
Explanation
Generally, the issue is caused by an extension of some sort that is messing with your IDE. Like the extension is trying to do its job but either there is a conflict with other extensions or vscode settings or that's how it works.
More specifically, I found the issue was caused by the the HTML, CSS, JS formatter extension.
Solution
If you have that extension, try disabling it and restart vscode. if the issue is fixed then you may leave it disabled or uninstall it. If it is not solved repeat the process with other extensions, especially those that format your code, until you find the culprit and remove it.
Also i got this type of issue.The solution is just disable your auto save it will work.
If you're an Angular developer, maybe consider disabling Angular Essentials Extension by "John Papa". Then restart VS Code.
That worked for me after several frustrations.
Related
If this is due to an extension, how can I remove that extension?
It overwrites my custom snippet, which bothers me.
I disabled many extensions, but nothing changed.
What you're seeing in your screenshot (suggestions for dba_<etc.>) are not coming from any extension. One can verify that by running the command Developer: Reload With Extensions Disabled and trying triggering suggestions again. So this is just functionality that comes out-of-box with a standard VS Code installation. You don't even need to install any PHP extension to get this.
As for your custom snippets getting "overwritten", it's hard to tell without more detail why this is happening. If you're on version 1.75, it might just be due to a bug that will be fixed later (Ex. As was the case in this other recent Q&A: Visual Studio Code's recent update is disrupting autocompletion).
As #Mark showed in their answer, these are function suggestions. You can disable function suggestions with the following setting:
"[php]": {
"editor.suggest.showFunctions": false
}
Those icons indicate that those are Methods and Functions (not Snippets). See What do the Intellisense icons mean.
So you can try to disable two settings in your Settings UI:
Editor > Suggest: Show Methods
Editor > Suggest: Show Functions - this looks like the right one to disable
Of course, there might be situations where you want to see Function suggestions, so you will have to see if disabling the setting is acceptable.
You can disable those Function suggestions for php files only with this setting (in your settings.json):
"[php]": {
"editor.suggest.showFunctions": false
}
While writing Python code on VS Code, it is showing suggestions like:
windll Windows only: Creates ()
I have tried to see if this was coming from snippet extension I might have installed but I don't think I have any... can anyone shine a light on why I am getting his code completion nonsense?
I had this same issue, every time :, ., def, or if is typed, there's annoying suggestions that don't make sense. I found out it's the Python Extended extension that's responsible for this. It seems to be reported on it's GitHub issues page, but for now I would disable the extension as it doesn't seem to be working at all for me. I recommend PyLance as a replacement.
It's the extension problem.
You have installed the extension named: Python Extended inside your vs code and you will need to uninstall it.
It works well on my editor after uninstalling this extension.
Emmet Abbreviations are not working for me in VS Code. I looked up solutions, and added "emmet.triggerExpansionOnTab": true to my settings.json file.
When I added it, every time I pressed tab to indent it says "command 'emmet.expandAbbreviation' not found".
It stops showing that once I remove the line.
Additionally, there is no syntax coloring or suggestions in HTML files. I tried to fix it by adding "files.associations": {"*.html": "html"} but that didn't work either.
Does anyone know how to fix this?
I had this issue too, but I simply restarted VS Code and that actually solved the problem!
I had the same issue as well and could not find much help.. but what fixed it for me was using a previous version.. so something with the never version might not work with my settings I guess (and some them I can't change like my Mac OS..;-).. as my mac is 2015 edition).. Anyways if you are still having this issue.. this link is what worked for me..
https://code.visualstudio.com/updates/v1_55
Download an earlier version and you should be fine...
I simply commented out "emmet.triggerExpansionOnTab": true then it started working.
After trying a lot of different things (including re-installing vscode) I got desperate, disabled all of my extensions, reloaded vscode, and then reinstalled my key extensions. I didn't figure out which extension may have been causing the problem, but that did get it working again.
I solved it by re-enabling the emmet extension again. Not sure when it has been disabled.
Open the built-in extensions explorer (direct command: Extensions: Show Built-in Extensions), scroll down to find the emmet extension. For me it was disabled, and I had to open the context menu and click Enabled.
I recently encountered this problem after a VS Code update. I searched for disabled extensions and saw that, to my surprise, some 2/3 of my extensions have been disabled. I manually enabled one which seems to have triggered something because within seconds all these extensions (except those I actually had disabled some time ago) were live again.
I am working on some fairly large files in Visual Studio code and to save time I fold away functions and scopes, that I do not want to see. Everytime I save, which I do fairly often just out of habit, all the folds expand again and the current position on screen changes.
Since the only settings I could find were:
"editor.folding": true,
"editor.showFoldingControls": "mouseover",
the question is: How can I keep my folds upon saving?
Thank you for bringing up the extensions Mark. It was indeed an extension: lonefy.vscode-js-css-html-formatter.
Once this was disabled, the folding kept its state after saving.
For me it was the prettier plugin :(
Here is the closed issue: https://github.com/prettier/prettier-vscode/issues/408.
At the moment, there doesn't seem to be a fix.
For anyone that comes across this like me, I didn't have prettier, sort-imports, or lonefy. I was able to resolve by updating the 'folding strategy' setting from 'auto' to 'indentation' and it kept my folds persistent through saving and particularly in my case deploying code using the Salesforce CLI extension.
https://code.visualstudio.com/api/language-extensions/language-configuration-guide#folding
Had the same issue and it turned out to be the sort-imports extension. Removing it fixed the issue.
For future reference, I found this in the settings and it fixes the problem for prettier.
"editor.formatOnSaveMode": "modificationsIfAvailable"
I recently used VS code for Wordpress development but I encountered a weird bug when I comment with (ctrl+/) to an html element. Instead of commenting (<!-- -->) it uses (//) for my html code? Has anybody experience this? Do you know of any solutions to change the comment to the correct html comment?
This is caused by VS Code improperly auto-detected programming language - in the lower right corner of your GIF you can clearly see, that VS Code is set to HTML. Click on that button, and switch over to JavaScript (React) and problem should be solved.
I had the same exact problem. But in the end, I discovered I had an extension which was interfering with the HTML commenting. So I had to disable all extensions and restart VS Code to get back to my usual commenting back again.
Then I did a trial-and-error check (enabling one extension at a time and then reload) to find out the faulty extension which I later uninstalled. Try disabling all your extensions to see if it helps you.
In case it helps anyone else, it was the Go extension that changed all my comment characters to {#.
HTH
For future searchers, this happened to me in a different way: I was getting HTML comments inside a script tag, instead of JavaScript comments.
I disabled the TWIG pack extension and it went back to the expected behavior!
In my case it was the Sublime Babel extension that changed the comment code to // in HTML mode. Downgrading Sublime Babel from 0.2.10 to 0.2.9 solved the issue.
In my case I was getting html comments inside script tag, instead of Javascript tag.
I uninstalled Jinja extension and everything went back to normal.