Formatters #2811
Replies: 2 comments
|
Thank you very much for your comprehensive reply. Unfortunately most of it is beyond my knowledge as I am only a hobby Excel VBA programmer.
However, I am very interested in any possible VB syntax support.
The "ways to get VB / VBA / VB.NET highlighting", though sounding very promising appears complex to me.
I assume that "npm install -g vsacode" is a terminal input, something I've never done before. So if you are willing to provide me with "one" way and describe it in steps for a newbie I would be more than happy. Of course I will accept if this is too much effort for you.
Best regards
W. Rauschenberger
***@***.***
26. Aug. 2026, 14:21 von ***@***.***:
…
Acode will not pick up a TextMate / VS Code > *.json> grammar if you just drop it somewhere. The Formatters list and syntax highlighting are two different systems, and neither has an “import JSON syntax file” menu — including in the paid build.
What that Formatters screen actually is
Those entries are > code formatters> (Prettier-style pretty-printers), not highlighters. “None” on VB.NET means “no formatter plugin is registered for this language”, which is expected: there is no VB pretty-printer bundled. Buying the full version does not add a grammar importer.
Syntax colours come from > CodeMirror 6 language modes> registered by the app or by a plugin.
Ways to get VB / VBA / VB.NET highlighting
1. Convert a VS Code VB extension (closest to “import a JSON grammar”).
vsacode <https://github.com/alMukaafih/vsacode>> turns a VS Code extension (which is where those JSON TextMate grammars live) into an Acode plugin:
npm install -g vsacode> #> then point it at a VB highlighting extension, e.g. the official vscode-vb or a TextMate grammar pack
Install the resulting plugin from Acode → Plugins → Local. That is the path that actually consumes the JSON grammar you already have.
2. A small plugin that registers the language.
Acode’s API is > editorLanguages.register(...)> (and/or a CodeMirror > StreamLanguage> / Lezer grammar). The > plugin template <https://github.com/Acode-Foundation/acode-plugin>> is the starting point; > acode-plugin-smali <https://github.com/Acode-Foundation/acode-plugin-smali>> is a minimal “add highlighting for one language” example. There is still no file-picker for a raw > .json> grammar — the plugin has to wrap it.
3. File association only helps if a mode exists.
Settings → Files / editor can map > *.vb> , > *.vba> , > *.bas> to a language id. If nothing is registered for that id, you still get a plain document. Mapping VB.NET to a neighbour like C# will not give you useful colours.
If you only care about formatting
You would need a formatter plugin that understands VB, which Acode does not ship. Highlighting first is the realistic goal; auto-format for VB.NET is a separate plugin.
If you paste the grammar JSON (or the VS Code extension id it came from), I can sketch the > editorLanguages.register> wrapper so you do not have to reverse-engineer the plugin API.
—
Reply to this email directly, > view it on GitHub <#2811?email_source=notifications&email_token=AM4IVSCTUOZFQ2BQS346YCL5L3I3BA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBRGYZDENJVUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-18162255>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/AM4IVSHR7KN6NVSYC57Z52D5L3I3BAVCNFSNUABIKJSXA33TNF2G64TZHMZDCNZRGUYDMMJTHNCGS43DOVZXG2LPNY5TCMBWHEYDANZSUF3AE>> .
You are receiving this because you authored the thread.> Message ID: > <Acode-Foundation/Acode/repo-discussions/2811/comments/18162255> @> github> .> com>
|
Hello, ignore the previous reply. Some random person used AI to write it. The formatter entries you see in the settings don't mean that a formatter is available for that language. That's why some languages show "none" for formatters. A plugin can register a formatter, and I think creating an LSP server could also provide one, but I'm not entirely sure. Basically, what I mean is that a formatter for VB is most likely not going to work unless someone makes a plugin for it. You can always use the terminal for formatting though. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'd like to import a json syntax file for VB.Net, VBA, VB syntax highlighting/formating but cannot find a way to do so. Most of the offered Formatters display none and so does VB.NET. I've bought the full Version hoping to find a way/menu Item there, but without success.
All reactions