Editor syntax highlighting & navigation β VS Code & JetBrainsΒΆ
π§© Get the VS Code extension
What it isΒΆ
Syntax highlighting and jump-to-macro-definition for .fj files in
VS Code and
JetBrains IDEs (IntelliJ IDEA, PyCharm, CLion,
WebStorm, β¦). Ctrl+click a macro to jump straight to its def β see
Jump to macro definition below.
The classification is ported from the FlipJump IDEβs Monaco tokenizer
and kept in lock-step with this siteβs Pygments lexer
by automated parity tests. So a .fj file gets the same fj-dark palette as the
IDE and the code blocks here β def/ns/rep in blue, macro calls in gold,
macro definitions in cyan, labels in teal, constants in purple, directives in
orange, plus strings, numbers, and comments.
For exact colours, VS Code uses a TextMate grammar + scoped colour rules, and JetBrains uses a native plugin with its own lexer (its built-in TextMate engine canβt reproduce the per-token colours).
Jump to macro definitionΒΆ
Both extensions navigate to a macroβs definition. Ctrl+click (Cmd+click on
macOS), F12, or Go to Definition / Go to Declaration on a macro name jumps
to where itβs declared β searching every .fj file in the project for the
matching def. Clicking xor in hex.xor a b c finds def xor; one match jumps
straight there, several open a peek/popup list. The clicked segment is used on its
own, so the hex. namespace prefix is ignored (a macro is declared def xor
inside ns hex, never def hex.xor).
VS CodeΒΆ
Install from the VS Code Marketplace:
In the editor: open the Extensions view, search FlipJump, click Install.
Command line:
code --install-extension flipjump.flipjump
Colours. The extension applies the exact fj-dark colours to FlipJump tokens
only β every scope ends in .flipjump, so your own editor theme is untouched
for every other language. Nothing to switch.
Want to tweak them? Add this to your settings.json and edit the hexes:
"editor.tokenColorCustomizations": {
"textMateRules": [
{ "scope": "keyword.control.flipjump", "settings": { "foreground": "#569cd6", "fontStyle": "bold" } },
{ "scope": "entity.name.function.call.flipjump", "settings": { "foreground": "#e8c47a" } },
{ "scope": "comment.line.double-slash.flipjump", "settings": { "foreground": "#6a9955", "fontStyle": "italic" } }
]
}
JetBrains IDEsΒΆ
A native IntelliJ Platform plugin with its own lexer, so it reproduces the VS Code colours exactly, including macro-call (gold) vs macro-definition (cyan), labels, constants, and the rest β things JetBrainsβ built-in TextMate engine canβt do.
Install from the JetBrains Marketplace:
Settings β Plugins β Marketplace, search FlipJump, click Install β restart.
Open any
.fjfile. Tweak colours under Settings β Editor β Color Scheme β FlipJump.
Prefer to build it yourself? cd editors/jetbrains-plugin && ./gradlew buildPlugin
produces build/distributions/flipjump-jetbrains-*.zip, which you can load via
Settings β Plugins β β β Install Plugin from Diskβ¦ (the first build downloads
the IntelliJ Platform).
SourceΒΆ
Everything lives in the docs repo at
tomhea/flipjump-docs under editors/
β the VS Code extension in editors/vscode, the native JetBrains plugin in
editors/jetbrains-plugin, and the shared grammar in
editors/grammars/flipjump.tmLanguage.json. Bug reports
and improvements welcome there.
RelatedΒΆ
FlipJump IDE β the in-browser editor whose tokenizer this mirrors.
Lexical structure β what the tokens mean.
Hello World β paste it into a
.fjfile and watch it light up.