Commit Graph
3306 Commits
Author SHA1 Message Date
Antonio Scandurra a472da27df 🎨 2022-07-01 14:11:21 +02:00
Keith Simmons c5e9c15115 Restart language server using original root path rather than the path of the buffer restarted from 2022-06-30 19:11:21 -07:00
Max Brunsfeld 3e742d4acb WIP - try representing snapshots_to_send as a watch 2022-06-30 18:04:31 -07:00
Keith Simmons bc2362e330 Clear language server id for all worktrees when stopping a language server 2022-06-30 17:50:30 -07:00
Keith Simmons b806797b0a Fix failing test due to change in stop_language_server function 2022-06-30 17:40:50 -07:00
Keith Simmons 2ded6ce4ff add assertion to test_definition ensuring no new language servers are created 2022-06-30 17:24:32 -07:00
Keith Simmons 2846accbd0 Minor comment change 2022-06-30 17:18:28 -07:00
Keith Simmons 05fec8cf52 add a comment explaining the three language server collections on project 2022-06-30 17:09:23 -07:00
Keith Simmons 0744db7a9c Kill starting servers as well as currently running ones 2022-06-30 17:00:29 -07:00
Keith Simmons d6fdc079a9 Prevent creating extra language server instances if there already exists one for that workspace 2022-06-30 16:46:26 -07:00
Max Brunsfeld 722b4037bf Don't update worktrees' snapshots in the middle of processing fs events 2022-06-30 15:46:31 -07:00
Max Brunsfeld 8054274a83 Stop waiting for snapshot updates when disconnected from host 2022-06-30 15:07:40 -07:00
Antonio Scandurra 5921d5bf0f Ensure newer snapshots are always detected in wait_for_snapshot 2022-06-30 18:04:19 +02:00
Antonio Scandurra c18607bf40 Split worktree updates when a peer joins an already-shared project 2022-06-30 16:49:56 +02:00
Antonio Scandurra 632e3eb1cb Respond to join project request before sharing project completes
This ensures the guest doesn't observe a huge delay when joining.
2022-06-30 14:29:06 +02:00
Antonio Scandurra f174a355bf Split worktree updates and only send 256 entries at a time 2022-06-30 14:06:41 +02:00
Antonio Scandurra 85986a03d0 Coalesce as many fs events as possible before processing them 2022-06-30 10:20:46 +02:00
Antonio Scandurra 8bfba99e4f Keep looking for a newer snapshot before broadcasting it 2022-06-30 09:54:14 +02:00
Max Brunsfeld 9e077356b1 Only send one UpdateProject msg when changing project's online status 2022-06-29 17:58:02 -07:00
Antonio ScandurraandNathan Sobo 1be4549c4e Send extension counts when metadata changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 17:58:11 +02:00
Antonio ScandurraandNathan Sobo e70d1e6bdd Skip ignored entries when recording worktree extensions
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 17:00:16 +02:00
Antonio ScandurraandNathan Sobo 1ada2ebacb Record worktree extensions every 5 minutes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 16:58:19 +02:00
Antonio ScandurraandNathan Sobo 723c4f5606 Maintain extension counts on local worktrees
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 16:38:24 +02:00
Antonio Scandurra 6ea7ada031 Don't share a project unless it's online and we're allowing a request 2022-06-29 15:16:55 +02:00
Antonio Scandurra 2bff764afa Register project activity for offline projects as well 2022-06-29 14:55:04 +02:00
Max Brunsfeld 3973098faf Exclude hidden worktrees from project's diagnostic summaries 2022-06-28 14:23:24 -07:00
Max Brunsfeld 3f4c0add6a Allow diagnostics to be published for hidden worktrees 2022-06-28 13:31:04 -07:00
Antonio Scandurra 7787ac3b6c Ignore tokens that were not created via WorkDoneProgressCreate
With the new version of rust-analyzer, we were seeing stray `WorkDoneProgress::End`
messages that create an imbalance in the `pending_diagnostic_updates` that never
resolves. This was causing the diagnostic status bar item to never update because
we wouldn't emit `DiskBasedDiagnosticsStarted` nor `DiskBasedDiagnosticsFinished`.

