Is there a way to change background color of syntax highlight in Visual Studio Code - visual-studio-code

I was looking for a better code editor for my projects and wanted to give VSCode a try. But I couldn't find where to customize the syntax highlighting settings. What I actually need is to change the background color of embedded languages within a file so that I can identify different parts of the code a lot easier.
I have this PHP file which contains, HTML, CSS and JavaScript and I'd like to set different background colors for all 4 languages within this single file. Is this possible with VSCode? or does anyone know a code editor that supports this? UltraEdit supports this but it has so many other shortcomings.

Not possible #3429 Themes don't support background styling

Related

Printing markdown in VSCode uses different styling than on-screen

When I go to print markdown from VSCode it does render the markdown, but it has a very different styling than the on-screen preview. How do I fix this?
VS Code does not support the printing of markdown or anything else. For that you need a printing extension. There are only two of these, and I wrote the one that prints rendered markdown. I'm quite certain you're talking about mine because it has a Markdown: Styles setting and the other one doesn't.
There are settings that allow you to customise styling. It's not currently styled using a stylesheet because there are complications referencing that sort of asset in remoting environments.
To work around this I had to embed styles into the document. This has the unfortunate effect that you cannot override them with a separate CSS file. As a temporary measure, I have made available settings allowing you to customise the embedded styles.
I notice in the screen snap that I have specified "Blackadder ITC" as the font-family. This is not a typeface I would recommend, probably I was giving a demo. I sincerely hope this wasn't in shipped setting defaults. If that's why you think it's "ugly" then change the heading font-family to whatever typeface you prefer for headings. sans-serif will use the local default.

Richer TreeView Experience in VS Code Extension

I am trying to determine if its possible to provide a "richer" experience when using TreeViews in a VS Code extension. The default explorer view has the ability to do things provide custom text coloring for items (such as red when a file has an error or yellow if its been changed). However, the only highlight I can seem to find in TreeItems is only able to highlight text in an item without control over color but only select when the highlight starts/stops.
I would really like to take advantage of the same tree experience provided by the VS Codes extensions view but it does not seem to be restricted by the same API as other extensions (makes sense).
Any recommendations? I am considering just doing a webview that holds my own "TreeView" but wanted to see if there are other options before going down that rabbit hole.

Is it possible to create an extension to vscode that changes the CSS of the editor?

I wish to develop an open-source WYSIWYG editor for markdown in vscode.
See the image below. I want an extension that can do something like that.
Change font-sizes for lines for titles.
Change lines indentation for subtitles.
I'm looking at the extension reference: https://code.visualstudio.com/api/references/vscode-api and don't see something that can help.
Do you have an idea how to change the CSS of the editor based on rules? in addition, If you have a link to extension that did it may help.
In other words: How a vscode extension can change css style of the editor window?
You can't change arbitrary css in the editor. See the extension guide for info about the VS Code extension philosophy and how you can extend VS Code
Two options:
Use the decorations api to change rendering of tokens in the editor.
Use a webview to implement a custom view (but don't try re-implementing a text-editor because it will be a pain and will not work like VS Code's normal editors do)

How to draw on the background in a vscode extension?

Is it possible to make an extension that draw lines on the background? You can decorate a lot of thing but I can't find a way to draw colored lines.
I would like to see the flow of my data (inspired by visual programming).
Something like that (but the like drawn under the text) :
Keep in mind vscode is an add-on to Electron, which is a webbrowser in a desktop raiment. So what you see are webpages and hence everything what's possible on a webpage (with a node.js basement) is also possible in vscode - at least in theory. I say "in theory" because after all vscode is a text editor and limits interaction in a way that supports this goal. So, what you can is either some drawing/graphics or add extensions that work in normal editor pages. You certainly don't want to write your own text editor interface within vscode.

How to combine multiple VS Code themes?

I come from Atom, where I had a way to define a UI theme, and a syntax theme.
Now with VS Code I'm using One Dark Pro theme, because I like how it styles the UI, but I would like to use a different syntax for the editors text.
Is there a way to combine multiple themes to obtain what I want?
As of VSCode 1.13, you cannot do this without creating your own theme. We are tracking Atom-style support for separate syntax and UI themes here: https://github.com/Microsoft/vscode/issues/25986
You can manually combine themes however. See our built-in red theme for an example of using different files for the syntax theme definition (red.tmTheme) and the UI theme (Red-color-theme.json).