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

Multi-language documents don't benefit from navigation by tree-sitter #4618

Closed
vv3rd opened this issue Nov 6, 2022 · 3 comments · May be fixed by #9320
Closed

Multi-language documents don't benefit from navigation by tree-sitter #4618

vv3rd opened this issue Nov 6, 2022 · 3 comments · May be fixed by #9320
Labels
A-tree-sitter Area: Tree-sitter C-bug Category: This is a bug

Comments

@vv3rd
Copy link

vv3rd commented Nov 6, 2022

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):
Screenshot_20221106_202029

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)
Screenshot_20221106_203051

Reproduction Steps

I tried this:

  1. hx [any vue, svelte or html file]
  2. 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 (3881fef)

@vv3rd vv3rd added the C-bug Category: This is a bug label Nov 6, 2022
@the-mikedavis the-mikedavis added the A-tree-sitter Area: Tree-sitter label Nov 6, 2022
@kirawi
Copy link
Member

kirawi commented Nov 6, 2022

Duplicate-ish of #2311

@vv3rd
Copy link
Author

vv3rd commented Nov 6, 2022

True, seems to be the same issue. Is it on a roadmap? I probably can't do it myself.

@pascalkuthe
Copy link
Member

Closing in favor of #9425

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tree-sitter Area: Tree-sitter C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants