Skip to content

Commit

Permalink
Add .svn as workspace root marker (helix-editor#11429)
Browse files Browse the repository at this point in the history
* add .svn as workspace-root marker

* cargo fmt
  • Loading branch information
oworope authored and plul committed Oct 13, 2024
1 parent 084028f commit 1ba12f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions helix-loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,16 @@ pub fn merge_toml_values(left: toml::Value, right: toml::Value, merge_depth: usi
/// Used as a ceiling dir for LSP root resolution, the filepicker and potentially as a future filewatching root
///
/// This function starts searching the FS upward from the CWD
/// and returns the first directory that contains either `.git` or `.helix`.
/// and returns the first directory that contains either `.git`, `.svn` or `.helix`.
/// If no workspace was found returns (CWD, true).
/// Otherwise (workspace, false) is returned
pub fn find_workspace() -> (PathBuf, bool) {
let current_dir = current_working_dir();
for ancestor in current_dir.ancestors() {
if ancestor.join(".git").exists() || ancestor.join(".helix").exists() {
if ancestor.join(".git").exists()
|| ancestor.join(".svn").exists()
|| ancestor.join(".helix").exists()
{
return (ancestor.to_owned(), false);
}
}
Expand Down

0 comments on commit 1ba12f8

Please sign in to comment.