question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multi-language documents

See original GitHub issue

Now that Cursorless supports HTML (great job!) it would be amazing if it could also support nested languages inside of HTML. For example JS/TS inside of <script> tags, and CSS/SCSS inside of <style> tags.

This would be super helpful for web developers. Because plenty of popular frameworks (such as Vue) use single file components, where HTML, JS and CSS are all located in the same file.

I assume that this documentation is relevant to this issue: https://tree-sitter.github.io/tree-sitter/using-parsers#multi-language-documents

  • JS and CSS support inside of HTML
  • Code blocks within markdown

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
pokeycommented, Mar 20, 2022

Awesome! Solid research. We should think about how this connects to rewriting our language defs using this query language. Cc/ @wenkokke

One minor thing I’ll add: helix also maintains its own injection regexes in case for whatever reason we need to steal those. They’re all in one file, see eg rust

1reaction
pokeycommented, Mar 20, 2022

It’s also worth thinking bout how this works with incremental parsing

Yep! This query can happen off of any SyntaxNode, I used the rootNode as an example above.

Just to be clear, by “incremental parsing”, I mean updating the parse tree as the document changes, which tree-sitter is able to do efficiently without reparsing the entire document. Here’s where we do it in the parse-tree extension: https://github.com/cursorless-dev/vscode-parse-tree/blob/4af875b7cbd72d68c1e1eafe43ddabc3403264ce/src/extension.ts#L109-L134

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Multi-Language Documents with HotDocs
HotDocs technology helps to improve the end-user experience by enabling the simple creation of documents in a variety of languages, producing error-free, ...
Read more >
Creating Multi-Language Documents (Brief Guide)
Automating multi-language documents can be a cinch with the best document automation software. You can get the measurements, currencies, dates, ...
Read more >
Multilingual Support - LogicalDOC
LogicalDOC is an international Document Management System that supports a wide variety of languages. Language support means more than a simple translation ...
Read more >
Multiple Language Support and Localization - infoRouter
infoRouter offers Multiple Language Support and Localization in Document Management software for a global economy.
Read more >
Serving Multilingual Online Documentation
We at SCO have implemented our help, online documentation and manual pages using WWW architecture, and because we control both the client and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found