Closed scohen closed 1 month ago
I am testing this and can confirm that delegated functions are now included in the document symbols.
Here is a screenshot that shows this. Notice how the translate/3
function is included along with the rest, even though it is a defdelegate
instead of a def
or defp
.
This second screenshot is showing the "peek references" functionality of VSCode in the delegated module, which shows the defdelegate
macro that points to it. So I believe this is working good as well.
I agree with you that it may be a little bit confusing to show the defdelegate
as def
in the document symbols. May be enough to include a note somewhere (maybe in the README?) about this as the reasoning is sound and you are, in fact, defining a public function.
Note: #734 will allow us to mark delegates as delegates easily.
@crbelaus we now show defdelegate
in document symbols
I'm going to merge this, @scottming, you've had ample time to review this, two weeks for a small PR is too much.
Functions created with defdelegate weren't being indexed, so they weren't showing up in find references, document symbols, or go to definition.
This change emits two entries when it encounters a
defdelegate
call, one for the local function definition in the calling module, and a function reference to the delegated module. One possibly strange thing is that the function that's being created by defdelegate shows up asdef
in document symbols. This is technically correct, you're defining a public function, but it might be confusing in the UI.Fixes #724