vscode-gcode-syntax icon indicating copy to clipboard operation
vscode-gcode-syntax copied to clipboard

Add support for RepRapFirmware meta G-code keywords

Open chrishamm opened this issue 2 years ago • 9 comments

First of all, thank you very much for this extension - it looks great and if possible, I would really like to use the syntax highlighting from this project with Monaco in a web application to provide a nicer G-code editor.

What I've been missing is briefly mentioned in #44: Syntax highlighting for RepRapFirmware G-code keywords and expressions.

With RepRapFirmware it is possible to use variables (var, global, set), conditional code flow (if, elif, else, while, abort, break), to output generic messages (echo), and to use dynamic expression parameters (e.g. G1 X{100 * 0.3}, everything in curly braces is evaluated on execution). The set of keywords is relatively small and well-documented here: https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands

Is there any way this could be added to a future version or can you point me to the right bits that need to be changed?

chrishamm avatar Nov 28 '22 15:11 chrishamm

Hello and welcome! Thanks for creating your first issue! Someone from our community will get back to you soon!

github-actions[bot] avatar Nov 28 '22 15:11 github-actions[bot]

I think if I can find a way to change the syntax highlighting based on the machine type chosen in the configuration settings, then I can probably make this work! I'll put it on the schedule for v0.8, but I might have to push it to v0.9.

mikecentola avatar Dec 09 '22 17:12 mikecentola

Because our old editor component was basically falling apart, I've decided to built my own syntax highlighting from scratch. You can find it here in case you want to adopt parts of it in vscode-gcode-syntax: https://github.com/Duet3D/DuetWebControl/blob/v3.5-dev/src/utils/monaco-gcode.ts

chrishamm avatar Feb 02 '23 15:02 chrishamm

This issue has been automatically marked as stale because it has not had recent activity.

github-actions[bot] avatar Apr 04 '23 07:04 github-actions[bot]

The highlighting file works quite nicely, I may make some more minor changes before our next 3.5 release but it should be error-free.

chrishamm avatar Apr 18 '23 09:04 chrishamm

@chrishamm thanks for your work on that. I've been offline for quite some time now with other life issues, so I'm going to start playing catchup on this extension. I'll see if there is anything I can incorporate into this.

mikecentola avatar Apr 25 '23 22:04 mikecentola

This issue has been automatically marked as stale because it has not had recent activity.

github-actions[bot] avatar Jun 25 '23 07:06 github-actions[bot]

There have been two minor changes in my source file since your last comment, just FYI.

chrishamm avatar Jul 15 '23 17:07 chrishamm

This issue has been automatically marked as stale because it has not had recent activity.

github-actions[bot] avatar Sep 15 '23 07:09 github-actions[bot]