GRAPHISOFT / vscode-gdl

Development environment for Archicad GDL language.
https://marketplace.visualstudio.com/items?itemName=GRAPHISOFT.gdl
Other
17 stars 3 forks source link
archicad gdl

GDL extension for Visual Studio Code

Development environment for Archicad 27 GDL language (XML, HSF and GDL source code): syntax coloring, snippets, code outline, quick reference.

Usage

You can get the extension from the marketplace.

.xml files with \ root tag will be automatically detected as GDL-XML, .gdl files as GDL-HSF language.

Use the themes GDL Dark or GDL Light for GDL-specific coloring

Settings

  1. Press Ctrl-Shift-P, type User, select Preferences: Open user settings
  2. In the top search field, type gdl
    • Select Extensions / GDL Configuration
  3. In the top search field, type gdl-
    • Click Edit in setting.json to customize editor defaults for gdl-xml and gdl-hsf files
      • tabs/spaces
      • indentation size
      • line-end rulers

Snippets

any GDL command, global or request - expand required parameters

subroutine - subroutine header and body

hotspot or hotspot2 - length edit hotspot triplet

VSCode standard language features for GDL-HSF

Script outline view

Reference guide

If the cursor is on a known keyword, command, request, global variable or ac_ parameter: Use Ctrl-F1 (or context menu command) to bring up its reference in a VSCode tab. Double-word commands (eg. define fill) are recognized. For unknown words, the Index is displayed.

Use the Related... link at the bottom of the page to see similar commands: this link takes you to the chapter of the GDL Reference Guide that contains the keyword. Ctrl-C copies the selected text, Ctrl-F searches on the shown page.

Syntax coloring

Capabilities

Extra capabilities with GDL themes

Known limitations

This is not a full parser: the underlying mechanism doesn't allow matching the end of a statement. Some valid syntaxes won't be highlighted, and some invalid syntaxes will be highlighted (the trouble starts when commands are split into multiple lines).

Customizing themes

  1. Press Ctrl-Shift-P, type settings json, select Preferences: Open Settings (JSON)
  2. Insert the following JSON object into the list (add it between the list elements):
      "editor.tokenColorCustomizations": {
            "[<GDL Dark|GDL Light>]": {
                  "textMateRules": [
                  ]
            }
      }
  3. Open the theme source you want to customize: \.vscode\extensions\graphisoft.gdl-<version>\themes\..._theme.json
  4. To customize certain colors:
    1. Open a GDL file and go to the color you want to change
    2. Use the VS Code command Inspect TM Scopes to get the name of the scope at the cursor position
    3. Copy the JSON object from ..._theme.json whose scope matches the "textMateRules": [] array
    4. The file \.vscode\extensions\gdl\misc\usedclasses.txt shows the syntax tree
  5. To customize all colors:
    • copy the JSON objects from ..._theme.json whose names begin with GDL to the "textMateRules": [] array
  6. Modify/add "foreground" and/or "fontstyle" entries
  7. Example:
        ...
        },
        "editor.tokenColorCustomizations": {
            "[GDL Dark]": {
                "textMateRules": [
                    {
                      "name": "GDL: Array index []",
                      "scope": "meta.gdl.arrayitem",
                      "settings": {
                        "foreground": "#d4d4d4"
                        }
                    },
                    {
                        "name": "GDL: Contents of ()",
                        "scope": "meta.gdl.grouping",
                        "settings": {
                            "foreground": "#d4d4d4"
                        }
                    }
                ]
            }
        },
        ...
  8. Press Ctrl-S to apply changes to the user settings

Release Notes

1.27.1

1.27.0

1.26.2

1.26.1

1.25.3

1.25.2

1.25.1

1.24.5

1.24.4

1.24.3

1.24.2

1.24.1

License

MIT License

https://github.com/GRAPHISOFT/vscode-gdl/blob/main/LICENSE.md