lsp/python: Temporarily report just a singular workspace folder instead of all of the roots (#35243)
Temporarily fixes #29133 Co-authored-by: Cole <cole@zed.dev> Release Notes: - python: Zed now reports a slightly different set of workspace folders for Python projects to work around quirks in handling of multi-lsp projects with virtual environment. This behavior will be revisited in a near future. Co-authored-by: Cole <cole@zed.dev>
This commit is contained in:
parent
d2ef287791
commit
e5269212ad
5 changed files with 76 additions and 27 deletions
|
@ -313,6 +313,15 @@ impl Attach {
|
|||
}
|
||||
}
|
||||
|
||||
/// Determines what gets sent out as a workspace folders content
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum WorkspaceFoldersContent {
|
||||
/// Send out a single entry with the root of the workspace.
|
||||
WorktreeRoot,
|
||||
/// Send out a list of subproject roots.
|
||||
SubprojectRoots,
|
||||
}
|
||||
|
||||
/// [`LspAdapterDelegate`] allows [`LspAdapter]` implementations to interface with the application
|
||||
// e.g. to display a notification or fetch data from the web.
|
||||
#[async_trait]
|
||||
|
@ -606,6 +615,13 @@ pub trait LspAdapter: 'static + Send + Sync {
|
|||
Attach::Shared
|
||||
}
|
||||
|
||||
/// Determines whether a language server supports workspace folders.
|
||||
///
|
||||
/// And does not trip over itself in the process.
|
||||
fn workspace_folders_content(&self) -> WorkspaceFoldersContent {
|
||||
WorkspaceFoldersContent::SubprojectRoots
|
||||
}
|
||||
|
||||
fn manifest_name(&self) -> Option<ManifestName> {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue