ycm-core / ycmd

A code-completion & code-comprehension server
https://ycm-core.github.io/ycmd/
GNU General Public License v3.0
1.69k stars 764 forks source link

[READY] Add support for didChangeWorkspaceFolders #1731

Closed bstaletic closed 6 months ago

bstaletic commented 7 months ago

Perhaps it's finally time to add this capability...

There are a couple missing pieces:

  1. So far, this does not take into account the extra confs.
  2. Clangd completer does not have GetProjectRootFiles() implemented, but also clangd does not want to listen to this notification. I guess it knows better than us?
  3. Java completer also does not have GetProjectRootFiles() implemented, but actually wants this notification.
  4. Do we need _project_directory and _server_workspace_dirs?
  5. Tests... after we figure out the answers to the above!

This change is Reviewable

codecov[bot] commented 7 months ago

Codecov Report

Merging #1731 (3de31d7) into master (f11e293) will increase coverage by 0.09%. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1731 +/- ## ========================================== + Coverage 95.43% 95.52% +0.09% ========================================== Files 83 83 Lines 8168 8185 +17 Branches 163 163 ========================================== + Hits 7795 7819 +24 + Misses 323 316 -7 Partials 50 50 ```
bstaletic commented 7 months ago

This pull request actually allows rust-analyzer to report diagnostics for two projects opened in the same vim instance. For example:

  1. ycmd/tests/rust/testdata/common
  2. ycmd/tests/rust/testdata/macro
bstaletic commented 7 months ago

Rebased.

This pull request is behaving correctly for rust, go and java. C++ server does not support this notification and we respect that.

Other than that, I have tried it with haskell and it did what I expected, but haskell server does not really do anything with the notification.

mergify[bot] commented 6 months ago

Thanks for sending a PR!