Update the inlay hint after receiving the notification. (#3561)

This commit is contained in:
ifengqi 2024-10-02 20:56:49 +08:00 committed by GitHub
parent 44a9bf7fb5
commit 061c986c85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,4 @@
# The run config is used for both run mode and debug mode
[[configs]]
@ -7,7 +8,7 @@ name = "task"
# the type of the debugger. If not set, it can't be debugged but can still be run
# type = "lldb"
# the program to run
# the program to run, e.g. "${workspace}\\target\\debug\\check.exe"
program = ""
# the program arguments, e.g. args = ["arg1", "arg2"], optional

View File

@ -801,8 +801,7 @@ pub fn expand(
} else {
(run_debug.program.clone(), run_debug.args.clone())
};
let program = if program == "${lapce}" {
let mut program = if program == "${lapce}" {
std::env::current_exe().map_err(|e| {
anyhow!("Failed to get current exe for ${{lapce}} run and debug: {e}")
})?.to_str().ok_or_else(|| anyhow!("Failed to convert ${{lapce}} path to str"))?.to_string()
@ -810,6 +809,13 @@ pub fn expand(
program
};
if program.contains("${workspace}") {
if let Some(workspace) = workspace.path.as_ref().and_then(|x| x.to_str())
{
program = program.replace("${workspace}", workspace);
}
}
if let Some(args) = &mut args {
for arg in args {
// Replace all mentions of ${workspace} with the current workspace path