Fix printing of symbol in CLS when hovering#27582
Merged
jabraham17 merged 17 commits intochapel-lang:mainfrom Aug 5, 2025
Merged
Fix printing of symbol in CLS when hovering#27582jabraham17 merged 17 commits intochapel-lang:mainfrom
jabraham17 merged 17 commits intochapel-lang:mainfrom
Conversation
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
DanilaFe
approved these changes
Aug 5, 2025
Comment on lines
646
to
650
| auto parent = chpl::parsing::parentAst(context, node); | ||
| return parent && parent->isFunction() && | ||
| parent->toFunction()->thisFormal() && | ||
| parent->toFunction()->thisFormal()->id() == node->id(); | ||
| ) |
Contributor
There was a problem hiding this comment.
parentAst is notoriously expensive. Have you found issues with literally checing if name == USTR("this")?
Member
Author
There was a problem hiding this comment.
I don't think there is any issue with that, since the parser prevents it from being used in any Formal name context
Comment on lines
88
to
93
| for i in range(len(self._signature)): | ||
| tag = self._signature[i].tag | ||
| node = self._signature[i].node | ||
| value = self._signature[i].value | ||
| prefix = self._signature[i].prefix or "" | ||
| postfix = self._signature[i].postfix or "" |
Contributor
There was a problem hiding this comment.
Could you do:
for (i, part) in enumerate(self._signature):
tag = part.tag
node = part.node
value = part.value
prefix = part.prefix or ""
postfix = part.postfix or ""Then, I suggest in-lining the variables only used a handful of times (looks like tag and value)
Member
Author
There was a problem hiding this comment.
I inlined tag (used once), but left value since its twice (same as node)
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an issue where hovering over a primary method would just show
this. Now it will show the method name properly. Along the way, I also added the type name for secondary methods (and primary methods when resolution is enabled)In this PR:
hashand rich comparison to AstNode in chapel-pyis_thisto Formal in chapel-pytest-clsBefore



After



make test-cls[Reviewed by @DanilaFe]