Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash support in embedded code blocks of *.nix files #418

Open
jnoortheen opened this issue Sep 10, 2024 · 1 comment
Open

Bash support in embedded code blocks of *.nix files #418

jnoortheen opened this issue Sep 10, 2024 · 1 comment

Comments

@jnoortheen
Copy link
Collaborator

@ian-h-chamberlain
Copy link
Contributor

ian-h-chamberlain commented Sep 12, 2024

For inspiration, tree-sitter-nix seems to use various prefixes to decide whether a string should be injected as bash:

  • /* bash */ comment beforehand (also supports e.g. /* python */ etc. but not sure if this is feasible with LSP / tmLanguage)
  • writeShellScript, runCommand, writeShellApplication
  • various phases / hooks like configurePhase, buildPhase etc.

Supporting the /* bash */ comments would be nice if possible, since this allows for highlighting scripts in let bindings and arbitrary function args that might not be recognized automatically, while still leaving other multi-line strings as plain strings.

Edit: it may also be feasible to use request forwarding to support arbitrary language servers, so VSCode could fall back to something like bash-lsp for highlighting/completion etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants