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

Emit method overload symbol in Java mtags #281

Closed
olafurpg opened this issue Apr 10, 2018 · 2 comments
Closed

Emit method overload symbol in Java mtags #281

olafurpg opened this issue Apr 10, 2018 · 2 comments
Labels
navigation Related to goto definition, find references, open symbol

Comments

@olafurpg
Copy link
Member

olafurpg commented Apr 10, 2018

Java mtags currently emits field symbols for methods.

void foo(int a, String b) 
// field: foo.
// method foo(Int, String)

it would be nice if java mtags emitted correct method symbols so it's possible to goto definition to the precise overload of a method.

The specification for java method symbol syntax is documented here https://github.com/scalameta/scalameta/blob/master/semanticdb/semanticdb3/semanticdb3.md#java-symbol

The place to fix this issue is here https://github.com/scalameta/metals/blob/905bf282299f7c136b40173103cf367073dc55f8/metals/src/main/scala/scala/meta/metals/mtags/JavaMtags.scala
and to test the fix

https://github.com/scalameta/metals/blob/905bf282299f7c136b40173103cf367073dc55f8/metals/src/test/scala/tests/mtags/JavaMtagsTest.scala

@olafurpg olafurpg changed the title Emit correct method overloads in Java mtags Emit method overload symbol in Java mtags Apr 10, 2018
@scalavision
Copy link

I have been working a bit on this issue:

https://github.com/scalavision/metals/tree/3.7

This is still missing:

  • support for Arrays
  • More tests needed

@olafurpg olafurpg added navigation Related to goto definition, find references, open symbol and removed good first issue labels Sep 26, 2018
@olafurpg
Copy link
Member Author

Fixed in #292, Java mtags emits correct method overloads including for overloaded methods between non-static and static methods (which requires a special case in the SemanticDB spec).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
navigation Related to goto definition, find references, open symbol
Projects
None yet
Development

No branches or pull requests

2 participants