helix
helix copied to clipboard
Multi-language documents don't benefit from navigation by tree-sitter
Summary
In documents with multiple languages such as vue, svelte or html files, contents of <script>
or <style>
represented by a single node (most often raw_text
).
Here's example of what I see when calling :tree-sitter-subtree
command (I deleted <template>
contents so that whole subtree is visible, but everything inside template seems to work as it should):
Similar story with template function invocations in javascript, in places where additional syntax highlighting is supported (to show that it's not just vue issue)
Reproduction Steps
I tried this:
-
hx [any vue, svelte or html file]
- Start using unimpaired-style navigation or Syntax-tree Motions in script or style sections
I expected this to happen:
Navigation works just as in javascript/css files
Instead, this happened:
Unimpaired-style motions have no effect, A-left
or A-right
takes me to a sibling tag as opposed to a javascript textobject
Helix log
Probably nothing useful
~/.cache/helix/helix.log
2022-11-06T20:47:39.351 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2022-11-06T20:47:40.244 helix_lsp::transport [ERROR] err <- "DeprecationWarning: 'createIdentifier' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.\n"
2022-11-06T20:47:40.244 helix_lsp::transport [ERROR] err <- "DeprecationWarning: 'createImportClause' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.\n"
2022-11-06T20:47:40.244 helix_lsp::transport [ERROR] err <- "DeprecationWarning: 'createLiteral' has been deprecated since v4.0.0. Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead.\n"
2022-11-06T20:47:40.244 helix_lsp::transport [ERROR] err <- "DeprecationWarning: 'createImportDeclaration' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.\n"
2022-11-06T20:47:40.245 helix_lsp::transport [ERROR] err <- "DeprecationWarning: 'createCallExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.\n"
Platform
Manjaro Linux
Terminal Emulator
Konsole, Kitty (probably irrelevant)
Helix Version
helix 22.08.1 (3881fef3)
Duplicate-ish of https://github.com/helix-editor/helix/issues/2311
True, seems to be the same issue. Is it on a roadmap? I probably can't do it myself.
Closing in favor of https://github.com/helix-editor/helix/issues/9425