-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #131075 - mrkajetanp:bootstrap-editors, r=Kobzol
bootstrap: Consolidate editor setup into ./x setup editor & add support for vim, emacs & helix Add support for automatically setting up the recommended LSP config for Vim (coc-nvim), Emacs (eglot) and Helix. Additionally, refactor setup.rs to make it easier to add support for more editors in the future. As suggested, r? `@jieyouxu`
- Loading branch information
Showing
7 changed files
with
193 additions
and
80 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
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,16 +1,17 @@ | ||
use sha2::Digest; | ||
|
||
use super::{RUST_ANALYZER_SETTINGS, SETTINGS_HASHES}; | ||
use super::EditorKind; | ||
use crate::utils::helpers::hex_encode; | ||
|
||
#[test] | ||
fn check_matching_settings_hash() { | ||
let editor = EditorKind::Vscode; | ||
let mut hasher = sha2::Sha256::new(); | ||
hasher.update(&RUST_ANALYZER_SETTINGS); | ||
hasher.update(&editor.settings_template()); | ||
let hash = hex_encode(hasher.finalize().as_slice()); | ||
assert_eq!( | ||
&hash, | ||
SETTINGS_HASHES.last().unwrap(), | ||
"Update `SETTINGS_HASHES` with the new hash of `src/etc/rust_analyzer_settings.json`" | ||
editor.hashes().last().unwrap(), | ||
"Update `EditorKind::hashes()` with the new hash of `src/etc/rust_analyzer_settings.json`" | ||
); | ||
} |
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
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