-
Notifications
You must be signed in to change notification settings - Fork 317
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
ScalaMtags computes a wrong symbol for members in package objects #105
Conversation
@@ -177,6 +177,8 @@ object SymbolIndexTest extends MegaSuite { | |||
assertSymbolFound(5, 5)("_root_.scala.collection.immutable.List.") | |||
"<<CharRef>>.create(...)" - // JavaMtags | |||
assertSymbolFound(8, 19)("_root_.scala.runtime.CharRef.") | |||
"<<Either>>[...]" - | |||
assertSymbolFound(10, 15)("_root_.scala.util.Either#") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected symbol should be
_root_.scala.`package`.Either#
which is a type alias. However, I think we index that symbol as _root_.scala.Either
in scalamtags. We need to add package
to the owner when entering package objects in https://github.com/scalameta/language-server/blob/1299a44633f5f36f757ad26a08a52f53bc712b6c/metaserver/src/main/scala/scala/meta/languageserver/mtags/ScalaMtags.scala#L26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better way to test this is to update this line here
https://github.com/scalameta/language-server/blob/1299a44633f5f36f757ad26a08a52f53bc712b6c/metaserver/src/test/scala/tests/mtags/ScalaMtagsTest.scala#L42
to expect _root_.a.b.c.K.package.l.
I rebased this PR on top of #107 and fixed the bug |
Nice! Let's rebase this on master once #107 is in and then merge |
PSA it's necessary to clean the index cache to pickup this change as described here https://github.com/scalameta/language-server/blob/master/CONTRIBUTING.md#troubleshooting Once we move to sql we can probably version the index so algorithmic changes to mtags bump up the version and invalidate older caches. |
Given
the symbol for
x
should be_root.K.
package.x
. Right now it's_root_.K.x