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

flutter/dart values show in wrong position and with incorrect type #86

Open
dizzib opened this issue Sep 6, 2024 · 3 comments
Open

Comments

@dizzib
Copy link

dizzib commented Sep 6, 2024

It would be great if virtual text could appear on the current line begin debugged.

Also, in the screenshot we see bool value = “b0”

Screenshot 2024-09-06 at 14 37 14

Thanks.

@theHamsta
Copy link
Owner

theHamsta commented Sep 13, 2024

Hi @dizzib ! It appears that the plugin confuses all the different keys and values.

Have you checked whether the flutter locals.scm set @locals.scope appropriately? The algorithm of the plugin is to look into the scope of the current line being debugged (actually in the tree of nested scopes). If the locals.scm queries work as expected this should only be in the current function. Or is there a problem that the debugger only tells the line while the scope is actually only defined column-wise for the last part of the line?

For the plugin to work there has to be a scope at function level, if this scope is not present, it will look at class level. At class level it used the first definition of key and value respectively.

@theHamsta
Copy link
Owner

theHamsta commented Sep 13, 2024

To the debug you could use tree-sitter query <path to dart's locals.scm> <your source file>

https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/dart/locals.scm

Could you paste your test file in plain text here?

@theHamsta
Copy link
Owner

I don't see a function scope here

https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/dart/locals.scm

There is just a scope for a (block). Could could open the Neovim tree-sitter play to see what your function is parsed at and add a respective query to
https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/dart/locals.scm

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