Ungrammar is a novel data format
for defining concrete syntax trees. This project aims to integrate Ungrammar
language support into VS Code, providing features to streamline the creation
and modification of .ungram
files. By offering a dedicated language
experience within the editor, we aim to simplify the development process for
users working with this syntax definition format.
We offer up node name suggestions as you type with IntelliSense. You can also
manually see suggestions with the Trigger Suggestions command (Ctrl+Space
).
We also perform structural and value verification giving you red squiggles.
To disable validation, use the ungrammar.validate.enable
setting.
Ungrammar files can get large and we support quick navigation to properties
using the Go to Symbol command (Ctrl+Shift+O
).
When hovering over nodes within an Ungrammar data structure, detailed context-specific information is displayed, aiding in understanding the code's structure and relationships.
You can format your Ungrammar document using Shift+Alt+F
or Format Document
from the context menu. To disable validation, use the
ungrammar.format.enable
setting.
Before formatting:
After formatting:
You can fold regions of source code using the folding icons on the gutter between line numbers and line start. Folding regions are available for all object and array elements.
Before folding:
After folding:
We provide informative annotations displayed above code elements to aid in code comprehension. These annotations offer quick access to references, implementation details, and other relevant context, enhancing code navigability and understanding.
You can extend (Alt+Shift+→
) or shrink (Alt+Shift+←
) the current selection
to the encompassing syntactic construct (node, alternative, sequence, group,
etc). It works with multiple cursors.
You can find all references using Shift+Alt+F12
to show all references of the
item at the cursor location.
You can navigate to the definition of an node using F12
.
Before Go to Definition, we are at line 657:
After Go to Definition, we are at line 588:
You can highlight related constructs upon hovering over a node. This feature displays all references to the selected node within the current file, enhancing code navigation and understanding.
You can efficiently rename symbols across your codebase using the F2
.
This powerful feature automatically updates all references to the selected
symbol, ensuring consistency and reducing the potential for errors.
You can enhance your code formatting with our powerful code actions. Quickly
and easily rename nodes to specific casing styles including snake_case
,
CONSTANT_CASE
, camelCase
, and PascalCase
, ensuring consistent naming
conventions throughout your project.
We highlight the code semantically. For example, "Rule" might be colored
differently depending on whether "Rule" is an Definition
or a Identifier
. We
does not specify colors directly, instead it assigns a tag (like variable) and
a set of modifiers (like definition) to each token. It's up to the client to
map those to specific colors.