Skip to content

Commit

Permalink
Allow discoverBuckTargets with no documents
Browse files Browse the repository at this point in the history
Summary: If given no documents, just immediately return the current set of projects. This essentially allows us to ask the server for the current set of projects. This is used in the next diff to support simultaneous editing in fbsource and aosp.

Reviewed By: Wilfred

Differential Revision: D55899017

fbshipit-source-id: 4d60264e6ae1ae3bc440fcfa5b538df87ce8a6a2
  • Loading branch information
darichey authored and facebook-github-bot committed Apr 9, 2024
1 parent b0ff717 commit e5492aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions integrations/rust-project/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ fn handle_discover_buck_targets(
let State {
server, projects, ..
} = state;

if params.text_documents.is_empty() {
return Ok(DiscoverBuckTargetsResult::Many(projects.clone()));
}

let develop = Develop::new();

// this request is load-bearing: it is necessary in order to start showing in-editor progress.
Expand Down

0 comments on commit e5492aa

Please sign in to comment.