VSCode Extension for Cerberus

adamredwoods

Member
3rd Party Tool Dev
Joined
Jun 23, 2017
Visual Studio Code extension for Cerberus Programming Language

To use, download the VSIX file (you don't need all the files there, just the VSIX), then in VSCode select the Extensions Tab and click the 3-dot menu and "Install from VSIX". Select the VSIX file.
You may need to click the reload prompt in the corner. Afterwards, find the extension configuration and set the transcc path for your system.

To build, find the command menu (control-shift-p) and type Cerberus to select which build you would like. Hotkeys can be assigned. The extension offers configuration for build arguments. For now it only builds whichever file you current have active/selected.

If you would like to expand on the language highlights, feel free to make a PR in GitHub.

v0.9.0 - initial commit (updated! 8/25)
v0.9.1 - adds correct tab structure, adds custom target

Features:
- syntax highlighting (it's not perfect, because VSC uses regex expressions and it becomes a bit cumbersome. Will try to improve.)
- support for multiple build targets, and customizable arguments
- supports the monkey extension
- mac/win/linux

TODO:
- enable "main" file for projects
 
Last edited:

Phil7

Moderator
Joined
Jun 26, 2017
I tried the installation of the vsix file and got this error:
Corrupt ZIP: end of central directory record signature not found
 

adamredwoods

Member
3rd Party Tool Dev
Joined
Jun 23, 2017
Ok, please try again. It seems there were a couple problems with widows. It's now working on my test machine: Windows 10, VSCode 1.30.1.
 

adamredwoods

Member
3rd Party Tool Dev
Joined
Jun 23, 2017
For build scripts do you mean custom target? I can add that.

I was thinking about debuggers, but I wasn't sure how Cerberus handles them currently. For now, I'd say it's not a priority over MiniB3D (unless I need it).
 

Pengwin

New Member
Joined
Aug 16, 2019
For build scripts do you mean custom target? I can add that.

I was thinking about debuggers, but I wasn't sure how Cerberus handles them currently. For now, I'd say it's not a priority over MiniB3D (unless I need it).
I built a standalone debugger for BlitzMax, years ago. Unfortunately, I no longer have the source. However, if I recall correctly, it was fairly straightforward. I have looked at doing a debugger in VS Code myself, but I get very confused every time I try to work it out.
 

adamredwoods

Member
3rd Party Tool Dev
Joined
Jun 23, 2017
VS Code can show markdown built-in. So we could create a Cerberus command that pops up the markdown file. I know the docs are written in cerberus-down, but they can be converted with a regex script.

It is possible to create a custom tree view, but that's a lot of overhead, as it'd have to parse files to build the tree.
https://github.com/microsoft/vscode/blob/master/extensions/npm/src/npmView.ts

Debugging is a bigger issue, but there seems to be support for it. Currently, it is possible to control-click on the error in the output, and it will take you directly to that line and file.
 

Paul59

Active Member
CX Code Contributor
Joined
Dec 13, 2018
Location
UK
Idiot level question: Will it be possible to integrate your 'version' of VS code with CX at some point? Something like Kha does: http://kha.tech/
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Idiot level question: Will it be possible to integrate your 'version' of VS code with CX at some point? Something like Kha does: http://kha.tech/
Kha has an editor that is based on VSCode. Means they took the open source version which lacks a lot the stuff that is build into Microsofts version and built upon that.
 

adamredwoods

Member
3rd Party Tool Dev
Joined
Jun 23, 2017
Idiot level question: Will it be possible to integrate your 'version' of VS code with CX at some point? Something like Kha does: http://kha.tech/
What does Kha do that is needed for CX? I don't know Kha.

I've been thinking about integrating code hints, but I need to see if it slows down VSC, I prefer speed with my editors over code hints. I am also trying to get a CX docs menu, I managed to get a node tree up in a little box on VSC, but I need to figure out how to get the docs to display. Sadly for CX, all the docs are not true markdown, but rather a hybrid. IMO, we need to move the CX docs to markdown. This could be done with automation.
 

Paul59

Active Member
CX Code Contributor
Joined
Dec 13, 2018
Location
UK
What does Kha do that is needed for CX? I don't know Kha.
I just meant that VS Code has been integrated into the Kha project, could VS code (open source version) be used for CX in the same way?
 

adamredwoods

Member
3rd Party Tool Dev
Joined
Jun 23, 2017
I think it would be better to integrate CX into VSCode, through extensions, which is what I'm attempting to do.

> Does it only support pure Markdown or something else too?
As far as I know, only markdown.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Btw. your extention... it always tries to call MaxOs tools when building stuff. Are the paths hardcoded or are there settings I can change?
 
Top Bottom