This repository was archived by the owner on May 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on May 19, 2025. It is now read-only.
Custom Grit Pattern Not Recognized by VS Code Extension #3
Copy link
Copy link
Open
Description
Custom Grit Pattern Not Recognized by VS Code Extension
Hey there, I'm running into an issue with Gentrace in VS Code. I was wondering if you could provide any help @morgante.
Describe the bug
A custom Grit pattern defined in a .grit file within the workspace's .grit directory is not being recognized or listed by the GritQL VS Code extension. Standard library patterns might be visible, but local patterns are not.
To Reproduce
Steps to reproduce the behavior:
- Create a directory named
.gritat the root of the VS Code workspace. - Create a pattern file inside
.grit, for example,.grit/my_remove_comments.grit. - Add content to the pattern file (see example below).
- Optionally, create a
grit.yamlfile at the workspace root (see example below). - Restart VS Code.
- Attempt to run a Grit pattern using the extension (e.g., via the command palette).
- Observe that the custom pattern (
my_remove_commentsin this case) is not listed as an option.
Expected behavior
The custom pattern (my_remove_comments) defined in the .grit directory should be listed and executable via the GritQL VS Code extension interface.
Screenshots
Environment:
- OS: macOS (Darwin 24.3.0)
Workspace Setup:
-
.grit/my_remove_comments.grit:engine marzano(0.1) language js // Match any node identified as a comment by the parser comment() => . -
grit.yaml:version: 0.0.1 patterns: # Include patterns from the local .grit directory - directory: .grit
Troubleshooting Steps Taken:
- Confirmed the
.gritdirectory is located at the absolute root of the VS Code workspace (/Users/vivek/Code/gentrace-node-stainless). - Restarted VS Code multiple times after changes.
- Created the
grit.yamlfile shown above to explicitly configure the pattern directory. - Tried renaming the pattern file (initially
remove_comments.grit, thenmy_remove_comments.grit). - Initially encountered a VS Code error "Unable to find language for document...".
- Confirmed the GritQL extension is installed and enabled.
- Added/verified the following entry in VS Code's
settings.jsonunderfiles.associations:"*.grit": "grit"
- Despite these steps, the local pattern is still not recognized by the extension.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
