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

Ranking: standardize symbol scores #656

Closed
wants to merge 1 commit into from
Closed

Conversation

jtibshirani
Copy link
Member

I found this code hard to follow and pulled out an enum to help unify things (shown in this PR). Then I realized the language-specific scoring sometimes uses custom factor values that don't match the default ones.

So just opening a draft to get feedback on a proposal. I'd like to use the same set of "symbol kinds" and scores for all languages. The only language-specific differences would be capturing more ctags labels (like "classes" instead of just "class", handling PHP "traits", etc.) This will simplify the logic and make it easier to reason about, since the same kind of symbol will always contribute to the score in the same way. The change would affect scoring, but I don't think the current behavior was so carefully chosen that it'd have a bad effect.

Comment on lines 728 to +731
case "interface":
factor = 9
score = Enum
case "method":
factor = 8
score = Interface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confuses me more than before. I think it is ok that EG "interface" has a different score depending on the language. Interface might be a super important in one language, like Go, and a tiny bit less important in class based languages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather replace the strings with an enum and define mapping for both universal-ctags and scip-ctags to our internal representation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confuses me more than before. I think it is ok that EG "interface" has a different score depending on the language.

In case it wasn't clear, my proposal was to change this so that interfaces, etc. are treated the same across languages. Then this refactor will be clean and not so confusing :)

Anyways thanks for your thoughts, let's discuss more in our next meeting!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I'm up-to-speed on how this works, I understand and think we need a different approach. Closing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants