-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
The plugin does not always interpret correctly )} in Lua #78
Comments
You can use the command
|
Cool thanks for the quick reply, here is the output 907:chunk --> ---------
509:table_constructor --> {
509:arguments --> ({
509:function_call --> resurrect.periodic_save({ |
I was a little bit unsure about what was missing here, but did a quick test and found the following: In JavaScript
In Lua
I created a potential fix for this here: #79 Let me know if it works out :) |
Ok I went into Treesitter and here is the tree for the function above: (function_call ; [504, 0] - [509, 2]
name: (dot_index_expression ; [504, 0] - [504, 23]
table: (identifier) ; [504, 0] - [504, 9]
field: (identifier)) ; [504, 10] - [504, 23]
arguments: (arguments ; [504, 23] - [509, 2]
(table_constructor ; [504, 24] - [509, 1]
(field ; [505, 1] - [505, 23]
name: (identifier) ; [505, 1] - [505, 17]
value: (number)) ; [505, 20] - [505, 23]
(comment ; [505, 25] - [505, 29]
content: (comment_content)) ; [505, 27] - [505, 29]
(field ; [506, 1] - [506, 22]
name: (identifier) ; [506, 1] - [506, 15]
value: (true)) ; [506, 18] - [506, 22]
(field ; [507, 1] - [507, 19]
name: (identifier) ; [507, 1] - [507, 12]
value: (true)) ; [507, 15] - [507, 19]
(field ; [508, 1] - [508, 17]
name: (identifier) ; [508, 1] - [508, 10]
value: (true))))) ; [508, 13] - [508, 17] I hope it helps |
Thanks! Sorry for premature closing of issue. I've just pushed another commit that might fix the issue. My initial PR seemed to work fine on my end on initial testing, but it turned out that the ts structure changed when there's a root return statement (module pattern). I believe I have added the correct context keyword now. |
Cool, indeed it is fixed with the last PR. Thanks a lot for the swift action! |
Fixed |
Awesome :) |
Most of the time, the plugin works great, but I have encountered what is probably a border case where it does not show the context correctly:
This comes from a wezterm configuration file (which is partially supported by the LSP, especially when using plugins).
I'm happy to help you debug it, but I would need some directions.
The text was updated successfully, but these errors were encountered: