Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix(search): correctly handle select:symbol.enum#64170

Merged
jtibshirani merged 1 commit into
mainfrom
jtibs/select
Jul 31, 2024
Merged

fix(search): correctly handle select:symbol.enum#64170
jtibshirani merged 1 commit into
mainfrom
jtibs/select

Conversation

@jtibshirani

Copy link
Copy Markdown
Contributor

To implement select:symbol.enum filters, we look at each symbol's ctags 'kind' and check if it matches the filter value enum. We accidentally didn't include 'enum' in this match logic, so all these symbols were filtered away.

This PR fixes that, and adds a few improvements:

  • Use a shared map between symbol.LSPKind and symbol.SelectKind, to avoid drift between these two conversions.
  • Audit the ctags mapping from sourcegraph/zoekt#674 and add other missing kinds (besides enum)

Closes SPLF-178

Test plan

Adapted unit tests. Manually tested select:symbol.enum before and after.

Changelog

Fix a bug in select:symbol.enum filters where they returned no results

@cla-bot cla-bot Bot added the cla-signed label Jul 31, 2024
@github-actions github-actions Bot added team/product-platform team/search-platform Issues owned by the search platform team labels Jul 31, 2024
"anonmember": lsp.SKField,
"recordfield": lsp.SKField,
"constructor": lsp.SKConstructor,
"enum": lsp.SKEnum,

@jtibshirani jtibshirani Jul 31, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Important part of the change: I added enum, enumerator, plus accessor, getter, methodalias, setter, singletonmethod

This is still pretty fragile overall. I'd love if there was a standard, centralized mapping (that could do something like ctags -> SCIP -> LSP kinds?)

@jtibshirani jtibshirani requested review from a team July 31, 2024 07:57
@jtibshirani jtibshirani merged commit f4a07a8 into main Jul 31, 2024
@jtibshirani jtibshirani deleted the jtibs/select branch July 31, 2024 09:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/product-platform team/search-platform Issues owned by the search platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants