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

SCIP ctags: add kinds for C#, Python, Ruby #57879

Merged
merged 12 commits into from
Oct 26, 2023
Merged

SCIP ctags: add kinds for C#, Python, Ruby #57879

merged 12 commits into from
Oct 26, 2023

Conversation

jtibshirani
Copy link
Member

@jtibshirani jtibshirani commented Oct 24, 2023

Added more fine-grained kinds for C#, Python, and Ruby to better match the universal-ctags output.

Addresses https://github.com/sourcegraph/sourcegraph/issues/57659

Test plan

  • Updated snapshot tests for C# and Python.
  • Added new snapshot tests for Ruby (they were missing)
  • Manually compared to universal ctags output

@cla-bot cla-bot bot added the cla-signed label Oct 24, 2023
@jtibshirani
Copy link
Member Author

jtibshirani commented Oct 24, 2023

There are some differences with universal-ctags, most of which are positive.

C-sharp

  • constructors have their own constructor kind, instead of just being mapped to method
  • lambda functions are property, not method
  • expression-bodied members are correctly classified as property vs. method, instead of always being method

Python

  • member is split into field and method
  • We don't emit variables if they are within while or for
  • We don't emit nested functions

Ruby

  • singletonMethod is just method, since SCIP doesn't have "singleton method"
  • alias method is just method, since SCIP doesn't have "method alias"
  • accessors are mapped to property, since SCIP doesn't have "accessor"

@jtibshirani jtibshirani marked this pull request as ready for review October 25, 2023 00:00
@jtibshirani jtibshirani requested review from olafurpg and a team October 25, 2023 00:00
@varungandhi-src
Copy link
Contributor

@jtibshirani I've created a PR to add the missing kinds you noted in sourcegraph/scip#209

@jtibshirani
Copy link
Member Author

@jtibshirani I've created a PR to add the missing kinds you noted in sourcegraph/scip#209

Thank you @varungandhi-src ! I guess I'll wait for a new SCIP release, then update the PR with the new version + kinds.

@varungandhi-src
Copy link
Contributor

varungandhi-src commented Oct 25, 2023

@jtibshirani
Copy link
Member Author

This is ready for another look. Summary of changes:

  • Update SCIP to latest version
  • Use the new available kinds (accessor, method alias, singleton method, delegate)
  • Fix some issues with Ruby (use getter and setter instead of property, make sure we tag method alias correctly)
  • Make sure all tags output is in camel case for consistency

@jtibshirani jtibshirani requested a review from olafurpg October 26, 2023 14:58
@jtibshirani jtibshirani merged commit cc4f7ee into main Oct 26, 2023
5 checks passed
@jtibshirani jtibshirani deleted the jtibs/scip-ctags branch October 26, 2023 15:02
jtibshirani added a commit that referenced this pull request Nov 1, 2023
Added more fine-grained kinds for C#, Python, and Ruby to better match the universal-ctags output.

Addresses https://github.com/sourcegraph/sourcegraph/issues/57659
keegancsmith pushed a commit that referenced this pull request Nov 2, 2023
* SCIP syntax: add more kinds for go ctags (#57806)

This change adds fine-grained kinds to the Go ctags output. Specific changes:
* Split `type` into `interface`, `struct`, and `typealias`
* Map struct members to `field` instead of `variable`

Universal ctags does not have a clear spec, and some languages use different
names for the same kind. So my strategy is not to match universal ctags
exactly, but just to capture the correct SCIP kinds. Clients need to handle the
fact that the kind names can be different.

* SCIP ctags: add kinds for C#, Python, Ruby (#57879)

Added more fine-grained kinds for C#, Python, and Ruby to better match the universal-ctags output.

Addresses https://github.com/sourcegraph/sourcegraph/issues/57659

* Add scip-ctags kinds for js, ts, and rust (#57899)

* SCIP ctags: use MethodSpec kind for Go (#57929)

Now that MethodSpec is available in SCIP, we can use it in the Go SCIP ctags
output.

* SCIP ctags: add kinds for Kotlin (#57998)

Improved ctags kind output for Kotlin:
* Split type into class, interface, object, and enum
* Split variable into enumMember, constant, and property
* Add type alias

* Fix snapshot tests by adding back trailing whitespace

Our precommit hook removes trailing whitespace, but the generated snapshots
include it.

---------

Co-authored-by: Auguste Rame <[email protected]>
vovakulikov pushed a commit that referenced this pull request Dec 12, 2023
Added more fine-grained kinds for C#, Python, and Ruby to better match the universal-ctags output.

Addresses https://github.com/sourcegraph/sourcegraph/issues/57659
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants