I am usin vscode to work on my scss. Whenever I format my code with Beautify css/sass/scss/less v2.3.3 by michelemelluso, I get a linebreak before each comma in the fromatted code. What line do I have to write into the beautify.options of the extension to avoid that?
Related
Is it possible to format all of the code in Visual Studio Code to my specific prefrences.
I want the formatter to leave a space before any brackets and go onto a new line before and after any curly braces.
I do not want the formatter to format the code in any other way. I only want to format the code in these two ways.
This format should be applied automatically to any code I write after I hit save.
I have looked online and found the Prettier extension. Hovewer, this extension also formats the code in many other ways. I only want the code formatter to leave a space before any brackets and go onto a new line before and after any curly braces.
I want visual studio code to suggest an autocompletion for an entire line if I start typing the first few characters of any line already in the file, regardless of the content of the existing line. So if this is the content of my file:
this is a line with whitespace
this,is,a,comma,separated,list
And I type this on a new line, I would get a pop-up like any other autocomplete suggestion and I could fill in either of the lines above. How can I do this (and if I can't, is there another editor that has this ability)?
The extension Line Completion does what you want.
You have to configure for which files (language identifiers) it should perform these suggestions. (To prevent to much calculation on large files where you don't use it. See the README page.
I am coding HTML & CSS in VS Code IDE. I have installed & enabled the prettier extension for better readability of the code & auto-indentation. but my content of tags is not going beyond that certain point on the screen & it is getting added to the next line whenever I save my code by Ctrl +S (example: see the last paragraph tag). How to get that content on the same line?
You shouldn't use Prettier if you don't need this behavior. That's what Prettier does: splits lines that are too long. See here https://prettier.io/docs/en/index.html
For whatever reason, VSCode is copying non-breaking spaces, when I copy/paste code with syntax highlighting. This is no problem as long as I work inside VSCode, but it's a nightmare when copy/pasting stuff in and out of VSCode.
I'm using MSWord with the "hidden characters" feature activated as an easy means to understand what is happening. I can reproduce it like this:
Create a new file (no extension, not saved) in VSCode, type some text, select
all and copy/paste in MSWord -> spaces are normal U+0020 spaces,
NO syntax highlighting was copied.
Save the file as a ".txt" file, select all and copy/paste in MSWord -> spaces are normal U+0020 spaces, NO syntax highlighting was copied.
Save as a python file ".py" (or Markdown, or HTML...), select all and copy/paste in MSWord -> spaces are non-breaking-spaces U+00A0 spaces, syntax highlighting was copied.
Save as a text file ".txt", select all and copy/paste in MSWord -> spaces are non-breaking-spaces U+00A0 spaces, syntax highlighting was copied.
Since a picture is better than 1000 words, here's the output from MSWord:
Any idea?
It seems that VSCode copy styled or unstyled content into the clipboard depending on the context. That may cause trouble when pasting into some kind of rich text editor.
In the settings JSON file add editor.copyWithSyntaxHighlighting set to false in order to disable this behaviour for good.
Note that there is still a separate command Copy With Syntax Highlighting in the pallete which you can bind to some other keys in case you need it. This one does not affected by the option above.
Refer to this PR https://github.com/microsoft/vscode/pull/54155
The first syntax highlighting is of VS Code and the second one is of Sublime Text. I searched for extensions but I couldn't find anything which could detect SQL commands like CREATE TABLE and highlight them or suggest them as I start typing.
Sublime Text and Atom have this feature by default, but I can't get it to work in VS Code.
I am working with .py files so the syntax highlighting works only for Python commands and the whole text (inside quotes) is treated as string in VS Code.
Is there any fix to get syntax highlighting like Sublime Text / Atom in VS Code when working with SQL syntax in .py files or highlighting commands even if it's inside quotes ("")?
It seems the VS Code doesn't support this feature officially.
Hence, I make an extension called Highlight String Code which can highlight SQL expressions in Python or any other language.
You can easily use it by uppercasing the first keyword of the SQL command and adding a semicolon at the end:
I hope the extension can be helpful.