zed icon indicating copy to clipboard operation
zed copied to clipboard

Allow extension to use recursive Git clone for grammars

Open bbannier opened this issue 1 year ago • 0 comments

Check for existing issues

  • [X] Completed

Describe the feature

I am working with a tree-sitter grammar which separates the tree-sitter generated src/ directory into a separate Git repository which is included as a Git submodule in the grammar repo. Currently the extension API does not perform recursive fetches/clones, so the generated sources are not found. The grammar loader also assumes that the generated files are inside a directory named src/; however my submodule is not named src so even if I would use the repo of generated sources in [grammar] the files cannot be found.

It would be great if zed's extension API would either in general perform recursive clones, or at least provide an optional flag for e.g., GrammarManifestEntry so one can opt into this when needed (I didn't check whether there are more extension points which could benefit from this).

If applicable, add mockups / screenshots to help present your vision of the feature

[ERROR] crates/extensions_ui/src/extensions_ui.rs:65: failed to compile grammar 'foo'

Caused by:
    failed to compile foo parser with clang: clang: error: no such file or directory: '<foo>/grammars/foo/src/parser.c'

bbannier avatar Apr 19 '24 08:04 bbannier