Open schungx opened 2 years ago
Alright, I was under the assumption that it was already valid. Currently doing this is legal in the lsp's HIR already.
I will turn the issue around, Fn("foo")
should be recognized as a reference to an existing function.
Although it will only make sense after the type system.
Alright, I was under the assumption that it was already valid. Currently doing this is legal in the lsp's HIR already.
If I press F12 on foo
, would it jump to the function definition?
EDIT: Nope. It doesn't jump to the definition. However, it is recognized as a function with popup and everything. That is great. Only the jump-to-def doesn't work.
If I press F12 on
foo
, would it jump to the function definition?
It should, otherwise it's a bug.
It should, otherwise it's a bug.
Popups work correctly. However, references and definitions do not work.
Popups work correctly. However, references and definitions do not work.
I haven't been able to reproduce this, I see no reason for it not to work as there is not a lot of difference between functions and const/let
definitions regarding this.
I'll test again and let you know...
Popup works:
Pressing F12
Pressing Shift-F12
OK. I found out the reason.
When definition files conflict, F12 and Shift+F12 seems to jump all over the place.
For example, when we have separate definition files under definitions/.rhai/definitions
, but at the same time we have an all_in_one.d.rhai
, then they conflict and it seems random.
Removing all_in_one.d.rhai
resolves it.
@tamasfe I have a new drop in the repo that implements a convenient shorthand to create function pointers.
The LSP may need to be aware of this, as it might flag
fib
as an undeclared variable.