-
Notifications
You must be signed in to change notification settings - Fork 354
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
Issue 259: use enhanced (CompletionItem|Symbol)Kinds #288
Conversation
Thank you so much for this contribution @eddiemundo! I think I'll have time to review this later today, meanwhile I can suggest to add test cases to You can run |
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.
Pretty cool! I personally like the detection of Function as opposed to val
def isFunction(symbol: Symbol): Boolean = { | ||
val typeSymbolFullName = symbol.info.finalResultType.typeSymbol.fullName | ||
functionTraitRegex.findFirstIn(typeSymbolFullName).isDefined | ||
} |
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.
You can query the compiler directly for this piece of information with
compiler.definitions.isFunctionSymbol(
symbol.info.finalResultType.typeSymbol
)
(thanks @olafurpg for the tip)
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.
I spent way too long trying to figure something like that out before settling on the ugly regex solution... thanks
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.
LGTM! 👍 Thank you for this contribution, @eddiemundo
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.
LGTM! 👍 Thank you for this contribution, @eddiemundo
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.
LGTM 👍 Thanks for this contribution @eddiemundo !
Issue 259: use enhanced (CompletionItem|Symbol)Kinds
Closes #259
I added the new lsp CompletionItemKinds and SymbolKinds.
For CompletionItemKinds I only mapped TypeParameter and Function, but I'm not sure if you want Function mapped because it's not a new CompletionItemKind, and it wasn't previously mapped. I also think the Function case is dead-code cause when trying to complete a symbol that's a function it'll probably go into the val case.
For SymbolKinds I'm not convinced that I did the additions to ScalametaEnrichments correctly. I'm not sure if documentSymbol() adds Type.Param and Lit.Null to the list that it builds, so those additional cases might be pointless.
Finally the issue mentions Constant in CompletionItemKind. I'm not sure how to map that cause doesn't CompletionItemKind.Value cover that, or does Constant mean something else?