-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed comments between ProcessConfig braces.
- Loading branch information
Showing
5 changed files
with
63 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,28 @@ | ||
use lsp_types::Url; | ||
|
||
pub mod moos; | ||
pub mod nsplug; | ||
|
||
/// Find a file relative to a parent URL. | ||
/// | ||
/// TODO: This should really search the workspace, but for now we will | ||
/// assume this can search the local file system. | ||
fn find_relative_file(parent_url: &Url, file_name: &str) -> Option<Url> { | ||
if parent_url.scheme() == "file" { | ||
let parent_path = std::path::Path::new(parent_url.path()); | ||
if parent_path.exists() && parent_path.is_file() { | ||
if let Some(parent_dir) = parent_path.parent() { | ||
let include_path = parent_dir.join(file_name.to_string()); | ||
if include_path.exists() && include_path.is_file() { | ||
let mut new_url = parent_url.clone(); | ||
if let Some(path_str) = include_path.to_str() { | ||
new_url.set_path(path_str); | ||
return Some(new_url); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
return None; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters