MCPcopy Create free account
hub / github.com/VSCodeConfigHelper/v4 / scan

Function scan

src-tauri/src/steps/vscode.rs:30–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29#[cfg(target_os = "windows")]
30pub fn scan() -> Option<String> {
31 let cmd = winreg::get(
32 winreg::HKEY_CLASSES_ROOT,
33 "vscode\\shell\\open\\command",
34 "",
35 )?;
36 debug!("vscode:// 的注册表项:{}", &cmd);
37 // The value should be like:
38 // "C:\Program Files\Microsoft VS Code\Code.exe" --open-url -- "%1"
39 // and we just use the string inside the first quotation marks
40 let parts = cmd.split("\"").nth(1)?;
41 match verify(parts) {
42 Ok(_) => Some(parts.to_string()),
43 Err(_) => None,
44 }
45}
46
47#[cfg(target_os = "linux")]
48pub fn scan() -> Option<String> {

Callers 2

vscode_scanFunction · 0.50
vscodeFunction · 0.50

Calls 3

getFunction · 0.85
to_stringMethod · 0.80
verifyFunction · 0.70

Tested by

no test coverage detected