How to change Intellisense priority in Visual Studio Code - visual-studio-code

How do I change the priority of the abbreviation recommendations inside Visual Studio Code? The file in question is a .scss file and I have tried with and without the Sass extension in Code installed. As far as I can tell currently it just lists them out in an alphabetical order. Is there any way to change this? I am genuinely surprised about how many people praise this editor when it has such huge flaws, that to my knowledge aren't solved yet.
https://github.com/Microsoft/vscode/issues/26127 says to "Disable the quick suggestions altogether" ?!

In VS Code 1.16 (the current insiders build) you can force emmet suggestions to the top by setting:
"editor.snippetSuggestions": "top",
"emmet.showSuggestionsAsSnippets": true

Related

Set Intellisense Hints to English in VSCode?

I've downloaded VSCode in German and I've set the display language to English as described here. However, the hints for Intellisense are still in German, which is not great for debugging and understanding suggestions/mistakes, since the breadth of information online on programming related issues is in English. I found this SO question that discusses how to do it in VS, but that is over 10 years old and I don't even have the "Tools" tab in VSCode.
How to set UI language in English and IntelliSense hint Language in another language in Visual Studio 2012 ?
I also tried to search for a setting by pressing "Ctrl+," using different keywords, but all I got was highlighting toggles for Intellisense that control highlighting for different code fragments. Using "Ctrl+Shift+P" and searching for "Intellisense" etc. didn't help either.
I really do not want to deinstall VSCode and reinstall it using an English installer just so I can fix this problem, especially since I'm only using VSCode to program C++ for Unreal Engine to begin with and whenever you change something slightly Unreal likes to break things in a fit of capriciousness.
Is there a straightforward way to fix this? Here's an image of what the Intellisense hints look like. I'd love it if they were in English.
To change the language of the Itellisense you should go to the Visual Studio Installer, modify the current installation, then go to "Language Packs" section of the installer and select English. After installing the language pack go inside the IDE: Tools -> Options -> Environment -> International Settings , select English and save changes.
For further details take a look at this link
Ok, so I wasn't able to set any options for this and the only thing that worked was going to a download page of an English installer and running that. I essentially updated my 1.7.3 version of VSCode to a 1.7.4 version using an English installer instead of a German one and that fixed the issue...
Is this stupid or am I stupid?

How can I make Visual Studio Code's auto-complete suggestions appear more quickly?

I have more than sufficient resources free:
but Visual Studio Code is taking several seconds to show an auto-completion list, even when I have typed 80% of what is to be completed.
How can I make Visual Studio Code's auto-complete suggestions appear more quickly?
It is possible that you have some VS code's extension enabled that is slowing down your system.
To check if that's the case open Command Palette (Ctrl+shift+p) and type "Disable all installed extensions".
Check if the experience is faster and more responsive now. If that's the case now you need to find the extension that is slowing you, for doing so follow these steps:
open Command Palette (Ctrl+shift+p) and type "Show Installed Extensions", now from the list you will have to spend some time activating and deactivating extensions until you find the one causing the troubles.
NOTE: You can show suggestions at any time pressing Ctrl+space and Ctrl+shift+space, so you can try forcing it when it's not showing.
An out of blue suggestion, but you can try light weight editors like Sublime text 3. The response time in auto-complete there is one of the best I have ever seen.

How to keep code-folding on save in Visual studio code

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"

VSCode Intellisense

I am typically used to period bringing up intellisense options. When writing a C# file in VSCode, I see intellisense as I type, but disappear upon completion. It does not provide any follow up suggestions, unlike Visual Studio. Is this just me? Did I break something? I've tried uninstalling and re-installing, and removing all but the C# extension, but nothing seems to help.

How do I auto-indent Python code in Visual Studio Code?

I'm using Visual Studio Code (not Visual Studio) on Linux and I can't seem to find out how to turn on auto-indentation for Python. I've looked all over preferences, spent some time on Google, and can't find anything.
Does anyone know how to do this?
In VS Code you can set the indentation in several places :
General/Workspace settings (bottom bar),
User settings,
language formatter settings.
When using Python, no matter what settings you set, all of them are overridden by the autopep8Args value of the autopep8 language formatter setting, which has an indent size of 4.
By default, autopep8 is used as VS Code Python formatter, but there are others, like yapf.
To update the indent size of this formatter, search in your user settings the "python.formatting.autopep8Args" and set it to : ["--indent-size=2"],
"python.formatting.autopep8Args": ["--indent-size=2"],
Visual Studio Code doesn't have much support for Python (yet), aside from syntax-highlighting, and per-file intellisense (meaning it'll provide suggestions for symbols that have been found within the current file).
I'm willing to bet that the Visual Studio Code team will, eventually, increase their support for Python within Visual Studio Code, and with this, they'll likely add support for auto-indentation.
In the meantime, it might be worth trying this Visual Studio Code extension, which aims to add better support for Python, into Visual Studio Code.
The extension does add auto-indentation for Python, to Visual Studio Code, along with many other features.
Happy scripting!
I auto-format python with autopep8, vscode can use it. It can be easily configured for tab-size and other stuff creating the config file: $HOME/.config/pep8
Here an example of that file:
[pep8]
indent-size = 2
max-line-length = 100