-
Notifications
You must be signed in to change notification settings - Fork 18
implement textDocument/willSaveWaitUntil #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,6 +150,7 @@ impl LspServer { | |
| Logger::info(&format!("emacs_envs: {}", &emacs_envs)); | ||
|
|
||
| let mut child; | ||
| let root_dir = root_uri.strip_prefix("file://").unwrap_or(&root_uri); | ||
| if !emacs_envs.is_empty() { | ||
| let envs = serde_json::from_str::<HashMap<String, String>>(&emacs_envs); | ||
| match envs { | ||
|
|
@@ -160,21 +161,23 @@ impl LspServer { | |
| .stdout(Stdio::piped()) | ||
| .stderr(Stdio::piped()) | ||
| .envs(envs) | ||
| .spawn(); | ||
| .current_dir(root_dir) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is setting current dir necessary? If not set, will anything not work properly? or is it just a good coding practice?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry this is an unrelated change I added to my fork, I did this so that rust-analyzer would pick up overrides correctly (i.e. using nightly rust in projects where I did
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll remove this change and put it in a separate PR if you want
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sure, please, thanks. |
||
| .spawn(); | ||
| } | ||
| Err(e) => { | ||
| Logger::error(&format!( | ||
| "deserializing emacs_envs failed with error {:?}", e | ||
| )); | ||
| return None; | ||
| } | ||
| } | ||
| } | ||
| } else { | ||
| child = Command::new(cmd) | ||
| .args(args) | ||
| .stdin(Stdio::piped()) | ||
| .stdout(Stdio::piped()) | ||
| .stderr(Stdio::piped()) | ||
| .current_dir(root_dir) | ||
| .spawn(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we can make two improvements here. 1. Adding a customizable variable to control whether sending this request or not. 2. Is it better to make this 1 customizable too?
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll add a customizable variable