-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use config file when workspace folder absent
fixes #31
- Loading branch information
Showing
5 changed files
with
115 additions
and
15 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 |
---|---|---|
|
@@ -36,4 +36,5 @@ jobs: | |
- run: cargo test | ||
env: | ||
RUST_LOG: debug,globset=warn | ||
RUST_BACKTRACE: 1 | ||
|
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 +1,2 @@ | ||
pub mod lsp; | ||
pub mod windows; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#[cfg(windows)] | ||
extern "C" { | ||
// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlogicaldrives | ||
pub fn GetLogicalDrives() -> u32; | ||
} | ||
|
||
#[cfg(windows)] | ||
pub fn get_drives() -> Vec<String> { | ||
let mut drives = Vec::new(); | ||
let mut bitmask = unsafe { GetLogicalDrives() }; | ||
let mut letter = b'A'; | ||
while bitmask > 0 { | ||
if bitmask & 1 != 0 { | ||
drives.push((letter as char).into()); | ||
} | ||
bitmask >>= 1; | ||
letter += 1; | ||
} | ||
drives | ||
} |
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