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

CsCompleter: Implement GoToDocumentOutline. #1723

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

teasp00n
Copy link
Contributor

@teasp00n teasp00n commented Jan 1, 2024

Implements GoToDocumentOutline in the CsCompleter to support YCMFindSymbolInDocument functionality for cs projects.


This change is Reviewable

@teasp00n teasp00n force-pushed the feature/cs-document-outline branch from 47452fd to de2fa09 Compare January 1, 2024 03:24
Copy link
Collaborator

@bstaletic bstaletic left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request!
Would you mind taking a look at subcommands_test.py and adding a test (or two, another for the error case)?
If you need assistence, feel free to hop over to our gitter channel.

Reviewable status: 0 of 2 LGTMs obtained

Copy link
Collaborator

@bstaletic bstaletic left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 LGTMs obtained (waiting on @teasp00n)


ycmd/completers/cs/cs_completer.py line 686 at r1 (raw file):

      return goto_locations
    else:
      raise RuntimeError( 'No symbols found' )

I can't seem to find the definition of QuickFix, but does this cover the case of zero identifiers in a file, or just things like "file not found"?

Copy link
Collaborator

@bstaletic bstaletic left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 4 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: 0 of 2 LGTMs obtained (waiting on @teasp00n)


ycmd/completers/cs/cs_completer.py line 686 at r1 (raw file):

Previously, bstaletic (Boris Staletic) wrote…

I can't seem to find the definition of QuickFix, but does this cover the case of zero identifiers in a file, or just things like "file not found"?

We normally do throw an exception when an error occurs, or the response is empty.
Something like raise RuntimeError('No definitions found.'), because thetn the clients know to display that error to users, instead of just silently doing nothing.

We could debate whether exceptions are the right way to handle this, but after 10 years, this is pretty firmly baked into ycmd's API.

To be precise:

  • If we have 1+ refs in the response, we should return the list.
  • Otherwise we should throw.

Copy link
Member

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

:lgtm:

Thanks so much!

Reviewed 2 of 4 files at r3, 2 of 2 files at r5, all commit messages.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @teasp00n)

Copy link
Member

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

can we squash the commits?

Reviewable status: 0 of 2 LGTMs obtained (and 1 stale) (waiting on @teasp00n)

Copy link
Member

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: 0 of 2 LGTMs obtained (and 1 stale) (waiting on @teasp00n)

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Merging #1723 (3a07ac6) into master (9e43034) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1723   +/-   ##
=======================================
  Coverage   95.46%   95.47%           
=======================================
  Files          83       83           
  Lines        8162     8175   +13     
  Branches      163      163           
=======================================
+ Hits         7792     7805   +13     
  Misses        320      320           
  Partials       50       50           

@teasp00n teasp00n force-pushed the feature/cs-document-outline branch from 3a07ac6 to 1c87c74 Compare January 2, 2024 22:24
@puremourning puremourning added the Ship It! Manual override to merge a PR by maintainer label Jan 2, 2024
Copy link
Member

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 0 of 2 LGTMs obtained (and 1 stale) (waiting on @teasp00n)

Copy link
Member

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 1 of 2 LGTMs obtained (waiting on @teasp00n)

Copy link
Member

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 1 of 2 LGTMs obtained (waiting on @teasp00n)

Copy link
Member

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 1 of 2 LGTMs obtained (waiting on @teasp00n)

@puremourning puremourning dismissed bstaletic’s stale review January 2, 2024 22:26

implemented in recent changes.

Copy link
Member

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

Dismissed @bstaletic from a discussion.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @teasp00n)

Copy link
Contributor

mergify bot commented Jan 2, 2024

Thanks for sending a PR!

@mergify mergify bot merged commit d73494d into ycm-core:master Jan 2, 2024
14 checks passed
bstaletic added a commit to ycm-core/YouCompleteMe that referenced this pull request Feb 18, 2024
Changes since the last update:

ycm-core/ycmd#1728 YcmShowDetailedDiagnostic should now match what is echoed on the command line.
ycm-core/ycmd#1731 Add support for `workspace/didChangeWorkspaceFolders` LSP notification.
ycm-core/ycmd#1730 LSP servers are now updated with latest server state afer reset
ycm-core/ycmd#1727 Update JDT to version 1.31.0
ycm-core/ycmd#1726 C# symbol search filtering fix
ycm-core/ycmd#1724 C# GoToDocumentOutline consistency patch
ycm-core/ycmd#1723 Implement GoToDocumentOutline in C#
ycm-core/ycmd#1716 Display tsserver tags in detailed info and GetDoc

`workspace/didChangeWorkspaceFolders` seems to be working fine for java,
rust and go, but should be considered experimental. Definitely more
field experience is needed.
What it should do is allow LSP servers to understand multiple projects
in the same vim instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ship It! Manual override to merge a PR by maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants