How to make some keyword in vscode to be italicized - visual-studio-code

So my friend & I are programming in Python. He has a code in python so here it goes:
Somewhere in between some keywords like in def, there is some italicization.
How can I get this too?
I am currently using Arch Linux with vscode 1.61.2 with Jetbrains Mono font.
Here is my current behaviour
Like in
def change(x, y):
"Change snake direction."
aim.x = x
aim.y = y
he has def italicized

Related

How to show errors in Python code with VSCode

I would like to configure VSCode in such a way that I can see red squiggly lines when there is an error in my python code.
My VSCode currently shows me Python syntax errors (e.g. pri nt("hello") will have a red squiggly line), but not the following errors:
class Dog:
attr1 = "mammal"
attr2 = "dog"
def fun(self):
print("I'm a", self.attr1)
print("I'm a", self.attr3)
Rodger = Dog()
print(Rodger.attr1)
Rodger.bark()
In the code above I would like to see a red squiggly line on print("I'm a", self.attr3) since this object doesn't have a self.attr3 attribute, and Rodger.bark() since this object doesn't have a bark method.
I think you might need to add python env path to your vscode.
Press ⌘ + ⇧ + P on the keyboard.
Screenshot
And then choose your python interpreter path.
(VS code will display available python interpreters.)
Then, vscode will detect the attributes itself.
Let me know if you have any questions.

Pascal extension on VSCODE (pascal auto indent)

I'm trying to use pascal on vscode and i had to download some extensions, one of them ('Pascal formatter) what me to config this variables:
Indicates the engine app path (required)
"pascal.formatter.enginePath":
Indicates the configuration file for the selected engine (optional)
"pascal.formatter.engineParameters":
But im on ubuntu and i dont know where is that, bc the enginepath default its "C:\FPC\2.6.4\bin\i386-win32\ptop.exe". what i need to do here?
I want to use this extension because vscode its not auto-indenting my code while i write it.
If i write this in vscode :
program example;
var
i:integer;
begin
i:=4;
i:=4+5;
end.
but i want the code to autoindent while im writing like this:
program example;
var(*after hit enter it autoindent*)
i:integer;
begin(*after hit enter autoindent*)
i:=4;
i:=4+5;
end.(*detect end and get it to the same indent than begin*)

VSCode syntax highlight for coffeescript appears to be incomplete

I just started using coffeescript, and I use my preferred editor VSCode in its version 1.45.0 (latest as of today) and its standard theme.
When I write coffeescript code in a file with the file extension .coffee, I get some syntax highlight but it appears to be incomplete.
The code:
name = "Someone"
person = true
age = 19
yell = (number) ->
console.log name, "is now", number
yell(age) if person and name isnt "Scott"
And how it looks like:
screenshot
I find it weird that variables appear differently on second usage, however that might be normal syntax highlight for coffeescript. However, words like "is" or "isnt" aren't recognised.
What I tried:
deactivating all extensions
using https://marketplace.visualstudio.com/items?itemName=yorkxin.coffeescript-support
I searched on Stackoverflow and Google and Github and did not find anything that seemed helpful
Did anyone find a way or does anyone have ideas on how to to write coffeescript in VSCode with more meaningful syntax highlight?

Is it possible to write script plugins for VSCode similar to Sublime Text?

Sublime Text allowed writing python scripts which, upon placing within the IDE folders, were available as internal commands that could then be placed in menu, bound to a key, etc. https://www.sublimetext.com/docs/plugin-basics
Is there something similar for VSCode?
For example, this file, when placed in ST3\Data\Packages\User would add a duplicate command.
<binding key="ctrl+alt+d" command="duplicate"/>
or with view.runCommand('duplicate') in the console
import sublime, sublimeplugin
class DuplicateCommand(sublimeplugin.TextCommand):
def run(self, view, args):
for region in view.sel():
if region.empty():
line = view.line(region)
lineContents = view.substr(line) + '\n'
view.insert(line.begin(), lineContents)

Combine syntax highlighting of different Eclipse editors

I use Eclipse, StatET and the Sweave plugin to write my R and Latex code. The cool thing is that R and Latex code can be put together into one file, however you end up with a syntax highlighting problem.
I have loads of R code and I very much like the Eclipse R syntax highlighting. But now combining R and Latex means that I have to work with .Rnw files where there is no particular syntax highlighting for R.
When I go to Eclipse -> Preferences -> Content Types I can add *.Rnw to "R script file" which makes Eclipse to open the .Rnw files with the standard R Editor. However, this means that I do not have syntax highlighting for Sweave any longer. In addition, the Sweave code is shown as an error in the R editor.
My question is whether it is possible to combine different syntax highlighting styles in an easy way?
I don't think any Eclipse plugins/editors really support mixing up several syntaxes inside one editor. At any rate it is not currently supported in Eclipse Platform.
However you can try Eclipse Colorer plugin. It allows to switch coloring style for the current editor. It may mot support both R and Latex syntax, but you can create your own highlighting by adding your own HRC file.