appliedengdesign / vscode-gcode-syntax

G Code Language Extension for Visual Studio Code. Turn VSCode into a fully capable G-Code editor, including language support & more.
MIT License
86 stars 25 forks source link

My regexes #26

Closed ganzuul closed 3 years ago

ganzuul commented 3 years ago

Hi, I noticed that coordinates X10.01 lose highlight-colors after the dot, so here are the regexes I have been using:

"coords": {
    "patterns": [
        {
            "match": "(?i)([\\,]?[XUIYVJZWKACR][ \\t]*[\\-\\+]?[0-9]++(?!\\.))",
            "name": "invalid.gcode"
        },
        {
            "match": "(?i)[XUI]?[ \\t]*[\\-\\+]?[0-9\\.]+",
            "name": "axis.x.gcode"
        },
        {
            "match": "(?i)[ZWK]?[ \\t]*[\\-\\+]?[0-9\\.]+",
            "name": "axis.z.gcode"
        },
        {
            "match": "(?i)[CH]?[ \\t]*[\\-\\+]?[0-9\\.]+",
            "name": "axis.c.gcode"
        }
    ]
},

invalid.gcode warns about coordinates without a decimal point like "X100". It works together with settings.json in the .vscode folder of the workspace.

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "name":"invalid",
            "scope": "invalid.gcode",
            "settings": {
                "foreground": "#F00",
                "fontStyle": "underline",
            }
        },
        ]
    }

I hope these are useful to the project!

mikecentola commented 3 years ago

Thanks! I'll get it into an update

mikecentola commented 3 years ago

Fixed in v0.6.2

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was close. Please open a new issue for related topics.