This commit fixes the above situation by only acknowledging progress report for tokens
that have explicitly been created via the `WorkDoneProgressCreate` request, as stated
by the protocol.

In addition to that, we are replacing the `pending_diagnostic_updates: isize` with
a `has_pending_diagnostic_updates: bool`. We added it at some point to prevent a similar
issue where we would observe begin/end reports in a seemingly random order, which would cause
us to permanently display a `checking...` message in the status bar. I believe this commit
fixes that as well because the `isize` was just a less general solution for the same
underlying issue. As the protocol states: "the token provided in the create request should
only be used once (e.g. only one begin, many report and one end notification should be sent
to it)."
2022-06-28 10:08:43 +02:00
Keith Simmons 72723ce560 Address hover panic and add hint to install go when language server failed to install 2022-06-27 15:48:15 -07:00
Keith Simmons ffb933f79a Merge pull request #1237 from zed-industries/jump-to-definition
Mouse jump to definition
2022-06-27 15:20:07 -07:00
Antonio Scandurra faf645bbe8 Don't stop scanning directory if reading one of the children errors 2022-06-27 08:40:37 +02:00
Keith Simmons a76be2126c working jump to definition with tests 2022-06-24 15:09:31 -07:00
Keith Simmons b2c6087d10 Working underline based on symbol origin 2022-06-24 15:05:35 -07:00
Keith Simmons 5c67560264 Use NonZeroU32 to ensure settings tabsize cannot be zero 2022-06-23 12:55:38 -07:00
Antonio ScandurraandNathan Sobo c737c7c3f7 Don't override top-level settings with language defaults
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-23 16:40:57 +02:00
Antonio ScandurraandMax Brunsfeld 1a3d3f300c Don't wait for host's worktree updates if they disconnected
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-22 19:45:55 +02:00
Antonio Scandurra b62f125aa9 Update project metadata when releasing a worktree's weak handle
When a project was getting unshared, we would remove invisible worktrees
from the project's state without notifying the server, which was causing
the randomized tests to fail.

This commit calls `Project::remove_worktree` when a worktree's handle gets
released. Doing so ensures that we update both our local metadata database
as well as the state on the server.
2022-06-22 10:26:10 +02:00
Antonio ScandurraandMax Brunsfeld e4981d98ab Report running language servers when sharing project for the first time
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-21 20:39:54 +02:00
Antonio Scandurra 42064f76b0 Don't compute fingerprint for every text summary 2022-06-17 15:15:27 +02:00
Antonio Scandurra 5ad9e9e6c8 Determine Buffer::is_dirty based on the rope's fingerprint 2022-06-17 12:38:25 +02:00
Antonio Scandurra 306b76e782 Use word boundaries instead of syntax to infer completion edit ranges 2022-06-16 11:27:22 +02:00
Antonio Scandurra b3b0c32b8c Add failing test for wrong typescript completion 2022-06-16 11:26:35 +02:00
Antonio Scandurra e627636760 Track active projects in metrics
An active project is defined as a project where there has been at
least a buffer edit, a join request/response, or a follow update
in the last minute.
2022-06-15 10:33:20 +02:00
Keith Simmons 9f53cfb758 Fix delayed lsp request 2022-06-09 17:03:45 -07:00
Max Brunsfeld 2e11995a75 Merge pull request #1155 from zed-industries/golang
Add Go support
2022-06-09 14:18:37 -07:00
Max Brunsfeld 3a848da1eb Ignore completions from gopls that we can't yet handle
We only support additionalEdits if they are provided when resolving the
completion, not if they are provided immediately.
2022-06-09 13:08:08 -07:00
Antonio Scandurra ec99b1ca50 Remove language server statuses synchronously when stopping a server 2022-06-09 10:59:02 +02:00
Antonio Scandurra e19d19ba7a Add unit test to ensure changing enable_language_server works 2022-06-09 10:48:06 +02:00
Antonio Scandurra be274c940e Start/stop language servers when enable_language_server changes 2022-06-09 10:08:11 +02:00
Antonio Scandurra bd0a466807 Extract a Project::stop_language_server method when restarting server
This will be useful later to stop a language server when detecting
configuration changes.
2022-06-09 10:05:35 +02:00