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

Webc language support #7290

Merged
merged 2 commits into from
Jun 13, 2023
Merged

Webc language support #7290

merged 2 commits into from
Jun 13, 2023

Conversation

vanarok
Copy link
Contributor

@vanarok vanarok commented Jun 8, 2023

Add webc grammar.

@the-mikedavis the-mikedavis added the A-language-support Area: Support for programming/text languages label Jun 8, 2023
@the-mikedavis
Copy link
Member

This will need a run of cargo xtask docgen to fix the CI

@pascalkuthe pascalkuthe merged commit df09490 into helix-editor:master Jun 13, 2023
6 checks passed
rozaliev pushed a commit to rozaliev/helix that referenced this pull request Jun 13, 2023
* feat: add webc language support

* feat: add to lang-support book webc
Triton171 pushed a commit to Triton171/helix that referenced this pull request Jun 18, 2023
* feat: add webc language support

* feat: add to lang-support book webc
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
* feat: add webc language support

* feat: add to lang-support book webc
@johannesrave
Copy link

very cool! is there a way for me to use this now without waiting for the next release if i can't rabbithole into getting the buildchain up atm?

@johannesrave
Copy link

johannesrave commented Apr 3, 2024

thanks for working on this @vanarok ! i have by now figured out how to compile helix from master, and now the new version is released for packaging too.

i have another question regarding the actual grammar though:
auto-formatting breaks indented frontmatter at the moment, for example with indented arrays:

---
layout: "_layouts/document.webc"
title: recent posts
pagination:
# these lines get un-indented on :fmt
  data: collections.post 
  size: 2
  alias: posts
  reverse: true---
<p>welcome to the rest of the page.</p>

looking at it with :tree-sitter-subtree the frontmatter is simply parsed as a string by the html-grammar.

i expected that the injections.scm in queries/webc somehow extends the html grammar-injections that webc uses as defined in the global languages.toml, and that i would be able to copy the yaml injections from the markdown-grammar:

; inherits: html
((minus_metadata) @injection.content (#set! injection.language "yaml") (#set! injection.include-unnamed-children))

however, i see no effect after recompiling or rebuilding the grammars on their own. is queries/webc even used if the languages.toml defines the grammar for webc to be html?

i tried working on this but have been unsuccessful, i just don't know enough about the whole build-chain.
i don't fully understand the interplay of the tree-sitter parsers that get pulled on build, the language-definitions and the queries-directories (with injections.scm).

edit: another thing that isn't yet working for me is comments with C-c in injected languages: for example inside a <style>-tag, the html-like comment style defined in languages.toml is still used.

mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* feat: add webc language support

* feat: add to lang-support book webc
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* feat: add webc language support

* feat: add to lang-support book webc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants