From 6ba46e5cbf599fc1c68399f055e7db9666c22111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 7 Aug 2024 06:46:59 +0900 Subject: [PATCH 01/41] Fix crossterm compilation on macOS --- Cargo.lock | 1 + helix-term/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 9393ffec6..269437f61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,6 +271,7 @@ dependencies = [ "crossterm_winapi", "filedescriptor", "futures-core", + "libc", "mio", "parking_lot", "rustix", diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 3859da5eb..6e27b00f5 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -77,7 +77,7 @@ signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } libc = "0.2.155" [target.'cfg(target_os = "macos")'.dependencies] -crossterm = { version = "0.28", features = ["event-stream", "use-dev-tty"] } +crossterm = { version = "0.28", features = ["event-stream", "use-dev-tty", "libc"] } [build-dependencies] helix-loader = { path = "../helix-loader" } From 8f6793a18189b61c47bf32b08b589b34a614ccb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 7 Aug 2024 07:18:43 +0900 Subject: [PATCH 02/41] stdx: Include all required windows-sys APIs --- helix-stdx/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-stdx/Cargo.toml b/helix-stdx/Cargo.toml index 4279c8375..8d8f6b84f 100644 --- a/helix-stdx/Cargo.toml +++ b/helix-stdx/Cargo.toml @@ -20,7 +20,7 @@ regex-cursor = "0.1.4" bitflags = "2.6" [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.59", features = ["Win32_Security", "Win32_Security_Authorization", "Win32_System_Threading"] } +windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_Security", "Win32_Security_Authorization", "Win32_Storage_FileSystem", "Win32_System_Threading"] } [target.'cfg(unix)'.dependencies] rustix = { version = "0.38", features = ["fs"] } From 7d017d8fd6b3587789fe650f0b829bf9ef3e4174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 7 Aug 2024 07:21:50 +0900 Subject: [PATCH 03/41] stdx: PSID now sits under Win32::Foundation --- helix-stdx/src/faccess.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-stdx/src/faccess.rs b/helix-stdx/src/faccess.rs index 6be6bdd83..d4224bb94 100644 --- a/helix-stdx/src/faccess.rs +++ b/helix-stdx/src/faccess.rs @@ -85,7 +85,7 @@ mod imp { #[cfg(windows)] mod imp { - use windows_sys::Win32::Foundation::{CloseHandle, LocalFree, ERROR_SUCCESS, HANDLE, PSID}; + use windows_sys::Win32::Foundation::{CloseHandle, LocalFree, ERROR_SUCCESS, HANDLE}; use windows_sys::Win32::Security::Authorization::{ GetNamedSecurityInfoW, SetNamedSecurityInfoW, SE_FILE_OBJECT, }; @@ -95,7 +95,7 @@ mod imp { SecurityImpersonation, ACCESS_ALLOWED_CALLBACK_ACE, ACL, ACL_SIZE_INFORMATION, DACL_SECURITY_INFORMATION, GENERIC_MAPPING, GROUP_SECURITY_INFORMATION, INHERITED_ACE, LABEL_SECURITY_INFORMATION, OBJECT_SECURITY_INFORMATION, OWNER_SECURITY_INFORMATION, - PRIVILEGE_SET, PROTECTED_DACL_SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, + PRIVILEGE_SET, PROTECTED_DACL_SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, PSID, SID_IDENTIFIER_AUTHORITY, TOKEN_DUPLICATE, TOKEN_QUERY, }; use windows_sys::Win32::Storage::FileSystem::{ From 0929704699ec14e6d4770ddc345a80225a8a7fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 7 Aug 2024 07:29:35 +0900 Subject: [PATCH 04/41] stdx: ...and this cast is now unnecessary --- helix-stdx/src/faccess.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-stdx/src/faccess.rs b/helix-stdx/src/faccess.rs index d4224bb94..e4c3daf25 100644 --- a/helix-stdx/src/faccess.rs +++ b/helix-stdx/src/faccess.rs @@ -419,7 +419,7 @@ mod imp { pub fn hardlink_count(p: &Path) -> std::io::Result { let file = std::fs::File::open(p)?; - let handle = file.as_raw_handle() as isize; + let handle = file.as_raw_handle(); let mut info: BY_HANDLE_FILE_INFORMATION = unsafe { std::mem::zeroed() }; if unsafe { GetFileInformationByHandle(handle, &mut info) } == 0 { From 518425e0552483fa40c6e6ab4d0ea7358e0101be Mon Sep 17 00:00:00 2001 From: Jefta Date: Thu, 8 Aug 2024 20:57:59 +0200 Subject: [PATCH 05/41] Add commands for movement by subwords (#8147) * Allow moving by subword * Add tests for subword movement --- helix-core/src/movement.rs | 405 +++++++++++++++++++++++++++++++++++++ helix-term/src/commands.rs | 40 ++++ 2 files changed, 445 insertions(+) diff --git a/helix-core/src/movement.rs b/helix-core/src/movement.rs index f5c2b2ed5..e446d8cc4 100644 --- a/helix-core/src/movement.rs +++ b/helix-core/src/movement.rs @@ -197,13 +197,31 @@ pub fn move_prev_long_word_end(slice: RopeSlice, range: Range, count: usize) -> word_move(slice, range, count, WordMotionTarget::PrevLongWordEnd) } +pub fn move_next_sub_word_start(slice: RopeSlice, range: Range, count: usize) -> Range { + word_move(slice, range, count, WordMotionTarget::NextSubWordStart) +} + +pub fn move_next_sub_word_end(slice: RopeSlice, range: Range, count: usize) -> Range { + word_move(slice, range, count, WordMotionTarget::NextSubWordEnd) +} + +pub fn move_prev_sub_word_start(slice: RopeSlice, range: Range, count: usize) -> Range { + word_move(slice, range, count, WordMotionTarget::PrevSubWordStart) +} + +pub fn move_prev_sub_word_end(slice: RopeSlice, range: Range, count: usize) -> Range { + word_move(slice, range, count, WordMotionTarget::PrevSubWordEnd) +} + fn word_move(slice: RopeSlice, range: Range, count: usize, target: WordMotionTarget) -> Range { let is_prev = matches!( target, WordMotionTarget::PrevWordStart | WordMotionTarget::PrevLongWordStart + | WordMotionTarget::PrevSubWordStart | WordMotionTarget::PrevWordEnd | WordMotionTarget::PrevLongWordEnd + | WordMotionTarget::PrevSubWordEnd ); // Special-case early-out. @@ -383,6 +401,12 @@ pub enum WordMotionTarget { NextLongWordEnd, PrevLongWordStart, PrevLongWordEnd, + // A sub word is similar to a regular word, except it is also delimited by + // underscores and transitions from lowercase to uppercase. + NextSubWordStart, + NextSubWordEnd, + PrevSubWordStart, + PrevSubWordEnd, } pub trait CharHelpers { @@ -398,8 +422,10 @@ impl CharHelpers for Chars<'_> { target, WordMotionTarget::PrevWordStart | WordMotionTarget::PrevLongWordStart + | WordMotionTarget::PrevSubWordStart | WordMotionTarget::PrevWordEnd | WordMotionTarget::PrevLongWordEnd + | WordMotionTarget::PrevSubWordEnd ); // Reverse the iterator if needed for the motion direction. @@ -476,6 +502,25 @@ fn is_long_word_boundary(a: char, b: char) -> bool { } } +fn is_sub_word_boundary(a: char, b: char, dir: Direction) -> bool { + match (categorize_char(a), categorize_char(b)) { + (CharCategory::Word, CharCategory::Word) => { + if (a == '_') != (b == '_') { + return true; + } + + // Subword boundaries are directional: in 'fooBar', there is a + // boundary between 'o' and 'B', but not between 'B' and 'a'. + match dir { + Direction::Forward => a.is_lowercase() && b.is_uppercase(), + Direction::Backward => a.is_uppercase() && b.is_lowercase(), + } + } + (a, b) if a != b => true, + _ => false, + } +} + fn reached_target(target: WordMotionTarget, prev_ch: char, next_ch: char) -> bool { match target { WordMotionTarget::NextWordStart | WordMotionTarget::PrevWordEnd => { @@ -494,6 +539,22 @@ fn reached_target(target: WordMotionTarget, prev_ch: char, next_ch: char) -> boo is_long_word_boundary(prev_ch, next_ch) && (!prev_ch.is_whitespace() || char_is_line_ending(next_ch)) } + WordMotionTarget::NextSubWordStart => { + is_sub_word_boundary(prev_ch, next_ch, Direction::Forward) + && (char_is_line_ending(next_ch) || !(next_ch.is_whitespace() || next_ch == '_')) + } + WordMotionTarget::PrevSubWordEnd => { + is_sub_word_boundary(prev_ch, next_ch, Direction::Backward) + && (char_is_line_ending(next_ch) || !(next_ch.is_whitespace() || next_ch == '_')) + } + WordMotionTarget::NextSubWordEnd => { + is_sub_word_boundary(prev_ch, next_ch, Direction::Forward) + && (!(prev_ch.is_whitespace() || prev_ch == '_') || char_is_line_ending(next_ch)) + } + WordMotionTarget::PrevSubWordStart => { + is_sub_word_boundary(prev_ch, next_ch, Direction::Backward) + && (!(prev_ch.is_whitespace() || prev_ch == '_') || char_is_line_ending(next_ch)) + } } } @@ -1012,6 +1073,178 @@ mod test { } } + #[test] + fn test_behaviour_when_moving_to_start_of_next_sub_words() { + let tests = [ + ( + "NextSubwordStart", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 11)), + ], + ), + ( + "next_subword_start", + vec![ + (1, Range::new(0, 0), Range::new(0, 5)), + (1, Range::new(4, 4), Range::new(5, 13)), + ], + ), + ( + "Next_Subword_Start", + vec![ + (1, Range::new(0, 0), Range::new(0, 5)), + (1, Range::new(4, 4), Range::new(5, 13)), + ], + ), + ( + "NEXT_SUBWORD_START", + vec![ + (1, Range::new(0, 0), Range::new(0, 5)), + (1, Range::new(4, 4), Range::new(5, 13)), + ], + ), + ( + "next subword start", + vec![ + (1, Range::new(0, 0), Range::new(0, 5)), + (1, Range::new(4, 4), Range::new(5, 13)), + ], + ), + ( + "Next Subword Start", + vec![ + (1, Range::new(0, 0), Range::new(0, 5)), + (1, Range::new(4, 4), Range::new(5, 13)), + ], + ), + ( + "NEXT SUBWORD START", + vec![ + (1, Range::new(0, 0), Range::new(0, 5)), + (1, Range::new(4, 4), Range::new(5, 13)), + ], + ), + ( + "next__subword__start", + vec![ + (1, Range::new(0, 0), Range::new(0, 6)), + (1, Range::new(4, 4), Range::new(4, 6)), + (1, Range::new(5, 5), Range::new(6, 15)), + ], + ), + ( + "Next__Subword__Start", + vec![ + (1, Range::new(0, 0), Range::new(0, 6)), + (1, Range::new(4, 4), Range::new(4, 6)), + (1, Range::new(5, 5), Range::new(6, 15)), + ], + ), + ( + "NEXT__SUBWORD__START", + vec![ + (1, Range::new(0, 0), Range::new(0, 6)), + (1, Range::new(4, 4), Range::new(4, 6)), + (1, Range::new(5, 5), Range::new(6, 15)), + ], + ), + ]; + + for (sample, scenario) in tests { + for (count, begin, expected_end) in scenario.into_iter() { + let range = move_next_sub_word_start(Rope::from(sample).slice(..), begin, count); + assert_eq!(range, expected_end, "Case failed: [{}]", sample); + } + } + } + + #[test] + fn test_behaviour_when_moving_to_end_of_next_sub_words() { + let tests = [ + ( + "NextSubwordEnd", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 11)), + ], + ), + ( + "next subword end", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 12)), + ], + ), + ( + "Next Subword End", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 12)), + ], + ), + ( + "NEXT SUBWORD END", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 12)), + ], + ), + ( + "next_subword_end", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 12)), + ], + ), + ( + "Next_Subword_End", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 12)), + ], + ), + ( + "NEXT_SUBWORD_END", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 12)), + ], + ), + ( + "next__subword__end", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 13)), + (1, Range::new(5, 5), Range::new(5, 13)), + ], + ), + ( + "Next__Subword__End", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 13)), + (1, Range::new(5, 5), Range::new(5, 13)), + ], + ), + ( + "NEXT__SUBWORD__END", + vec![ + (1, Range::new(0, 0), Range::new(0, 4)), + (1, Range::new(4, 4), Range::new(4, 13)), + (1, Range::new(5, 5), Range::new(5, 13)), + ], + ), + ]; + + for (sample, scenario) in tests { + for (count, begin, expected_end) in scenario.into_iter() { + let range = move_next_sub_word_end(Rope::from(sample).slice(..), begin, count); + assert_eq!(range, expected_end, "Case failed: [{}]", sample); + } + } + } + #[test] fn test_behaviour_when_moving_to_start_of_next_long_words() { let tests = [ @@ -1181,6 +1414,92 @@ mod test { } } + #[test] + fn test_behaviour_when_moving_to_start_of_previous_sub_words() { + let tests = [ + ( + "PrevSubwordEnd", + vec![ + (1, Range::new(13, 13), Range::new(14, 11)), + (1, Range::new(11, 11), Range::new(11, 4)), + ], + ), + ( + "prev subword end", + vec![ + (1, Range::new(15, 15), Range::new(16, 13)), + (1, Range::new(12, 12), Range::new(13, 5)), + ], + ), + ( + "Prev Subword End", + vec![ + (1, Range::new(15, 15), Range::new(16, 13)), + (1, Range::new(12, 12), Range::new(13, 5)), + ], + ), + ( + "PREV SUBWORD END", + vec![ + (1, Range::new(15, 15), Range::new(16, 13)), + (1, Range::new(12, 12), Range::new(13, 5)), + ], + ), + ( + "prev_subword_end", + vec![ + (1, Range::new(15, 15), Range::new(16, 13)), + (1, Range::new(12, 12), Range::new(13, 5)), + ], + ), + ( + "Prev_Subword_End", + vec![ + (1, Range::new(15, 15), Range::new(16, 13)), + (1, Range::new(12, 12), Range::new(13, 5)), + ], + ), + ( + "PREV_SUBWORD_END", + vec![ + (1, Range::new(15, 15), Range::new(16, 13)), + (1, Range::new(12, 12), Range::new(13, 5)), + ], + ), + ( + "prev__subword__end", + vec![ + (1, Range::new(17, 17), Range::new(18, 15)), + (1, Range::new(13, 13), Range::new(14, 6)), + (1, Range::new(14, 14), Range::new(15, 6)), + ], + ), + ( + "Prev__Subword__End", + vec![ + (1, Range::new(17, 17), Range::new(18, 15)), + (1, Range::new(13, 13), Range::new(14, 6)), + (1, Range::new(14, 14), Range::new(15, 6)), + ], + ), + ( + "PREV__SUBWORD__END", + vec![ + (1, Range::new(17, 17), Range::new(18, 15)), + (1, Range::new(13, 13), Range::new(14, 6)), + (1, Range::new(14, 14), Range::new(15, 6)), + ], + ), + ]; + + for (sample, scenario) in tests { + for (count, begin, expected_end) in scenario.into_iter() { + let range = move_prev_sub_word_start(Rope::from(sample).slice(..), begin, count); + assert_eq!(range, expected_end, "Case failed: [{}]", sample); + } + } + } + #[test] fn test_behaviour_when_moving_to_start_of_previous_long_words() { let tests = [ @@ -1444,6 +1763,92 @@ mod test { } } + #[test] + fn test_behaviour_when_moving_to_end_of_previous_sub_words() { + let tests = [ + ( + "PrevSubwordEnd", + vec![ + (1, Range::new(13, 13), Range::new(14, 11)), + (1, Range::new(11, 11), Range::new(11, 4)), + ], + ), + ( + "prev subword end", + vec![ + (1, Range::new(15, 15), Range::new(16, 12)), + (1, Range::new(12, 12), Range::new(12, 4)), + ], + ), + ( + "Prev Subword End", + vec![ + (1, Range::new(15, 15), Range::new(16, 12)), + (1, Range::new(12, 12), Range::new(12, 4)), + ], + ), + ( + "PREV SUBWORD END", + vec![ + (1, Range::new(15, 15), Range::new(16, 12)), + (1, Range::new(12, 12), Range::new(12, 4)), + ], + ), + ( + "prev_subword_end", + vec![ + (1, Range::new(15, 15), Range::new(16, 12)), + (1, Range::new(12, 12), Range::new(12, 4)), + ], + ), + ( + "Prev_Subword_End", + vec![ + (1, Range::new(15, 15), Range::new(16, 12)), + (1, Range::new(12, 12), Range::new(12, 4)), + ], + ), + ( + "PREV_SUBWORD_END", + vec![ + (1, Range::new(15, 15), Range::new(16, 12)), + (1, Range::new(12, 12), Range::new(12, 4)), + ], + ), + ( + "prev__subword__end", + vec![ + (1, Range::new(17, 17), Range::new(18, 13)), + (1, Range::new(13, 13), Range::new(13, 4)), + (1, Range::new(14, 14), Range::new(15, 13)), + ], + ), + ( + "Prev__Subword__End", + vec![ + (1, Range::new(17, 17), Range::new(18, 13)), + (1, Range::new(13, 13), Range::new(13, 4)), + (1, Range::new(14, 14), Range::new(15, 13)), + ], + ), + ( + "PREV__SUBWORD__END", + vec![ + (1, Range::new(17, 17), Range::new(18, 13)), + (1, Range::new(13, 13), Range::new(13, 4)), + (1, Range::new(14, 14), Range::new(15, 13)), + ], + ), + ]; + + for (sample, scenario) in tests { + for (count, begin, expected_end) in scenario.into_iter() { + let range = move_prev_sub_word_end(Rope::from(sample).slice(..), begin, count); + assert_eq!(range, expected_end, "Case failed: [{}]", sample); + } + } + } + #[test] fn test_behaviour_when_moving_to_end_of_next_long_words() { let tests = [ diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 4e97f36b3..835283ada 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -269,6 +269,10 @@ impl MappableCommand { move_prev_long_word_start, "Move to start of previous long word", move_next_long_word_end, "Move to end of next long word", move_prev_long_word_end, "Move to end of previous long word", + move_next_sub_word_start, "Move to start of next sub word", + move_prev_sub_word_start, "Move to start of previous sub word", + move_next_sub_word_end, "Move to end of next sub word", + move_prev_sub_word_end, "Move to end of previous sub word", move_parent_node_end, "Move to end of the parent node", move_parent_node_start, "Move to beginning of the parent node", extend_next_word_start, "Extend to start of next word", @@ -279,6 +283,10 @@ impl MappableCommand { extend_prev_long_word_start, "Extend to start of previous long word", extend_next_long_word_end, "Extend to end of next long word", extend_prev_long_word_end, "Extend to end of prev long word", + extend_next_sub_word_start, "Extend to start of next sub word", + extend_prev_sub_word_start, "Extend to start of previous sub word", + extend_next_sub_word_end, "Extend to end of next sub word", + extend_prev_sub_word_end, "Extend to end of prev sub word", extend_parent_node_end, "Extend to end of the parent node", extend_parent_node_start, "Extend to beginning of the parent node", find_till_char, "Move till next occurrence of char", @@ -1126,6 +1134,22 @@ fn move_next_long_word_end(cx: &mut Context) { move_word_impl(cx, movement::move_next_long_word_end) } +fn move_next_sub_word_start(cx: &mut Context) { + move_word_impl(cx, movement::move_next_sub_word_start) +} + +fn move_prev_sub_word_start(cx: &mut Context) { + move_word_impl(cx, movement::move_prev_sub_word_start) +} + +fn move_prev_sub_word_end(cx: &mut Context) { + move_word_impl(cx, movement::move_prev_sub_word_end) +} + +fn move_next_sub_word_end(cx: &mut Context) { + move_word_impl(cx, movement::move_next_sub_word_end) +} + fn goto_para_impl(cx: &mut Context, move_fn: F) where F: Fn(RopeSlice, Range, usize, Movement) -> Range + 'static, @@ -1362,6 +1386,22 @@ fn extend_next_long_word_end(cx: &mut Context) { extend_word_impl(cx, movement::move_next_long_word_end) } +fn extend_next_sub_word_start(cx: &mut Context) { + extend_word_impl(cx, movement::move_next_sub_word_start) +} + +fn extend_prev_sub_word_start(cx: &mut Context) { + extend_word_impl(cx, movement::move_prev_sub_word_start) +} + +fn extend_prev_sub_word_end(cx: &mut Context) { + extend_word_impl(cx, movement::move_prev_sub_word_end) +} + +fn extend_next_sub_word_end(cx: &mut Context) { + extend_word_impl(cx, movement::move_next_sub_word_end) +} + /// Separate branch to find_char designed only for `` char. // // This is necessary because the one document can have different line endings inside. And we From 9678c3fe60499c35df55ab784a132df36a946e8f Mon Sep 17 00:00:00 2001 From: yehor <64604791+oworope@users.noreply.github.com> Date: Fri, 9 Aug 2024 18:23:27 +0300 Subject: [PATCH 06/41] Add .svn as workspace root marker (#11429) * add .svn as workspace-root marker * cargo fmt --- helix-loader/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index badb9bd64..f36c76c4f 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -225,13 +225,16 @@ pub fn merge_toml_values(left: toml::Value, right: toml::Value, merge_depth: usi /// Used as a ceiling dir for LSP root resolution, the filepicker and potentially as a future filewatching root /// /// This function starts searching the FS upward from the CWD -/// and returns the first directory that contains either `.git` or `.helix`. +/// and returns the first directory that contains either `.git`, `.svn` or `.helix`. /// If no workspace was found returns (CWD, true). /// Otherwise (workspace, false) is returned pub fn find_workspace() -> (PathBuf, bool) { let current_dir = current_working_dir(); for ancestor in current_dir.ancestors() { - if ancestor.join(".git").exists() || ancestor.join(".helix").exists() { + if ancestor.join(".git").exists() + || ancestor.join(".svn").exists() + || ancestor.join(".helix").exists() + { return (ancestor.to_owned(), false); } } From ca47b3c140bbe223e1a734d9459ea92fbbc02d6e Mon Sep 17 00:00:00 2001 From: Raph Date: Fri, 9 Aug 2024 14:23:42 -0100 Subject: [PATCH 07/41] Added `mesonlsp` as the default LSP for Meson (#11416) * defaulted meson to JCWasmx86/mesonlsp * generated docs for mesonlsp --- book/src/generated/lang-support.md | 2 +- languages.toml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 9c88b7a20..e3e59c5f5 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -125,7 +125,7 @@ | markdown.inline | ✓ | | | | | matlab | ✓ | ✓ | ✓ | | | mermaid | ✓ | | | | -| meson | ✓ | | ✓ | | +| meson | ✓ | | ✓ | `mesonlsp` | | mint | | | | `mint` | | mojo | ✓ | ✓ | ✓ | `mojo-lsp-server` | | move | ✓ | | | | diff --git a/languages.toml b/languages.toml index daf89a3d7..cb6a485a8 100644 --- a/languages.toml +++ b/languages.toml @@ -54,6 +54,7 @@ markdoc-ls = { command = "markdoc-ls", args = ["--stdio"] } markdown-oxide = { command = "markdown-oxide" } marksman = { command = "marksman", args = ["server"] } metals = { command = "metals", config = { "isHttpEnabled" = true, metals = { inlayHints = { typeParameters = {enable = true} , hintsInPatternMatch = {enable = true} } } } } +mesonlsp = { command = "mesonlsp", args = ["--lsp"] } mint = { command = "mint", args = ["ls"] } mojo-lsp = { command = "mojo-lsp-server" } nil = { command = "nil" } @@ -2143,6 +2144,7 @@ injection-regex = "meson" file-types = [{ glob = "meson.build" }, { glob = "meson.options" }, { glob = "meson_options.txt" }] comment-token = "#" indent = { tab-width = 2, unit = " " } +language-servers = ["mesonlsp"] [[grammar]] name = "meson" From f8f056d82fabb817086855203362fa469d1b0b34 Mon Sep 17 00:00:00 2001 From: David Else <12832280+David-Else@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:23:58 +0100 Subject: [PATCH 08/41] dark_plus: add picker highlights, update underlined modifier syntax, and tweak a few settings (#11415) --- runtime/themes/dark_plus.toml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime/themes/dark_plus.toml b/runtime/themes/dark_plus.toml index 77b9b3e7c..813eebf3c 100644 --- a/runtime/themes/dark_plus.toml +++ b/runtime/themes/dark_plus.toml @@ -1,7 +1,7 @@ # Author: David Else <12832280+David-Else@users.noreply.github.com> # SYNTAX -"attribute" = "fn_declaration" +"attribute" = "variable" "comment" = "dark_green" "constant" = "constant" "constant.builtin" = "blue2" @@ -39,10 +39,10 @@ # MARKUP "markup.heading" = { fg = "blue2", modifiers = ["bold"] } "markup.list" = "blue3" -"markup.bold" = { fg = "blue2", modifiers = ["bold"] } +"markup.bold" = { modifiers = ["bold"] } "markup.italic" = { modifiers = ["italic"] } "markup.strikethrough" = { modifiers = ["crossed_out"] } -"markup.link.url" = { modifiers = ["underlined"] } +"markup.link.url" = { underline.style= "line" } "markup.link.text" = "orange" "markup.quote" = "dark_green" "markup.raw" = "orange" @@ -57,7 +57,7 @@ # TODO: Alternate bg colour for `ui.cursor.match` and `ui.selection`. "ui.cursor" = { fg = "cursor", modifiers = ["reversed"] } "ui.cursor.primary" = { fg = "cursor", modifiers = ["reversed"] } -"ui.cursor.match" = { bg = "#3a3d41", modifiers = ["underlined"] } +"ui.cursor.match" = { bg = "#3a3d41", underline.style = "line" } "ui.selection" = { bg = "#3a3d41" } "ui.selection.primary" = { bg = "dark_blue" } "ui.linenr" = { fg = "dark_gray" } @@ -80,6 +80,8 @@ "ui.highlight.frameline" = { bg = "#4b4b18" } "ui.debug.active" = { fg = "#ffcc00" } "ui.debug.breakpoint" = { fg = "#e51400" } +"ui.picker.header.column" = { underline.style = "line" } +"ui.picker.header.column.active" = { fg ="white", underline.style = "line" } "warning" = { fg = "gold2" } "error" = { fg = "red" } "info" = { fg = "light_blue" } From c9c44528240af2e94f25635064983ae7d39884ef Mon Sep 17 00:00:00 2001 From: bilabila Date: Fri, 9 Aug 2024 23:24:19 +0800 Subject: [PATCH 09/41] Support i3wm and sway config (#11424) * Support i3wm and sway config better syntax highlight and fix comment string * typo --- languages.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/languages.toml b/languages.toml index cb6a485a8..5c8118da0 100644 --- a/languages.toml +++ b/languages.toml @@ -949,6 +949,8 @@ file-types = [ "tcshrc", "bashrc_Apple_Terminal", "zshrc_Apple_Terminal", + { glob = "i3/config" }, + { glob = "sway/config" }, { glob = "tmux.conf" }, { glob = ".bash_history" }, { glob = ".bash_login" }, From d6431f41d91e5c2cc8d56cd2617a21203a03d5a0 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Fri, 9 Aug 2024 08:25:06 -0700 Subject: [PATCH 10/41] Add TypeSpec support (#11412) * Add TypeSpec support Adds support for TypeSpec in helix. * Resolve PR comments * Pull in LICENSE Co-authored-by: Michael Davis --------- Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 18 +++ runtime/queries/typespec/highlights.scm | 177 +++++++++++++++++++++++ runtime/queries/typespec/indents.scm | 18 +++ runtime/queries/typespec/injections.scm | 5 + runtime/queries/typespec/textobjects.scm | 51 +++++++ 6 files changed, 270 insertions(+) create mode 100644 runtime/queries/typespec/highlights.scm create mode 100644 runtime/queries/typespec/indents.scm create mode 100644 runtime/queries/typespec/injections.scm create mode 100644 runtime/queries/typespec/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index e3e59c5f5..d53bd35f8 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -205,6 +205,7 @@ | tsx | ✓ | ✓ | ✓ | `typescript-language-server` | | twig | ✓ | | | | | typescript | ✓ | ✓ | ✓ | `typescript-language-server` | +| typespec | ✓ | ✓ | ✓ | `tsp-server` | | typst | ✓ | | | `tinymist`, `typst-lsp` | | ungrammar | ✓ | | | | | unison | ✓ | | ✓ | | diff --git a/languages.toml b/languages.toml index 5c8118da0..d834b964a 100644 --- a/languages.toml +++ b/languages.toml @@ -94,6 +94,7 @@ taplo = { command = "taplo", args = ["lsp", "stdio"] } templ = { command = "templ", args = ["lsp"] } terraform-ls = { command = "terraform-ls", args = ["serve"] } texlab = { command = "texlab" } +typespec = { command = "tsp-server", args = ["--stdio"] } vala-language-server = { command = "vala-language-server" } vhdl_ls = { command = "vhdl_ls", args = [] } vlang-language-server = { command = "v-analyzer" } @@ -767,6 +768,23 @@ indent = { tab-width = 2, unit = " " } name = "typescript" source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf", subpath = "typescript" } +[[language]] +name = "typespec" +scope = "source.typespec" +injection-regex = "(tsp|typespec)" +language-id = "typespec" +file-types = ["tsp"] +roots = ["tspconfig.yaml"] +auto-format = true +comment-token = "//" +block-comment-tokens = { start = "/*", end = "*/" } +language-servers = ["typespec"] +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "typespec" +source = { git = "https://github.com/happenslol/tree-sitter-typespec", rev = "0ee05546d73d8eb64635ed8125de6f35c77759fe" } + [[language]] name = "tsx" scope = "source.tsx" diff --git a/runtime/queries/typespec/highlights.scm b/runtime/queries/typespec/highlights.scm new file mode 100644 index 000000000..8b8aa4c3d --- /dev/null +++ b/runtime/queries/typespec/highlights.scm @@ -0,0 +1,177 @@ +; Keywords + +[ + "is" + "extends" + "valueof" +] @keyword.operator + +[ + "namespace" + "scalar" + "interface" + "alias" +] @keyword + +[ + "model" + "enum" + "union" +] @keyword.storage.type + +[ + "op" + "fn" + "dec" +] @keyword.function + +"extern" @keyword.storage.modifier + +[ + "import" + "using" +] @keyword.control.import + +[ + "(" + ")" + "{" + "}" + "<" + ">" + "[" + "]" +] @punctuation.bracket + +[ + "," + ";" + "." + ":" +] @punctuation.delimiter + +[ + "|" + "&" + "=" + "..." +] @operator + +"?" @punctuation.special + +; Imports + +(import_statement + (quoted_string_literal) @string.special.path) + +; Namespaces + +(using_statement + module: (identifier_or_member_expression) @namespace) + +(namespace_statement + name: (identifier_or_member_expression) @namespace) + +; Comments + +[ + (single_line_comment) +] @comment.line + +[ + (multi_line_comment) +] @comment.block + +; Decorators + +(decorator + "@" @attribute + name: (identifier_or_member_expression) @attribute) + +(augment_decorator_statement + name: (identifier_or_member_expression) @attribute) + +(decorator + (decorator_arguments) @variable.parameter) + +; Scalars + +(scalar_statement + name: (identifier) @type) + +; Models + +(model_statement + name: (identifier) @type) + +(model_property + name: (identifier) @variable.other.member) + +; Operations + +(operation_statement + name: (identifier) @function.method) + +(operation_arguments + (model_property + name: (identifier) @variable.parameter)) + +(template_parameter + name: (identifier) @type.parameter) + +(function_parameter + name: (identifier) @variable.parameter) + +; Interfaces + +(interface_statement + name: (identifier) @type) + +(interface_statement + (interface_body + (interface_member + (identifier) @function.method))) + +; Enums + +(enum_statement + name: (identifier) @type.enum) + +(enum_member + name: (identifier) @constant) + +; Unions + +(union_statement + name: (identifier) @type) + +(union_variant + name: (identifier) @type.enum.variant) + +; Aliases + +(alias_statement + name: (identifier) @type) + +; Built-in types + +[ + (quoted_string_literal) + (triple_quoted_string_literal) +] @string + +(escape_sequence) @constant.character.escape + +(boolean_literal) @constant.builtin.boolean + +[ + (decimal_literal) + (hex_integer_literal) + (binary_integer_literal) +] @constant.numeric.integer + +(builtin_type) @type.builtin + +; Identifiers + +(identifier_or_member_expression) @type diff --git a/runtime/queries/typespec/indents.scm b/runtime/queries/typespec/indents.scm new file mode 100644 index 000000000..aee01f35a --- /dev/null +++ b/runtime/queries/typespec/indents.scm @@ -0,0 +1,18 @@ +[ + (model_expression) + (tuple_expression) + (namespace_body) + (interface_body) + (union_body) + (enum_body) + (template_arguments) + (template_parameters) + (operation_arguments) +] @indent.begin + +[ + "}" + ")" + ">" + "]" +] @indent.end diff --git a/runtime/queries/typespec/injections.scm b/runtime/queries/typespec/injections.scm new file mode 100644 index 000000000..81d7734cb --- /dev/null +++ b/runtime/queries/typespec/injections.scm @@ -0,0 +1,5 @@ +([ + (single_line_comment) + (multi_line_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/typespec/textobjects.scm b/runtime/queries/typespec/textobjects.scm new file mode 100644 index 000000000..7ee1251c9 --- /dev/null +++ b/runtime/queries/typespec/textobjects.scm @@ -0,0 +1,51 @@ +; Classes + +(enum_statement + (enum_body) @class.inside) @class.around + +(model_statement + (model_expression) @class.inside) @class.around + +(union_statement + (union_body) @class.inside) @class.around + +; Interfaces + +(interface_statement + (interface_body + (interface_member) @function.around) @class.inside) @class.around + +; Comments + +[ + (single_line_comment) + (multi_line_comment) +] @comment.inside + +[ + (single_line_comment) + (multi_line_comment) +]+ @comment.around + +; Functions + +[ + (decorator) + (decorator_declaration_statement) + (function_declaration_statement) + (operation_statement) +] @function.around + +(function_parameter_list + (function_parameter)? @parameter.inside)* @function.inside + +(decorator_arguments + (expression_list + (_) @parameter.inside)*) @function.inside + +(operation_arguments + (model_property)? @parameter.inside)* @function.inside + +(template_parameters + (template_parameter_list + (template_parameter) @parameter.inside)) @function.inside From f52251960a40e7a345b4340ef214011eee6f4193 Mon Sep 17 00:00:00 2001 From: RoloEdits Date: Fri, 9 Aug 2024 08:26:09 -0700 Subject: [PATCH 11/41] fix(picker): no longer `trim` search pattern (#11406) --- helix-term/src/ui/picker/query.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/helix-term/src/ui/picker/query.rs b/helix-term/src/ui/picker/query.rs index e433a11fa..005ddee42 100644 --- a/helix-term/src/ui/picker/query.rs +++ b/helix-term/src/ui/picker/query.rs @@ -58,11 +58,16 @@ impl PickerQuery { () => { let key = field.take().unwrap_or(primary_field); + // Trims one space from the end, enabling leading and trailing + // spaces in search patterns, while also retaining spaces as separators + // between column filters. + let pat = text.strip_suffix(' ').unwrap_or(&text); + if let Some(pattern) = fields.get_mut(key) { pattern.push(' '); - pattern.push_str(text.trim()); + pattern.push_str(pat); } else { - fields.insert(key.clone(), text.trim().to_string()); + fields.insert(key.clone(), pat.to_string()); } text.clear(); }; From 931ddbb0779b0192e21ca7d15543f762b8b5a609 Mon Sep 17 00:00:00 2001 From: David Else <12832280+David-Else@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:26:19 +0100 Subject: [PATCH 12/41] Update HTML highlights (#11400) * Update HTML highlights * Update after review comments --- runtime/queries/html/highlights.scm | 36 +++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/runtime/queries/html/highlights.scm b/runtime/queries/html/highlights.scm index 99f39c95b..5dd61b7c0 100644 --- a/runtime/queries/html/highlights.scm +++ b/runtime/queries/html/highlights.scm @@ -1,13 +1,39 @@ (tag_name) @tag -(erroneous_end_tag_name) @tag.error +(erroneous_end_tag_name) @error (doctype) @constant (attribute_name) @attribute (comment) @comment -[ - "\"" - (attribute_value) -] @string +((attribute + (attribute_name) @_attr + (quoted_attribute_value (attribute_value) @markup.link.url)) + (#any-of? @_attr "href" "src")) + +((element + (start_tag + (tag_name) @_tag) + (text) @markup.link.label) + (#eq? @_tag "a")) + +(attribute [(attribute_value) (quoted_attribute_value)] @string) + +((element + (start_tag + (tag_name) @_tag) + (text) @markup.bold) + (#any-of? @_tag "strong" "b")) + +((element + (start_tag + (tag_name) @_tag) + (text) @markup.italic) + (#any-of? @_tag "em" "i")) + +((element + (start_tag + (tag_name) @_tag) + (text) @markup.strikethrough) + (#any-of? @_tag "s" "del")) [ "<" From 2f60c21727e53870e7315e6e3197d41e72499bd0 Mon Sep 17 00:00:00 2001 From: Val Packett Date: Fri, 9 Aug 2024 12:26:28 -0300 Subject: [PATCH 13/41] Add jq language support (#11393) jq is a language for manipulating JSON data: https://jqlang.github.io/jq/ --- book/src/generated/lang-support.md | 1 + languages.toml | 14 +++ runtime/queries/jq/highlights.scm | 160 +++++++++++++++++++++++++++++ runtime/queries/jq/injections.scm | 25 +++++ runtime/queries/jq/locals.scm | 12 +++ runtime/queries/jq/textobjects.scm | 8 ++ 6 files changed, 220 insertions(+) create mode 100644 runtime/queries/jq/highlights.scm create mode 100644 runtime/queries/jq/injections.scm create mode 100644 runtime/queries/jq/locals.scm create mode 100644 runtime/queries/jq/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index d53bd35f8..d22da10d9 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -97,6 +97,7 @@ | javascript | ✓ | ✓ | ✓ | `typescript-language-server` | | jinja | ✓ | | | | | jjdescription | ✓ | | | | +| jq | ✓ | ✓ | | `jq-lsp` | | jsdoc | ✓ | | | | | json | ✓ | ✓ | ✓ | `vscode-json-language-server` | | json5 | ✓ | | | | diff --git a/languages.toml b/languages.toml index d834b964a..3288788a2 100644 --- a/languages.toml +++ b/languages.toml @@ -44,6 +44,7 @@ haskell-language-server = { command = "haskell-language-server-wrapper", args = idris2-lsp = { command = "idris2-lsp" } intelephense = { command = "intelephense", args = ["--stdio"] } jdtls = { command = "jdtls" } +jq-lsp = { command = "jq-lsp" } jsonnet-language-server = { command = "jsonnet-language-server", args= ["-t", "--lint"] } julia = { command = "julia", timeout = 60, args = [ "--startup-file=no", "--history-file=no", "--quiet", "-e", "using LanguageServer; runserver()", ] } koka = { command = "koka", args = ["--language-server", "--lsstdio"] } @@ -3238,6 +3239,19 @@ text-width = 72 name = "jjdescription" source = { git = "https://github.com/kareigu/tree-sitter-jjdescription", rev = "2ddec6cad07b366aee276a608e1daa2c29d3caf2" } +[[language]] +name = "jq" +scope = "source.jq" +injection-regex = "jq" +file-types = ["jq"] +comment-token = "#" +language-servers = ["jq-lsp"] +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "jq" +source = { git = "https://github.com/flurie/tree-sitter-jq", rev = "13990f530e8e6709b7978503da9bc8701d366791" } + [[grammar]] name = "wren" source = { git = "https://git.sr.ht/~jummit/tree-sitter-wren", rev = "6748694be32f11e7ec6b5faeb1b48ca6156d4e06" } diff --git a/runtime/queries/jq/highlights.scm b/runtime/queries/jq/highlights.scm new file mode 100644 index 000000000..8cec2be90 --- /dev/null +++ b/runtime/queries/jq/highlights.scm @@ -0,0 +1,160 @@ +;; From nvim-treesitter, contributed by @ObserverOfTime et al. + +; Variables +(variable) @variable + +((variable) @constant.builtin + (#eq? @constant.builtin "$ENV")) + +((variable) @constant.builtin + (#eq? @constant.builtin "$__loc__")) + +; Properties +(index + (identifier) @variable.other.member) + +; Labels +(query + label: (variable) @label) + +(query + break_statement: (variable) @label) + +; Literals +(number) @constant.numeric + +(string) @string + +[ + "true" + "false" +] @constant.builtin.boolean + +"null" @type.builtin + +; Interpolation +[ + "\\(" + ")" +] @special + +; Format +(format) @attribute + +; Functions +(funcdef + (identifier) @function) + +(funcdefargs + (identifier) @variable.parameter) + +[ + "reduce" + "foreach" +] @function.builtin + +((funcname) @function + . + "(") + +; jq -n 'builtins | map(split("/")[0]) | unique | .[]' +((funcname) @function.builtin + (#any-of? @function.builtin + "IN" "INDEX" "JOIN" "abs" "acos" "acosh" "add" "all" "any" "arrays" "ascii_downcase" + "ascii_upcase" "asin" "asinh" "atan" "atan2" "atanh" "booleans" "bsearch" "builtins" "capture" + "cbrt" "ceil" "combinations" "contains" "copysign" "cos" "cosh" "debug" "del" "delpaths" "drem" + "empty" "endswith" "env" "erf" "erfc" "error" "exp" "exp10" "exp2" "explode" "expm1" "fabs" + "fdim" "finites" "first" "flatten" "floor" "fma" "fmax" "fmin" "fmod" "format" "frexp" + "from_entries" "fromdate" "fromdateiso8601" "fromjson" "fromstream" "gamma" "get_jq_origin" + "get_prog_origin" "get_search_list" "getpath" "gmtime" "group_by" "gsub" "halt" "halt_error" + "has" "hypot" "implode" "in" "index" "indices" "infinite" "input" "input_filename" + "input_line_number" "inputs" "inside" "isempty" "isfinite" "isinfinite" "isnan" "isnormal" + "iterables" "j0" "j1" "jn" "join" "keys" "keys_unsorted" "last" "ldexp" "length" "lgamma" + "lgamma_r" "limit" "localtime" "log" "log10" "log1p" "log2" "logb" "ltrimstr" "map" "map_values" + "match" "max" "max_by" "min" "min_by" "mktime" "modf" "modulemeta" "nan" "nearbyint" "nextafter" + "nexttoward" "normals" "not" "now" "nth" "nulls" "numbers" "objects" "path" "paths" "pick" "pow" + "pow10" "range" "recurse" "remainder" "repeat" "reverse" "rindex" "rint" "round" "rtrimstr" + "scalars" "scalb" "scalbln" "scan" "select" "setpath" "significand" "sin" "sinh" "sort" + "sort_by" "split" "splits" "sqrt" "startswith" "stderr" "strflocaltime" "strftime" "strings" + "strptime" "sub" "tan" "tanh" "test" "tgamma" "to_entries" "todate" "todateiso8601" "tojson" + "tonumber" "tostream" "tostring" "transpose" "trunc" "truncate_stream" "type" "unique" + "unique_by" "until" "utf8bytelength" "values" "walk" "while" "with_entries" "y0" "y1" "yn")) + +; Keywords +[ + "def" + "as" + "label" + "module" + "break" +] @keyword + +[ + "import" + "include" +] @keyword.control.import + +[ + "if" + "then" + "elif" + "else" + "end" +] @keyword.control.conditional + +[ + "try" + "catch" +] @keyword.control.exception + +[ + "or" + "and" +] @keyword.operator + +; Operators +[ + "." + "==" + "!=" + ">" + ">=" + "<=" + "<" + "=" + "+" + "-" + "*" + "/" + "%" + "+=" + "-=" + "*=" + "/=" + "%=" + "//=" + "|" + "?" + "//" + "?//" + (recurse) ; ".." +] @operator + +; Punctuation +[ + ";" + "," + ":" +] @punctuation.delimiter + +[ + "[" + "]" + "{" + "}" + "(" + ")" +] @punctuation.bracket + +; Comments +(comment) @comment.line diff --git a/runtime/queries/jq/injections.scm b/runtime/queries/jq/injections.scm new file mode 100644 index 000000000..ddfe53c3b --- /dev/null +++ b/runtime/queries/jq/injections.scm @@ -0,0 +1,25 @@ +;; From nvim-treesitter, contributed by @ObserverOfTime et al. + +((comment) @injection.content + (#set! injection.language "comment")) + +; test(val) +(query + ((funcname) @_function + (#any-of? @_function "test" "match" "capture" "scan" "split" "splits" "sub" "gsub")) + (args + . + (query + (string) @injection.content + (#set! injection.language "regex")))) + +; test(regex; flags) +(query + ((funcname) @_function + (#any-of? @_function "test" "match" "capture" "scan" "split" "splits" "sub" "gsub")) + (args + . + (args + (query + (string) @injection.content + (#set! injection.language "regex"))))) diff --git a/runtime/queries/jq/locals.scm b/runtime/queries/jq/locals.scm new file mode 100644 index 000000000..40946e7c3 --- /dev/null +++ b/runtime/queries/jq/locals.scm @@ -0,0 +1,12 @@ +;; From nvim-treesitter, contributed by @ObserverOfTime et al. + +(funcdef + (identifier) @local.definition) + +(funcdefargs + (identifier) @local.definition) + +(funcname) @local.reference + +(index + (identifier) @local.reference) diff --git a/runtime/queries/jq/textobjects.scm b/runtime/queries/jq/textobjects.scm new file mode 100644 index 000000000..ff078cd14 --- /dev/null +++ b/runtime/queries/jq/textobjects.scm @@ -0,0 +1,8 @@ +(comment) @comment.inside +(comment)+ @comment.around + +(funcdef + (query) @function.inside) @function.around + +(objectkeyval + (_) @entry.inside) @entry.around From 88510314492b3c80ba9e1e9f4b171fef55a660f4 Mon Sep 17 00:00:00 2001 From: lefp <70862148+lefp@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:26:34 -0400 Subject: [PATCH 14/41] add verilog comment textobjects (#11388) --- runtime/queries/verilog/textobjects.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/queries/verilog/textobjects.scm b/runtime/queries/verilog/textobjects.scm index f940832ab..0a2034dc2 100644 --- a/runtime/queries/verilog/textobjects.scm +++ b/runtime/queries/verilog/textobjects.scm @@ -3,4 +3,8 @@ (function_body_declaration (function_identifier (function_identifier - (simple_identifier) @function.inside)))) @function.around \ No newline at end of file + (simple_identifier) @function.inside)))) @function.around + +(comment) @comment.inside + +(comment)+ @comment.around From 68f495b0235e058cd6919141010d5112c4a48cbd Mon Sep 17 00:00:00 2001 From: Poliorcetics Date: Fri, 9 Aug 2024 17:26:48 +0200 Subject: [PATCH 15/41] just: Use updated grammar with recent language changes and correct highlighting (#11380) --- languages.toml | 2 +- runtime/queries/just/folds.scm | 2 - runtime/queries/just/highlights.scm | 94 +++++++++++++--------------- runtime/queries/just/indents.scm | 2 - runtime/queries/just/injections.scm | 16 +++-- runtime/queries/just/locals.scm | 19 +++--- runtime/queries/just/textobjects.scm | 13 ++-- 7 files changed, 67 insertions(+), 81 deletions(-) diff --git a/languages.toml b/languages.toml index 3288788a2..b1dfd0d6a 100644 --- a/languages.toml +++ b/languages.toml @@ -3105,7 +3105,7 @@ indent = { tab-width = 4, unit = " " } [[grammar]] name = "just" -source = { git = "https://github.com/IndianBoy42/tree-sitter-just", rev = "379fbe36d1e441bc9414ea050ad0c85c9d6935ea" } +source = { git = "https://github.com/poliorcetics/tree-sitter-just", rev = "f58a8fd869035ac4653081401e6c2030251240ab" } [[language]] name = "gn" diff --git a/runtime/queries/just/folds.scm b/runtime/queries/just/folds.scm index 77079fd4f..2640f4c4a 100644 --- a/runtime/queries/just/folds.scm +++ b/runtime/queries/just/folds.scm @@ -1,5 +1,3 @@ -; From - ; Define collapse points ([ diff --git a/runtime/queries/just/highlights.scm b/runtime/queries/just/highlights.scm index d5e5cc191..258fadb9e 100644 --- a/runtime/queries/just/highlights.scm +++ b/runtime/queries/just/highlights.scm @@ -1,5 +1,3 @@ -; From - ; This file specifies how matched syntax patterns should be highlighted [ @@ -26,35 +24,57 @@ (identifier) @variable) (alias - left: (identifier) @variable) + name: (identifier) @variable) (assignment - left: (identifier) @variable) + name: (identifier) @variable) -; Functions +(shell_variable_name) @variable -(recipe_header - name: (identifier) @function) +; Functions -(dependency +(recipe name: (identifier) @function) -(dependency_expression - name: (identifier) @function) +(recipe_dependency + name: (identifier) @function.call) (function_call - name: (identifier) @function) + name: (identifier) @function.builtin) ; Parameters -(parameter +(recipe_parameter name: (identifier) @variable.parameter) ; Namespaces -(module +(mod name: (identifier) @namespace) +; Paths + +(mod + (path) @string.special.path) + +(import + (path) @string.special.path) + +; Shebangs + +(shebang_line) @keyword.directive +(shebang_line + (shebang_shell) @string.special) + + +(shell_expanded_string + [ + (expansion_short_start) + (expansion_long_start) + (expansion_long_middle) + (expansion_long_end) + ] @punctuation.special) + ; Operators [ @@ -95,55 +115,31 @@ ; Literals -(boolean) @constant.builtin.boolean +; Booleans are not allowed anywhere except in settings +(setting + (boolean) @constant.builtin.boolean) [ (string) (external_command) ] @string -(escape_sequence) @constant.character.escape +[ + (escape_sequence) + (escape_variable_end) +] @constant.character.escape ; Comments (comment) @comment.line -(shebang) @keyword.directive - -; highlight known settings (filtering does not always work) +; highlight known settings (setting - left: (identifier) @keyword - (#any-of? @keyword - "allow-duplicate-recipes" - "dotenv-filename" - "dotenv-load" - "dotenv-path" - "export" - "fallback" - "ignore-comments" - "positional-arguments" - "shell" - "tempdi" - "windows-powershell" - "windows-shell")) - -; highlight known attributes (filtering does not always work) + name: (_) @keyword.function) + +; highlight known attributes (attribute - (identifier) @attribute - (#any-of? @attribute - "private" - "allow-duplicate-recipes" - "dotenv-filename" - "dotenv-load" - "dotenv-path" - "export" - "fallback" - "ignore-comments" - "positional-arguments" - "shell" - "tempdi" - "windows-powershell" - "windows-shell")) + name: (identifier) @attribute) ; Numbers are part of the syntax tree, even if disallowed (numeric_error) @error diff --git a/runtime/queries/just/indents.scm b/runtime/queries/just/indents.scm index 7cfca3d7e..c66dda4c3 100644 --- a/runtime/queries/just/indents.scm +++ b/runtime/queries/just/indents.scm @@ -1,5 +1,3 @@ -; From -; ; This query specifies how to auto-indent logical blocks. ; ; Better documentation with diagrams is in https://docs.helix-editor.com/guides/indent.html diff --git a/runtime/queries/just/injections.scm b/runtime/queries/just/injections.scm index 54393059b..39877be47 100644 --- a/runtime/queries/just/injections.scm +++ b/runtime/queries/just/injections.scm @@ -1,5 +1,3 @@ -; From -; ; Specify nested languages that live within a `justfile` ; ================ Always applicable ================ @@ -8,7 +6,7 @@ (#set! injection.language "comment")) ; Highlight the RHS of `=~` as regex -((regex_literal +((regex (_) @injection.content) (#set! injection.language "regex")) @@ -21,7 +19,7 @@ (#set! injection.include-children)) @injection.content (external_command - (command_body) @injection.content + (content) @injection.content (#set! injection.language "bash")) ; ================ Global language specified ================ @@ -43,7 +41,7 @@ ; they default to bash. Limitations... ; See https://github.com/tree-sitter/tree-sitter/issues/880 for more on that. -(source_file +(file (setting "shell" ":=" "[" (string) @_langstr (#match? @_langstr ".*(powershell|pwsh|cmd).*") (#set! injection.language "powershell")) @@ -57,10 +55,10 @@ (expression (value (external_command - (command_body) @injection.content)))) + (content) @injection.content)))) ]) -(source_file +(file (setting "shell" ":=" "[" (string) @injection.language (#not-match? @injection.language ".*(powershell|pwsh|cmd).*")) [ @@ -73,12 +71,12 @@ (expression (value (external_command - (command_body) @injection.content)))) + (content) @injection.content)))) ]) ; ================ Recipe language specified - Helix only ================ ; Set highlighting for recipes that specify a language using builtin shebang matching (recipe_body - (shebang) @injection.shebang + (shebang_line) @injection.shebang (#set! injection.include-children)) @injection.content diff --git a/runtime/queries/just/locals.scm b/runtime/queries/just/locals.scm index 827148a17..d612f5da4 100644 --- a/runtime/queries/just/locals.scm +++ b/runtime/queries/just/locals.scm @@ -1,5 +1,3 @@ -; From -; ; This file tells us about the scope of variables so e.g. local ; variables override global functions with the same name @@ -10,32 +8,29 @@ ; Definitions (alias - left: (identifier) @local.definition) + name: (identifier) @local.definition) (assignment - left: (identifier) @local.definition) + name: (identifier) @local.definition) -(module +(mod name: (identifier) @local.definition) -(parameter +(recipe_parameter name: (identifier) @local.definition) -(recipe_header +(recipe name: (identifier) @local.definition) ; References (alias - right: (identifier) @local.reference) - -(function_call name: (identifier) @local.reference) -(dependency +(function_call name: (identifier) @local.reference) -(dependency_expression +(recipe_dependency name: (identifier) @local.reference) (value diff --git a/runtime/queries/just/textobjects.scm b/runtime/queries/just/textobjects.scm index bb604178e..b60b11e4d 100644 --- a/runtime/queries/just/textobjects.scm +++ b/runtime/queries/just/textobjects.scm @@ -1,18 +1,19 @@ -; From -; ; Specify how to navigate around logical blocks in code +(assert_parameters + ((_) @parameter.inside . ","? @parameter.around)) @parameter.around + (recipe (recipe_body) @function.inside) @function.around -(parameters +(recipe_parameters ((_) @parameter.inside . ","? @parameter.around)) @parameter.around -(dependency_expression +(recipe_dependency (_) @parameter.inside) @parameter.around (function_call - arguments: (sequence - (expression) @parameter.inside) @parameter.around) @function.around + (function_parameters + ((_) @parameter.inside . ","? @parameter.around)) @parameter.around) @function.around (comment) @comment.around From aaaafb8f5f4be00f3ea7cde4089d98d02b1b31d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BA=A6=E8=8A=BD=E7=B3=96?= Date: Fri, 9 Aug 2024 23:26:58 +0800 Subject: [PATCH 16/41] feat: add thrift hightlight (#11367) --- book/src/generated/lang-support.md | 1 + languages.toml | 13 ++ runtime/queries/thrift/folds.scm | 12 ++ runtime/queries/thrift/highlights.scm | 211 ++++++++++++++++++++++++++ runtime/queries/thrift/injections.scm | 2 + runtime/queries/thrift/locals.scm | 51 +++++++ 6 files changed, 290 insertions(+) create mode 100644 runtime/queries/thrift/folds.scm create mode 100644 runtime/queries/thrift/highlights.scm create mode 100644 runtime/queries/thrift/injections.scm create mode 100644 runtime/queries/thrift/locals.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index d22da10d9..f8513ae74 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -200,6 +200,7 @@ | tcl | ✓ | | ✓ | | | templ | ✓ | | | `templ` | | tfvars | ✓ | | ✓ | `terraform-ls` | +| thrift | ✓ | | | | | todotxt | ✓ | | | | | toml | ✓ | ✓ | | `taplo` | | tsq | ✓ | | | | diff --git a/languages.toml b/languages.toml index b1dfd0d6a..d134a4a0c 100644 --- a/languages.toml +++ b/languages.toml @@ -3762,3 +3762,16 @@ grammar = "typescript" "{" = "}" "(" = ")" '"' = '"' + +[[language]] +name = "thrift" +scope = "source.thrift" +file-types = ["thrift"] +comment-token = "//" +block-comment-tokens = { start = "/*", end = "*/" } +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "thrift" +source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-thrift" , rev = "68fd0d80943a828d9e6f49c58a74be1e9ca142cf" } + diff --git a/runtime/queries/thrift/folds.scm b/runtime/queries/thrift/folds.scm new file mode 100644 index 000000000..1361be1f8 --- /dev/null +++ b/runtime/queries/thrift/folds.scm @@ -0,0 +1,12 @@ +[ + (annotation_definition) + (enum_definition) + (exception_definition) + (function_definition) + (senum_definition) + (service_definition) + (struct_definition) + (union_definition) + + (comment) +] @fold diff --git a/runtime/queries/thrift/highlights.scm b/runtime/queries/thrift/highlights.scm new file mode 100644 index 000000000..567c3f9dc --- /dev/null +++ b/runtime/queries/thrift/highlights.scm @@ -0,0 +1,211 @@ +; Variables + +((identifier) @variable) + +; Includes + +[ + "include" + "cpp_include" +] @keyword + +; Function + +(function_definition + (identifier) @function) + +; Fields + +(field (identifier) @variable.other.member) + +; Parameters + +(function_definition + (parameters + (parameter (identifier) @variable.parameter))) + +(throws + (parameters + (parameter (identifier) @keyword.control.exception))) + +; Types + +(typedef_identifier) @type +(struct_definition + "struct" (identifier) @type) + +(union_definition + "union" (identifier) @type) + +(exception_definition + "exception" (identifier) @type) + +(service_definition + "service" (identifier) @type) + +(interaction_definition + "interaction" (identifier) @type) + +(type + type: (identifier) @type) + +(definition_type + type: (identifier) @type) + +; Constants + +(const_definition (identifier) @constant) + +(enum_definition "enum" + . (identifier) @type + "{" (identifier) @constant "}") + +; Builtin Types + +(primitive) @type.builtin + +[ + "list" + "map" + "set" + "sink" + "stream" + "void" +] @type.builtin + +; Namespace + +(namespace_declaration + (namespace_scope) @tag + [(namespace) @namespace (_ (identifier) @namespace)]) + +; Attributes + +(annotation_definition + (annotation_identifier (identifier) @attribute)) +(fb_annotation_definition + "@" @attribute (annotation_identifier (identifier) @attribute) + (identifier)? @attribute) +(namespace_uri (string) @attribute) + +; Operators + +[ + "=" + "&" +] @operator + +; Exceptions + +[ + "throws" +] @keyword.control.exception + +; Keywords + +[ + "enum" + "exception" + "extends" + "interaction" + "namespace" + "senum" + "service" + "struct" + "typedef" + "union" + "uri" +] @keyword + +; Deprecated Keywords + +[ + "cocoa_prefix" + "cpp_namespace" + "csharp_namespace" + "delphi_namespace" + "java_package" + "perl_package" + "php_namespace" + "py_module" + "ruby_namespace" + "smalltalk_category" + "smalltalk_prefix" + "xsd_all" + "xsd_attrs" + "xsd_namespace" + "xsd_nillable" + "xsd_optional" +] @keyword + +; Extended Kewords +[ + "package" + "performs" +] @keyword + +[ + "async" + "oneway" +] @keyword + +; Qualifiers + +[ + "client" + "const" + "idempotent" + "optional" + "permanent" + "readonly" + "required" + "safe" + "server" + "stateful" + "transient" +] @type.directive + +; Literals + +(string) @string + +(escape_sequence) @constant.character.escape + +(namespace_uri + (string) @string.special) + +(number) @constant.numeric.integer + +(double) @constant.numeric.float + +(boolean) @constant.builtin.boolean + +; Typedefs + +(typedef_identifier) @type.definition + +; Punctuation + +[ + "*" +] @punctuation.special + +["{" "}"] @punctuation.bracket + +["(" ")"] @punctuation.bracket + +["[" "]"] @punctuation.bracket + +["<" ">"] @punctuation.bracket + +[ + "." + "," + ";" + ":" +] @punctuation.delimiter + +; Comments + +(comment) @comment + diff --git a/runtime/queries/thrift/injections.scm b/runtime/queries/thrift/injections.scm new file mode 100644 index 000000000..321c90add --- /dev/null +++ b/runtime/queries/thrift/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/thrift/locals.scm b/runtime/queries/thrift/locals.scm new file mode 100644 index 000000000..538b49962 --- /dev/null +++ b/runtime/queries/thrift/locals.scm @@ -0,0 +1,51 @@ +; Scopes + +[ + (document) + (definition) +] @local.scope + +; References + +(identifier) @local.reference + +; Definitions + +(annotation_identifier) @local.definition + +; (const_definition (identifier) @definition.constant) + +; (enum_definition "enum" +; . (identifier) @definition.enum +; "{" (identifier) @definition.constant "}") + +; (senum_definition "senum" +; . (identifier) @definition.enum) + +; (field (identifier) @definition.field) + +; (function_definition (identifier) @definition.function) + +; (namespace_declaration +; "namespace" (namespace_scope) +; . (_) @definition.namespace +; (namespace_uri)?) + +; (parameter (identifier) @definition.parameter) + +; (struct_definition +; "struct" . (identifier) @definition.type) + +; (union_definition +; "union" . (identifier) @definition.type) + +; (exception_definition +; "exception" . (identifier) @definition.type) + +; (service_definition +; "service" . (identifier) @definition.type) + +; (interaction_definition +; "interaction" . (identifier) @definition.type) + +; (typedef_identifier) @definition.type From f0282689da0ac4e5d7fe9f6bd739005138d64675 Mon Sep 17 00:00:00 2001 From: kanielrkirby <77940607+kanielrkirby@users.noreply.github.com> Date: Fri, 9 Aug 2024 10:32:46 -0500 Subject: [PATCH 17/41] Use `try_lock` in `diff_handle` for Diff gutter (#11092) * Use `try_lock` in `diff_handle` for Diff gutter - Add the method `try_load() -> Option` to `DiffHandle`, using `try_lock` to avoid deadlocks. - Use said method in `gutter.rs diff()`, which will use a blank `GutterFn` instead when met with a locked `Diff`. * Revert changes * Replace `Mutex` with `RwLock` in `Diff` --------- Co-authored-by: Kaniel Kirby --- helix-vcs/src/diff.rs | 10 +++++----- helix-vcs/src/diff/worker.rs | 6 +++--- helix-vcs/src/diff/worker/test.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/helix-vcs/src/diff.rs b/helix-vcs/src/diff.rs index 634b179b4..e49e171dd 100644 --- a/helix-vcs/src/diff.rs +++ b/helix-vcs/src/diff.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use helix_core::Rope; use helix_event::RenderLockGuard; use imara_diff::Algorithm; -use parking_lot::{Mutex, MutexGuard}; +use parking_lot::{RwLock, RwLockReadGuard}; use tokio::sync::mpsc::{unbounded_channel, UnboundedSender}; use tokio::task::JoinHandle; use tokio::time::Instant; @@ -37,7 +37,7 @@ struct DiffInner { #[derive(Clone, Debug)] pub struct DiffHandle { channel: UnboundedSender, - diff: Arc>, + diff: Arc>, inverted: bool, } @@ -48,7 +48,7 @@ impl DiffHandle { fn new_with_handle(diff_base: Rope, doc: Rope) -> (DiffHandle, JoinHandle<()>) { let (sender, receiver) = unbounded_channel(); - let diff: Arc> = Arc::default(); + let diff: Arc> = Arc::default(); let worker = DiffWorker { channel: receiver, diff: diff.clone(), @@ -70,7 +70,7 @@ impl DiffHandle { pub fn load(&self) -> Diff { Diff { - diff: self.diff.lock(), + diff: self.diff.read(), inverted: self.inverted, } } @@ -164,7 +164,7 @@ impl Hunk { /// non-overlapping order #[derive(Debug)] pub struct Diff<'a> { - diff: MutexGuard<'a, DiffInner>, + diff: RwLockReadGuard<'a, DiffInner>, inverted: bool, } diff --git a/helix-vcs/src/diff/worker.rs b/helix-vcs/src/diff/worker.rs index 3a9b6462c..578d8b8e7 100644 --- a/helix-vcs/src/diff/worker.rs +++ b/helix-vcs/src/diff/worker.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use helix_core::{Rope, RopeSlice}; use imara_diff::intern::InternedInput; -use parking_lot::Mutex; +use parking_lot::RwLock; use tokio::sync::mpsc::UnboundedReceiver; use tokio::sync::Notify; use tokio::time::{timeout, timeout_at, Duration}; @@ -21,7 +21,7 @@ mod test; pub(super) struct DiffWorker { pub channel: UnboundedReceiver, - pub diff: Arc>, + pub diff: Arc>, pub new_hunks: Vec, pub diff_finished_notify: Arc, } @@ -73,7 +73,7 @@ impl DiffWorker { /// `self.new_hunks` is always empty after this function runs. /// To improve performance this function tries to reuse the allocation of the old diff previously stored in `self.line_diffs` fn apply_hunks(&mut self, diff_base: Rope, doc: Rope) { - let mut diff = self.diff.lock(); + let mut diff = self.diff.write(); diff.diff_base = diff_base; diff.doc = doc; swap(&mut diff.hunks, &mut self.new_hunks); diff --git a/helix-vcs/src/diff/worker/test.rs b/helix-vcs/src/diff/worker/test.rs index a6cc89007..ab410bd82 100644 --- a/helix-vcs/src/diff/worker/test.rs +++ b/helix-vcs/src/diff/worker/test.rs @@ -12,7 +12,7 @@ impl DiffHandle { // dropping the channel terminates the task drop(self.channel); handle.await.unwrap(); - let diff = diff.lock(); + let diff = diff.read(); Vec::clone(&diff.hunks) } } From 2e90868a37a42e3c122acd1e56f5d0926d71d885 Mon Sep 17 00:00:00 2001 From: Sampo Siltanen <10105521+ssiltanen@users.noreply.github.com> Date: Fri, 9 Aug 2024 18:34:08 +0300 Subject: [PATCH 18/41] Update fsharp tree sitter repo reference (#11061) The repository reference used here was a fork from the actual repository, which has now been moved under ionide organization, where it is in active maintenance and development. The commit SHA is the currently latest commit from main branch. The injections.scm is copied as is from the fsharp treesitter repo [queries](https://github.com/ionide/tree-sitter-fsharp/blame/main/queries). The locals.scm is copied from the repo and the capture names are to follow the standard names: - Replace @local.definition.var @local.definition.function, and @local.definition.parameter with @local.definition - Remove (#set! "definition.function.scope" "parent") The highlights.scm is copied as well from the fsharp treesitter repo, but modified here to match helix highlight scopes based on my best guesstimates. The changes made: - Remove @spell scopes - Split @comment into @comment.line and @comment.block - Replace @comment.documentation with @comment.block.documentation - Replace @character.special with @special - Replace @variable.member with @variable.other.member - Replace @type.definition with @type - Replace @function.member with @function.method - Replace @module with @namespace - Replace @constant.macro with @function.macro - Replace @property with @variable.other.member - Replace @variable.member with @variable.other.member - Replace @variable.parameter.builtin with @variable.builtin - Replace @function.call with @function - Replace @number with @constant.numeric.integer and @constant.numeric.float - Replace @boolean with @constant.builtin.boolean - Replace @keyword.conditional with @keyword.control.conditional - Replace @keyword.return with @keyword.control.return - Replace @keyword.repeate with @keyword.control.repeat - Replace @keyword.import with @keyword.control.import - Replace @keyword.modifier with @keyword.storage.modifier - Replace @keyword.type with @keyword.storage.type - Replace @keyword.exception with @keyword.control.exception - Replace @module.builtin with @namespace --- languages.toml | 2 +- runtime/queries/fsharp/highlights.scm | 330 +++++++++++++++++++------- runtime/queries/fsharp/injections.scm | 8 + runtime/queries/fsharp/locals.scm | 47 ++-- 4 files changed, 278 insertions(+), 109 deletions(-) create mode 100644 runtime/queries/fsharp/injections.scm diff --git a/languages.toml b/languages.toml index d134a4a0c..afc8b641d 100644 --- a/languages.toml +++ b/languages.toml @@ -3162,7 +3162,7 @@ language-servers = ["fsharp-ls"] [[grammar]] name = "fsharp" -source = { git = "https://github.com/kaashyapan/tree-sitter-fsharp", rev = "18da392fd9bd5e79f357abcce13f61f3a15e3951" } +source = { git = "https://github.com/ionide/tree-sitter-fsharp", rev = "996ea9982bd4e490029f84682016b6793940113b" } [[language]] name = "t32" diff --git a/runtime/queries/fsharp/highlights.scm b/runtime/queries/fsharp/highlights.scm index 68b70ba7d..43905c882 100644 --- a/runtime/queries/fsharp/highlights.scm +++ b/runtime/queries/fsharp/highlights.scm @@ -1,16 +1,176 @@ ;; ---------------------------------------------------------------------------- ;; Literals and comments -[ - (line_comment) - (block_comment) - (block_comment_content) -] @comment +(line_comment) @comment.line + +(block_comment) @comment.block + +(xml_doc) @comment.block.documentation + +(const + [ + (_) @constant + (unit) @constant.builtin + ]) +(primary_constr_args (_) @variable.parameter) + +((identifier_pattern (long_identifier (identifier) @special)) + (#match? @special "^\_.*")) + +((long_identifier + (identifier)+ + . + (identifier) @variable.other.member)) ;; ---------------------------------------------------------------------------- ;; Punctuation +(wildcard_pattern) @string.special + +(type_name type_name: (_) @type) + +[ + (type) + (atomic_type) +] @type + +(member_signature + . + (identifier) @function.method + (curried_spec + (arguments_spec + "*"* @operator + (argument_spec + (argument_name_spec + "?"? @special + name: (_) @variable.parameter))))) + +(union_type_case) @constant + +(rules + (rule + pattern: (_) @constant + block: (_))) + +(identifier_pattern + . + (_) @constant + . + (_) @variable) + +(fsi_directive_decl . (string) @namespace) + +(import_decl . (_) @namespace) +(named_module + name: (_) @namespace) +(namespace + name: (_) @namespace) +(module_defn + . + (_) @namespace) + +(ce_expression + . + (_) @function.macro) + +(field_initializer + field: (_) @variable.other.member) + +(record_fields + (record_field + . + (identifier) @variable.other.member)) + +(dot_expression + base: (_) @namespace + field: (_) @variable.other.member) + +(value_declaration_left . (_) @variable) + +(function_declaration_left + . (_) @function + [ + (argument_patterns) + (argument_patterns (long_identifier (identifier))) + ] @variable.parameter) + +(member_defn + (method_or_prop_defn + [ + (property_or_ident) @function + (property_or_ident + instance: (identifier) @variable.builtin + method: (identifier) @function.method) + ] + args: (_)* @variable.parameter)) + +(application_expression + . + [ + (long_identifier_or_op [ + (long_identifier (identifier)* (identifier) @function) + (identifier) @function + ]) + (typed_expression . (long_identifier_or_op (long_identifier (identifier)* . (identifier) @function.call))) + (dot_expression base: (_) @variable.other.member field: (_) @function) + ] @function) + +((infix_expression + . + (_) + . + (infix_op) @operator + . + (_) @function + ) + (#eq? @operator "|>") + ) + +((infix_expression + . + (_) @function + . + (infix_op) @operator + . + (_) + ) + (#eq? @operator "<|") + ) + +[ + (xint) + (int) + (int16) + (uint16) + (int32) + (uint32) + (int64) + (uint64) + (nativeint) + (unativeint) +] @constant.numeric.integer + +[ + (ieee32) + (ieee64) + (float) + (decimal) +] @constant.numeric.float + +(bool) @constant.builtin.boolean + +([ + (string) + (triple_quoted_string) + (verbatim_string) + (char) +] @string) + +(compiler_directive_decl) @keyword.directive + +(attribute) @attribute + [ "(" ")" @@ -20,31 +180,40 @@ "]" "[|" "|]" + "{|" + "|}" "[<" ">]" ] @punctuation.bracket +(format_string_eval + [ + "{" + "}" + ] @punctuation.special) + [ - "," + "," ";" ] @punctuation.delimiter [ - "|" + "|" "=" ">" "<" "-" "~" + "->" + "<-" + "&&" + "||" + ":>" + ":?>" (infix_op) (prefix_op) - (symbolic_op) ] @operator - - -(attribute) @attribute - [ "if" "then" @@ -53,22 +222,29 @@ "when" "match" "match!" +] @keyword.control.conditional + +[ "and" "or" - "&&" - "||" - "then" -] @keyword.control.conditional + "not" + "upcast" + "downcast" +] @keyword.operator [ "return" "return!" + "yield" + "yield!" ] @keyword.control.return [ "for" "while" -] @keyword.control.return + "downto" + "to" +] @keyword.control.repeat [ @@ -82,115 +258,93 @@ "delegate" "static" "inline" - "internal" "mutable" "override" - "private" - "public" "rec" + "global" + (access_modifier) ] @keyword.storage.modifier [ - "enum" "let" "let!" + "use" + "use!" "member" - "module" - "namespace" +] @keyword.function + +[ + "enum" "type" -] @keyword.storage + "inherit" + "interface" +] @keyword.storage.type + +(try_expression + [ + "try" + "with" + "finally" + ] @keyword.control.exception) + +((identifier) @keyword.control.exception + (#any-of? @keyword.control.exception "failwith" "failwithf" "raise" "reraise")) [ "as" "assert" "begin" + "end" + "done" "default" + "in" "do" "do!" - "done" - "downcast" - "downto" - "end" "event" "field" - "finally" "fun" "function" "get" - "global" - "inherit" - "interface" + "set" "lazy" "new" - "not" - "null" "of" "param" "property" - "set" "struct" - "try" - "upcast" - "use" - "use!" "val" + "module" + "namespace" "with" - "yield" - "yield!" ] @keyword [ - "true" - "false" - "unit" - ] @constant.builtin - -[ - (type) - (const) -] @constant - -[ - (union_type_case) - (rules (rule (identifier_pattern))) -] @type.enum - -(fsi_directive_decl (string) @namespace) - -[ - (import_decl (long_identifier)) - (named_module (long_identifier)) - (namespace (long_identifier)) - (named_module - name: (long_identifier) ) - (namespace - name: (long_identifier) ) -] @namespace + "null" +] @constant.builtin +(match_expression "with" @keyword.control.conditional) -(dot_expression - base: (long_identifier_or_op) @variable.other.member - field: (long_identifier_or_op) @function) +((type + (long_identifier (identifier) @type.builtin)) + (#any-of? @type.builtin "bool" "byte" "sbyte" "int16" "uint16" "int" "uint" "int64" "uint64" "nativeint" "unativeint" "decimal" "float" "double" "float32" "single" "char" "string" "unit")) -[ - ;;(value_declaration_left (identifier_pattern) ) - (function_declaration_left (identifier) ) - (call_expression (long_identifier_or_op (long_identifier))) - ;;(application_expression (long_identifier_or_op (long_identifier))) -] @function +(preproc_if + [ + "#if" @keyword.directive + "#endif" @keyword.directive + ] + condition: (_)? @keyword.directive) -[ - (string) - (triple_quoted_string) -] @string +(preproc_else + "#else" @keyword.directive) -[ - (int) - (int16) - (int32) - (int64) - (float) - (decimal) -] @constant.numeric +((long_identifier + (identifier)+ @namespace + . + (identifier))) +(long_identifier_or_op + (op_identifier) @operator) +((identifier) @namespace + (#any-of? @namespace "Array" "Async" "Directory" "File" "List" "Option" "Path" "Map" "Set" "Lazy" "Seq" "Task" "String" "Result" )) diff --git a/runtime/queries/fsharp/injections.scm b/runtime/queries/fsharp/injections.scm new file mode 100644 index 000000000..54b89c5aa --- /dev/null +++ b/runtime/queries/fsharp/injections.scm @@ -0,0 +1,8 @@ +([ + (line_comment) + (block_comment_content) +] @injection.content + (#set! injection.language "comment")) + +((xml_doc (xml_doc_content) @injection.content) + (#set! injection.language "xml")) diff --git a/runtime/queries/fsharp/locals.scm b/runtime/queries/fsharp/locals.scm index aa36755ef..db2291f26 100644 --- a/runtime/queries/fsharp/locals.scm +++ b/runtime/queries/fsharp/locals.scm @@ -1,25 +1,32 @@ -; Scopes -;------- +(identifier) @local.reference [ - (ce_expression) - (module_defn) - (for_expression) - (do_expression) - (fun_expression) - (function_expression) - (try_expression) - (match_expression) - (elif_expression) - (if_expression) + (namespace) + (named_module) + (function_or_value_defn) ] @local.scope -; Definitions -;------------ - -(function_or_value_defn) @local.definition +(value_declaration_left + . + [ + (_ (identifier) @local.definition) + (_ (_ (identifier) @local.definition)) + (_ (_ (_ (identifier) @local.definition))) + (_ (_ (_ (_ (identifier) @local.definition)))) + (_ (_ (_ (_ (_ (identifier) @local.definition))))) + (_ (_ (_ (_ (_ (_ (identifier) @local.definition)))))) + ]) -; References -;----------- - -(identifier) @local.reference +(function_declaration_left + . + ((_) @local.definition) + ((argument_patterns + [ + (_ (identifier) @local.definition) + (_ (_ (identifier) @local.definition)) + (_ (_ (_ (identifier) @local.definition))) + (_ (_ (_ (_ (identifier) @local.definition)))) + (_ (_ (_ (_ (_ (identifier) @local.definition))))) + (_ (_ (_ (_ (_ (_ (identifier) @local.definition)))))) + ]) + )) From 779ce41a1f2cb909c94ff5c82feef99204477aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Bardaj=C3=AD=20Puig?= Date: Fri, 9 Aug 2024 17:34:18 +0200 Subject: [PATCH 19/41] Provide more details on runtime directory (#11026) * Provide more details on runtime directory * Improve pre-built binaries description --- book/src/install.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/book/src/install.md b/book/src/install.md index debc82b01..387b8b658 100644 --- a/book/src/install.md +++ b/book/src/install.md @@ -14,6 +14,10 @@ Note that: ## Pre-built binaries Download pre-built binaries from the [GitHub Releases page](https://github.com/helix-editor/helix/releases). -Add the `hx` binary to your system's `$PATH` to use it from the command line, and copy the `runtime` directory into the config directory (for example `~/.config/helix/runtime` on Linux/macOS). -The runtime location can be overriden via the HELIX_RUNTIME environment variable. +The tarball contents include an `hx` binary and a `runtime` directory. +To set up Helix: +1. Add the `hx` binary to your system's `$PATH` to allow it to be used from the command line. +2. Copy the `runtime` directory to a location that `hx` searches for runtime files. A typical location on Linux/macOS is `~/.config/helix/runtime`. + +To see the runtime directories that `hx` searches, run `hx --health`. If necessary, you can override the default runtime location by setting the `HELIX_RUNTIME` environment variable. From e884daea41abacdc1860a67312d681034353c759 Mon Sep 17 00:00:00 2001 From: chtenb Date: Fri, 9 Aug 2024 17:34:29 +0200 Subject: [PATCH 20/41] Document completion menu bindings (#10994) * Update keymap.md * Update keymap.md * Update keymap.md --- book/src/keymap.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/book/src/keymap.md b/book/src/keymap.md index 0e60f2826..e7ae6ae47 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -320,10 +320,14 @@ Displays documentation for item under cursor. Remapping currently not supported. Displays documentation for the selected completion item. Remapping currently not supported. -| Key | Description | -| ---- | ----------- | -| `Shift-Tab`, `Ctrl-p`, `Up` | Previous entry | -| `Tab`, `Ctrl-n`, `Down` | Next entry | +| Key | Description | +| ---- | ----------- | +| `Shift-Tab`, `Ctrl-p`, `Up` | Previous entry | +| `Tab`, `Ctrl-n`, `Down` | Next entry | +| `Enter` | Close menu and accept completion | +| `Ctrl-c` | Close menu and reject completion | + +Any other keypresses result in the completion being accepted. ##### Signature-help Popup From 3b306fa02272bd4fe27331d36906c123ead38c8f Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Fri, 9 Aug 2024 17:35:29 +0200 Subject: [PATCH 21/41] Update languages.toml - add nixd, closes #10734 (#10767) --- book/src/generated/lang-support.md | 2 +- languages.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index f8513ae74..f0d63ab1f 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -134,7 +134,7 @@ | nasm | ✓ | ✓ | | | | nickel | ✓ | | ✓ | `nls` | | nim | ✓ | ✓ | ✓ | `nimlangserver` | -| nix | ✓ | ✓ | | `nil` | +| nix | ✓ | ✓ | | `nil`, `nixd` | | nu | ✓ | | | `nu` | | nunjucks | ✓ | | | | | ocaml | ✓ | | ✓ | `ocamllsp` | diff --git a/languages.toml b/languages.toml index afc8b641d..d72512592 100644 --- a/languages.toml +++ b/languages.toml @@ -61,6 +61,7 @@ mojo-lsp = { command = "mojo-lsp-server" } nil = { command = "nil" } nimlangserver = { command = "nimlangserver" } nimlsp = { command = "nimlsp" } +nixd = { command = "nixd" } nls = { command = "nls" } nu-lsp = { command = "nu", args = [ "--lsp" ] } ocamllsp = { command = "ocamllsp" } @@ -886,7 +887,7 @@ injection-regex = "nix" file-types = ["nix"] shebangs = [] comment-token = "#" -language-servers = [ "nil" ] +language-servers = [ "nil", "nixd" ] indent = { tab-width = 2, unit = " " } [[grammar]] From 9daf5c6f8b40ec8a80727c4e6e3db09986eeb0c8 Mon Sep 17 00:00:00 2001 From: Chromo-residuum-opec Date: Fri, 9 Aug 2024 08:35:41 -0700 Subject: [PATCH 22/41] feat: add iceberg light/dark themes (#10674) * feat: add iceberg light/dark themes * set ui.virtual and ui.virtual.ruler * quote ui.menu.selected key --- runtime/themes/iceberg-dark.toml | 128 ++++++++++++++++++++++++++++++ runtime/themes/iceberg-light.toml | 39 +++++++++ 2 files changed, 167 insertions(+) create mode 100644 runtime/themes/iceberg-dark.toml create mode 100644 runtime/themes/iceberg-light.toml diff --git a/runtime/themes/iceberg-dark.toml b/runtime/themes/iceberg-dark.toml new file mode 100644 index 000000000..b6e0cf522 --- /dev/null +++ b/runtime/themes/iceberg-dark.toml @@ -0,0 +1,128 @@ +# Author : Chromo-residuum-opec + +"attribute" = { fg = "green" } +"boolean" = { fg = "purple" } +"character" = { fg = "purple" } +"comment" = { fg = "comment_fg" } +"conditional" = { fg = "blue" } +"constant" = { fg = "purple" } +"constructor" = { fg = "blue" } +"diagnostic.deprecated" = { modifiers = ["crossed_out"] } +"diagnostic.error" = { underline = { style = "curl", color = "red" } } +"diagnostic.hint" = { underline = { style = "curl", color = "comment_fg" } } +"diagnostic.info" = { underline = { style = "curl", color = "cyan" } } +"diagnostic.unnecessary" = { modifiers = ["dim"] } +"diagnostic.warning" = { underline = { style = "curl", color = "orange" } } +"diff.delta" = { fg = "blue" } +"diff.delta.gutter" = { fg = "cyan", bg = "linenr_bg" } +"diff.minus" = { fg = "red" } +"diff.minus.gutter" = { fg = "red", bg = "linenr_bg" } +"diff.plus" = { fg = "green" } +"diff.plus.gutter" = { fg = "green", bg = "linenr_bg" } +"error" = { fg = "red" } +"exception" = { fg = "blue" } +"field" = { fg = "background_fg" } +"float" = { fg = "purple" } +"function" = { fg = "pale" } +"function.macro" = { fg = "green" } +"hint" = { fg = "comment_fg" } +"identifier" = { fg = "blue" } +"info" = { fg = "cyan" } +"keyword" = { fg = "blue" } +"keyword.directive" = { fg = "green" } +"keyword.import" = { fg = "pale" } +"label" = { fg = "green" } +"markup.bold" = { modifiers = ["bold"] } +"markup.heading" = { fg = "blue", modifiers = ["bold"] } +"markup.italic" = { modifiers = ["italic"] } +"markup.link" = { fg = "blue", underline = { style = "line" } } +"markup.link.label" = { fg = "cyan" } +"markup.link.text" = { fg = "cyan" } +"markup.link.url" = { underline = { style = "line" } } +"markup.list" = { fg = "orange", modifiers = ["bold"] } +"markup.raw" = { fg = "cyan" } +"markup.raw.inline" = { bg = "black", fg = "blue" } +"markup.strikethrough" = { modifiers = ["crossed_out"] } +"method" = { fg = "pale" } +"namespace" = { fg = "blue" } +"number" = { fg = "purple" } +"operator" = { fg = "blue" } +"parameter" = { fg = "background_fg" } +"property" = { fg = "background_fg" } +"punctuation.bracket" = { fg = "background_fg" } +"punctuation.delimiter" = { fg = "background_fg" } +"punctuation.special" = { fg = "green" } +"repeat" = { fg = "blue" } +"special" = { fg = "green" } +"string" = { fg = "cyan" } +"string.escape" = { fg = "green" } +"string.special" = { fg = "green" } +"tag" = { fg = "blue" } +"tag.attribute" = { fg = "purple" } +"text" = { fg = "background_fg" } +"type" = { fg = "blue" } +"ui.background" = { fg = "background_fg", bg = "background_bg" } +"ui.background.separator" = { fg = "comment_fg" } +"ui.bufferline.active" = { fg = "pale" } +"ui.cursor.match" = { fg = "background_fg", bg = "matchparen_bg" } +"ui.cursor.normal" = { bg = "gray" } +"ui.cursor.primary" = { modifiers = ["reversed"] } +"ui.cursor.select" = { bg = "gray" } +"ui.gutter" = { fg = "linenr_fg", bg = "linenr_bg" } +"ui.help" = { fg = "background_fg", bg = "cursorlinenr_bg" } +"ui.linenr" = { fg = "linenr_fg", bg = "linenr_bg" } +"ui.menu" = { fg = "background_fg", bg = "cursorlinenr_bg" } +"ui.menu.border" = { fg = "comment_fg" } +"ui.menu.selected" = { fg = "menusel_fg", bg = "menusel_bg" } +"ui.popup" = { fg = "background_fg", bg = "cursorlinenr_bg" } +"ui.popup.info" = { fg = "blue" } +"ui.selection" = { bg = "sel_bg" } +"ui.statusline" = { bg = "statusline_bg", fg = "statusline_fg" } +"ui.statusline.insert" = { fg = "black", bg = "blue" } +"ui.statusline.select" = { fg = "black", bg = "green" } +"ui.text.focus" = { fg = "orange" } +"ui.virtual" = { fg = "linenr_fg" } +"ui.virtual.indent-guide" = { fg = "linenr_fg" } +"ui.virtual.jump-label" = { fg = "orange", modifiers = ["bold"] } +"ui.virtual.ruler" = { bg = "linenr_bg" } +"ui.virtual.whitespace" = { fg = "sel_bg" } +"ui.window" = { fg = "comment_fg", modifiers = ["bold"] } +"variable" = { fg = "background_fg" } +"variable.builtin" = { fg = "blue" } +"warning" = { fg = "orange" } + +[palette] + +orange = "#e2a578" +pale = "#a4aecc" +purple = "#a093c8" + +black = "#1e2132" +gray = "#6b7089" +red = "#e27878" +light-red = "#e98989" +green = "#b5bf82" +light-green = "#c0ca8e" +yellow = "#e2a478" +light-yellow = "#e9b189" +blue = "#85a0c7" +light-blue = "#91acd1" +magenta = "#a093c7" +light-magenta = "#ada0d3" +cyan = "#89b9c2" +light-cyan = "#95c4ce" +white = "#c6c8d1" +light-gray = "#d2d4de" + +background_bg = "#161822" +background_fg = "#c7c9d1" +comment_fg = "#6c7189" +cursorlinenr_bg = "#3d425c" +linenr_bg = "#1f2233" +linenr_fg = "#454d73" +matchparen_bg = "#3f455f" +menusel_bg = "#5c638a" +menusel_fg = "#f0f1f5" +sel_bg = "#282d43" +statusline_bg = "#0f1117" +statusline_fg = "#828597" diff --git a/runtime/themes/iceberg-light.toml b/runtime/themes/iceberg-light.toml new file mode 100644 index 000000000..2c7ca527d --- /dev/null +++ b/runtime/themes/iceberg-light.toml @@ -0,0 +1,39 @@ +# Author : Chromo-residuum-opec + +inherits = "iceberg-dark" +"ui.menu.selected" = { fg = "background_fg", bg = "menusel_bg" } + +[palette] + +orange = "#c67439" +pale = "#505695" +purple = "#785ab5" + +black = "#dcdfe7" +gray = "#8389a3" +red = "#cd517a" +light-red = "#cc3768" +green = "#668f3d" +light-green = "#598030" +yellow = "#c57339" +light-yellow = "#b6662d" +blue = "#2e539e" +light-blue = "#22478e" +magenta = "#7759b4" +light-magenta = "#6845ad" +cyan = "#3f84a6" +light-cyan = "#327698" +white = "#33374c" +light-gray = "#262a3f" + +background_bg = "#e9e9ed" +background_fg = "#33374d" +comment_fg = "#8489a4" +cursorlinenr_bg = "#cccfe0" +linenr_bg = "#dddfe9" +linenr_fg = "#a0a5c0" +matchparen_bg = "#bec0ca" +menusel_bg = "#a9afd1" +sel_bg = "#cacdd8" +statusline_bg = "#cad0de" +statusline_fg = "#757da3" From bb43a90b86de3c663222c8ebfb045fd14b3d5d7a Mon Sep 17 00:00:00 2001 From: Timothy Hutz Date: Fri, 9 Aug 2024 11:36:47 -0400 Subject: [PATCH 23/41] removed duplicate in lang-support MD file with vector dedup. (#10563) --- book/src/generated/lang-support.md | 2 +- xtask/src/docgen.rs | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index f0d63ab1f..4b0bca38c 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -1,6 +1,6 @@ | Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP | | --- | --- | --- | --- | --- | -| ada | ✓ | ✓ | | `ada_language_server`, `ada_language_server` | +| ada | ✓ | ✓ | | `ada_language_server` | | adl | ✓ | ✓ | ✓ | | | agda | ✓ | | | | | astro | ✓ | | | | diff --git a/xtask/src/docgen.rs b/xtask/src/docgen.rs index 034d9918e..18c145d50 100644 --- a/xtask/src/docgen.rs +++ b/xtask/src/docgen.rs @@ -1,9 +1,9 @@ use crate::helpers; use crate::path; use crate::DynError; - use helix_term::commands::TYPABLE_COMMAND_LIST; use helix_term::health::TsFeature; +use std::collections::HashSet; use std::fs; pub const TYPABLE_COMMANDS_MD_OUTPUT: &str = "typable-cmd.md"; @@ -95,14 +95,25 @@ pub fn lang_features() -> Result { .to_owned(), ); } - row.push( - lc.language_servers - .iter() - .filter_map(|ls| config.language_server.get(&ls.name)) - .map(|s| md_mono(&s.command.clone())) - .collect::>() - .join(", "), - ); + let mut seen_commands = HashSet::new(); + let mut commands = String::new(); + for ls_config in lc + .language_servers + .iter() + .filter_map(|ls| config.language_server.get(&ls.name)) + { + let command = &ls_config.command; + if !seen_commands.insert(command) { + continue; + } + + if !commands.is_empty() { + commands.push_str(", "); + } + + commands.push_str(&md_mono(command)); + } + row.push(commands); md.push_str(&md_table_row(&row)); row.clear(); From 1098a348aa4538158464404d3c9cf9aab3ea39b3 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 13 Feb 2024 18:08:24 -0500 Subject: [PATCH 24/41] Parse and execute macro mappable commands --- helix-term/src/commands.rs | 49 +++++++++++++++++++++++++++++++++++--- helix-term/src/keymap.rs | 1 + 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 835283ada..9ccd8ea10 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -176,9 +176,16 @@ where use helix_view::{align_view, Align}; -/// A MappableCommand is either a static command like "jump_view_up" or a Typable command like -/// :format. It causes a side-effect on the state (usually by creating and applying a transaction). -/// Both of these types of commands can be mapped with keybindings in the config.toml. +/// MappableCommands are commands that can be bound to keys, executable in +/// normal, insert or select mode. +/// +/// There are three kinds: +/// +/// * Static: commands usually bound to keys and used for editing, movement, +/// etc., for example `move_char_left`. +/// * Typable: commands executable from command mode, prefixed with a `:`, +/// for example `:write!`. +/// * Macro: a sequence of keys to execute, for example `@miw`. #[derive(Clone)] pub enum MappableCommand { Typable { @@ -191,6 +198,10 @@ pub enum MappableCommand { fun: fn(cx: &mut Context), doc: &'static str, }, + Macro { + name: String, + keys: Vec, + }, } macro_rules! static_commands { @@ -227,6 +238,23 @@ impl MappableCommand { } } Self::Static { fun, .. } => (fun)(cx), + Self::Macro { keys, .. } => { + // Protect against recursive macros. + if cx.editor.macro_replaying.contains(&'@') { + cx.editor.set_error( + "Cannot execute macro because the [@] register is already playing a macro", + ); + return; + } + cx.editor.macro_replaying.push('@'); + let keys = keys.clone(); + cx.callback.push(Box::new(move |compositor, cx| { + for key in keys.into_iter() { + compositor.handle_event(&compositor::Event::Key(key), cx); + } + cx.editor.macro_replaying.pop(); + })); + } } } @@ -234,6 +262,7 @@ impl MappableCommand { match &self { Self::Typable { name, .. } => name, Self::Static { name, .. } => name, + Self::Macro { name, .. } => name, } } @@ -241,6 +270,7 @@ impl MappableCommand { match &self { Self::Typable { doc, .. } => doc, Self::Static { doc, .. } => doc, + Self::Macro { name, .. } => name, } } @@ -551,6 +581,11 @@ impl fmt::Debug for MappableCommand { .field(name) .field(args) .finish(), + MappableCommand::Macro { name, keys, .. } => f + .debug_tuple("MappableCommand") + .field(name) + .field(keys) + .finish(), } } } @@ -581,6 +616,11 @@ impl std::str::FromStr for MappableCommand { args, }) .ok_or_else(|| anyhow!("No TypableCommand named '{}'", s)) + } else if let Some(suffix) = s.strip_prefix('@') { + helix_view::input::parse_macro(suffix).map(|keys| Self::Macro { + name: s.to_string(), + keys, + }) } else { MappableCommand::STATIC_COMMAND_LIST .iter() @@ -3185,6 +3225,9 @@ pub fn command_palette(cx: &mut Context) { ui::PickerColumn::new("name", |item, _| match item { MappableCommand::Typable { name, .. } => format!(":{name}").into(), MappableCommand::Static { name, .. } => (*name).into(), + MappableCommand::Macro { .. } => { + unreachable!("macros aren't included in the command palette") + } }), ui::PickerColumn::new( "bindings", diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index 975274ed1..4d8d13d64 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -199,6 +199,7 @@ impl KeyTrie { // recursively visit all nodes in keymap fn map_node(cmd_map: &mut ReverseKeymap, node: &KeyTrie, keys: &mut Vec) { match node { + KeyTrie::MappableCommand(MappableCommand::Macro { .. }) => {} KeyTrie::MappableCommand(cmd) => { let name = cmd.name(); if name != "no_op" { From b7820ee6689af1e7615f21084258e986f40cb67e Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 13 Feb 2024 18:11:57 -0500 Subject: [PATCH 25/41] Disallow macro keybindings within command sequences This is a temporary limitation because of the way that command sequences are executed. Each command is currently executed back-to-back synchronously, but macros are by design queued up for the compositor. So macros mixed into a command sequence will behave undesirably: they will be executed after the rest of the static and/or typable commands in the sequence. This is pending a larger refactor of how we handle commands. has further details and discusses a similar problem faced by the command palette. --- helix-term/src/keymap.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index 4d8d13d64..020ecaf40 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -177,6 +177,19 @@ impl<'de> serde::de::Visitor<'de> for KeyTrieVisitor { .map_err(serde::de::Error::custom)?, ) } + + // Prevent macro keybindings from being used in command sequences. + // This is meant to be a temporary restriction pending a larger + // refactor of how command sequences are executed. + if commands + .iter() + .any(|cmd| matches!(cmd, MappableCommand::Macro { .. })) + { + return Err(serde::de::Error::custom( + "macro keybindings may not be used in command sequences", + )); + } + Ok(KeyTrie::Sequence(commands)) } From 7e85fd5b77aa9b0898ddccfb834e36801db31825 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 13 Feb 2024 18:26:20 -0500 Subject: [PATCH 26/41] Add documentation for static/typable/macro commands --- book/src/remapping.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/book/src/remapping.md b/book/src/remapping.md index 863c55570..e3efdf16f 100644 --- a/book/src/remapping.md +++ b/book/src/remapping.md @@ -75,5 +75,20 @@ Ctrl, Shift and Alt modifiers are encoded respectively with the prefixes Keys can be disabled by binding them to the `no_op` command. -A list of commands is available in the [Keymap](https://docs.helix-editor.com/keymap.html) documentation - and in the source code at [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs) at the invocation of `static_commands!` macro and the `TypableCommandList`. +## Commands + +There are three kinds of commands that can be used in keymaps: + +* Static commands: commands like `move_char_right` which are usually bound to + keys and used for movement and editing. A list of static commands is + available in the [Keymap](./keymap.html) documentation and in the source code + in [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs) + at the invocation of `static_commands!` macro and the `TypableCommandList`. +* Typable commands: commands that can be executed from command mode (`:`), for + example `:write!`. See the [Commands](./commands.html) documentation for a + list of available typeable commands. +* Macros: sequences of keys that are executed in order. These keybindings + start with `@` and then list any number of keys to be executed. For example + `@miw` can be used to select the surrounding word. For now, macro keybindings + are not allowed in keybinding sequences due to limitations in the way that + command sequences are executed. From e604d9f8e0fea2223a357be7c9dc6088daef47e7 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Fri, 9 Aug 2024 17:40:34 +0200 Subject: [PATCH 27/41] keep (cursor) position when exactly replacing text (#5930) Whenever a document is changed helix maps various positions like the cursor or diagnostics through the `ChangeSet` applied to the document. Currently, this mapping handles replacements as follows: * Move position to the left for `Assoc::Before` (start of selection) * Move position to the right for `Assoc::After` (end of selection) However, when text is exactly replaced this can produce weird results where the cursor is moved when it shouldn't. For example if `foo` is selected and a separate cursor is placed on each character (`s.`) and the text is replaced (for example `rx`) then the cursors are moved to the side instead of remaining in place. This change adds a special case to the mapping code of replacements: If the deleted and inserted text have the same (char) length then the position is returned as if the replacement doesn't exist. only keep selections invariant under replacement Keeping selections unchanged if they are inside an exact replacement is intuitive. However, for diagnostics this is not desirable as helix would otherwise fail to remove diagnostics if replacing parts of the document. --- helix-core/src/selection.rs | 24 ++++++++++++------------ helix-core/src/transaction.rs | 24 ++++++++++++++++++++---- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index eff1fcd70..a382a7186 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -184,16 +184,16 @@ impl Range { let positions_to_map = match self.anchor.cmp(&self.head) { Ordering::Equal => [ - (&mut self.anchor, Assoc::After), - (&mut self.head, Assoc::After), + (&mut self.anchor, Assoc::AfterSticky), + (&mut self.head, Assoc::AfterSticky), ], Ordering::Less => [ - (&mut self.anchor, Assoc::After), - (&mut self.head, Assoc::Before), + (&mut self.anchor, Assoc::AfterSticky), + (&mut self.head, Assoc::BeforeSticky), ], Ordering::Greater => [ - (&mut self.head, Assoc::After), - (&mut self.anchor, Assoc::Before), + (&mut self.head, Assoc::AfterSticky), + (&mut self.anchor, Assoc::BeforeSticky), ], }; changes.update_positions(positions_to_map.into_iter()); @@ -482,16 +482,16 @@ impl Selection { range.old_visual_position = None; match range.anchor.cmp(&range.head) { Ordering::Equal => [ - (&mut range.anchor, Assoc::After), - (&mut range.head, Assoc::After), + (&mut range.anchor, Assoc::AfterSticky), + (&mut range.head, Assoc::AfterSticky), ], Ordering::Less => [ - (&mut range.anchor, Assoc::After), - (&mut range.head, Assoc::Before), + (&mut range.anchor, Assoc::AfterSticky), + (&mut range.head, Assoc::BeforeSticky), ], Ordering::Greater => [ - (&mut range.head, Assoc::After), - (&mut range.anchor, Assoc::Before), + (&mut range.head, Assoc::AfterSticky), + (&mut range.anchor, Assoc::BeforeSticky), ], } }); diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index f24f20942..c5c94b750 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -29,6 +29,12 @@ pub enum Assoc { /// Acts like `Before` if a word character is inserted /// before the position, otherwise acts like `After` BeforeWord, + /// Acts like `Before` but if the position is within an exact replacement + /// (exact size) the offset to the start of the replacement is kept + BeforeSticky, + /// Acts like `After` but if the position is within an exact replacement + /// (exact size) the offset to the start of the replacement is kept + AfterSticky, } impl Assoc { @@ -40,13 +46,17 @@ impl Assoc { fn insert_offset(self, s: &str) -> usize { let chars = s.chars().count(); match self { - Assoc::After => chars, + Assoc::After | Assoc::AfterSticky => chars, Assoc::AfterWord => s.chars().take_while(|&c| char_is_word(c)).count(), // return position before inserted text - Assoc::Before => 0, + Assoc::Before | Assoc::BeforeSticky => 0, Assoc::BeforeWord => chars - s.chars().rev().take_while(|&c| char_is_word(c)).count(), } } + + pub fn sticky(self) -> bool { + matches!(self, Assoc::BeforeSticky | Assoc::AfterSticky) + } } #[derive(Debug, Default, Clone, PartialEq, Eq)] @@ -456,8 +466,14 @@ impl ChangeSet { if pos == old_pos && assoc.stay_at_gaps() { new_pos } else { - // place to end of insert - new_pos + assoc.insert_offset(s) + let ins = assoc.insert_offset(s); + // if the deleted and inserted text have the exact same size + // keep the relative offset into the new text + if *len == ins && assoc.sticky() { + new_pos + (pos - old_pos) + } else { + new_pos + assoc.insert_offset(s) + } } }), i From 91e642ce50b0e8983daa2376accff61588f81df8 Mon Sep 17 00:00:00 2001 From: Samy AB Date: Sat, 10 Aug 2024 01:25:31 +0200 Subject: [PATCH 28/41] Add gherkin syntax highlighting (#11083) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Blaž Hrastnik --- book/src/generated/lang-support.md | 1 + languages.toml | 14 ++++++++++++-- runtime/queries/gherkin/highlights.scm | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 runtime/queries/gherkin/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 4b0bca38c..4ce9edb9d 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -58,6 +58,7 @@ | gas | ✓ | ✓ | | | | gdscript | ✓ | ✓ | ✓ | | | gemini | ✓ | | | | +| gherkin | ✓ | | | | | git-attributes | ✓ | | | | | git-commit | ✓ | ✓ | | | | git-config | ✓ | | | | diff --git a/languages.toml b/languages.toml index d72512592..12b0ad049 100644 --- a/languages.toml +++ b/languages.toml @@ -3764,6 +3764,17 @@ grammar = "typescript" "(" = ")" '"' = '"' +[[language]] +name = "gherkin" +scope = "source.feature" +file-types = ["feature"] +comment-token = "#" +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "gherkin" +source = { git = "https://github.com/SamyAB/tree-sitter-gherkin", rev = "43873ee8de16476635b48d52c46f5b6407cb5c09" } + [[language]] name = "thrift" scope = "source.thrift" @@ -3774,5 +3785,4 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "thrift" -source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-thrift" , rev = "68fd0d80943a828d9e6f49c58a74be1e9ca142cf" } - +source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-thrift" , rev = "68fd0d80943a828d9e6f49c58a74be1e9ca142cf" } \ No newline at end of file diff --git a/runtime/queries/gherkin/highlights.scm b/runtime/queries/gherkin/highlights.scm new file mode 100644 index 000000000..1a17e3819 --- /dev/null +++ b/runtime/queries/gherkin/highlights.scm @@ -0,0 +1,17 @@ +[ + (feature_keyword) + (rule_keyword) + (background_keyword) + (scenario_keyword) + (given_keyword) + (when_keyword) + (then_keyword) + (and_keyword) + (but_keyword) + (asterisk_keyword) +] @keyword + +(tag) @function +(doc_string) @string +(data_table) @special +(comment) @comment From e46cedfc267c7651462f92a1b822de439c0024a8 Mon Sep 17 00:00:00 2001 From: RoloEdits Date: Sun, 11 Aug 2024 08:24:51 -0700 Subject: [PATCH 29/41] refactor(commands): `trim_end` of `sh` output (#11161) --- helix-term/src/commands/typed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index cd40e0532..7ad0369fc 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -2300,7 +2300,7 @@ fn run_shell_command( move |editor: &mut Editor, compositor: &mut Compositor| { if !output.is_empty() { let contents = ui::Markdown::new( - format!("```sh\n{}\n```", output), + format!("```sh\n{}\n```", output.trim_end()), editor.syn_loader.clone(), ); let popup = Popup::new("shell", contents).position(Some( From 112b2878aefff877f3507e319bca68e61d462068 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 07:59:42 +0200 Subject: [PATCH 30/41] build(deps): bump the rust-dependencies group with 4 updates (#11476) Bumps the rust-dependencies group with 4 updates: [serde](https://github.com/serde-rs/serde), [serde_json](https://github.com/serde-rs/json), [tempfile](https://github.com/Stebalien/tempfile) and [cc](https://github.com/rust-lang/cc-rs). Updates `serde` from 1.0.204 to 1.0.207 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.204...v1.0.207) Updates `serde_json` from 1.0.122 to 1.0.124 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.122...v1.0.124) Updates `tempfile` from 3.11.0 to 3.12.0 - [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md) - [Commits](https://github.com/Stebalien/tempfile/commits) Updates `cc` from 1.1.7 to 1.1.10 - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.7...cc-v1.1.10) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: tempfile dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rust-dependencies - dependency-name: cc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 24 ++++++++++++------------ helix-loader/Cargo.toml | 2 +- helix-lsp-types/Cargo.toml | 4 ++-- helix-stdx/Cargo.toml | 2 +- helix-term/Cargo.toml | 2 +- helix-vcs/Cargo.toml | 2 +- helix-view/Cargo.toml | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 269437f61..d70026343 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,9 +136,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" [[package]] name = "cfg-if" @@ -1700,7 +1700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.48.0", + "windows-targets 0.52.6", ] [[package]] @@ -2122,18 +2122,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" dependencies = [ "proc-macro2", "quote", @@ -2142,9 +2142,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.122" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" dependencies = [ "itoa", "memchr", @@ -2313,15 +2313,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/helix-loader/Cargo.toml b/helix-loader/Cargo.toml index 6b63f03e2..f74829f30 100644 --- a/helix-loader/Cargo.toml +++ b/helix-loader/Cargo.toml @@ -30,7 +30,7 @@ log = "0.4" # cloning/compiling tree-sitter grammars cc = { version = "1" } threadpool = { version = "1.0" } -tempfile = "3.11.0" +tempfile = "3.12.0" dunce = "1.0.5" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/helix-lsp-types/Cargo.toml b/helix-lsp-types/Cargo.toml index 1abd7bca8..1dcc8f8c0 100644 --- a/helix-lsp-types/Cargo.toml +++ b/helix-lsp-types/Cargo.toml @@ -22,8 +22,8 @@ license = "MIT" [dependencies] bitflags = "2.6.0" -serde = { version = "1.0.34", features = ["derive"] } -serde_json = "1.0.122" +serde = { version = "1.0.207", features = ["derive"] } +serde_json = "1.0.124" serde_repr = "0.1" url = {version = "2.0.0", features = ["serde"]} diff --git a/helix-stdx/Cargo.toml b/helix-stdx/Cargo.toml index 8d8f6b84f..1c0d06ab1 100644 --- a/helix-stdx/Cargo.toml +++ b/helix-stdx/Cargo.toml @@ -26,4 +26,4 @@ windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_Securit rustix = { version = "0.38", features = ["fs"] } [dev-dependencies] -tempfile = "3.11" +tempfile = "3.12" diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 6e27b00f5..d09919da5 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -85,5 +85,5 @@ helix-loader = { path = "../helix-loader" } [dev-dependencies] smallvec = "1.13" indoc = "2.0.5" -tempfile = "3.11.0" +tempfile = "3.12.0" same-file = "1.0.1" diff --git a/helix-vcs/Cargo.toml b/helix-vcs/Cargo.toml index 086d3701e..79d736a1e 100644 --- a/helix-vcs/Cargo.toml +++ b/helix-vcs/Cargo.toml @@ -29,4 +29,4 @@ log = "0.4" git = ["gix"] [dev-dependencies] -tempfile = "3.11" +tempfile = "3.12" diff --git a/helix-view/Cargo.toml b/helix-view/Cargo.toml index a01f4295f..ddfa9f7e4 100644 --- a/helix-view/Cargo.toml +++ b/helix-view/Cargo.toml @@ -28,7 +28,7 @@ bitflags = "2.6" anyhow = "1" crossterm = { version = "0.28", optional = true } -tempfile = "3.11" +tempfile = "3.12" # Conversion traits once_cell = "1.19" From f65ec32a1c2e09b3b32b521617f4a3ef19bc71c5 Mon Sep 17 00:00:00 2001 From: 0rphee <0rph3e@proton.me> Date: Tue, 13 Aug 2024 05:53:03 -0600 Subject: [PATCH 31/41] Update everforest themes (#11459) --- runtime/themes/everforest_dark.toml | 3 ++- runtime/themes/everforest_light.toml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/themes/everforest_dark.toml b/runtime/themes/everforest_dark.toml index 37b6756f5..eed60df3f 100644 --- a/runtime/themes/everforest_dark.toml +++ b/runtime/themes/everforest_dark.toml @@ -65,7 +65,7 @@ "diff.minus" = "red" "ui.background" = { bg = "bg0" } -"ui.background.separator" = "bg_visual" +"ui.background.separator" = "grey0" "ui.cursor" = { fg = "bg1", bg = "grey2" } "ui.cursor.insert" = { fg = "bg0", bg = "grey1" } "ui.cursor.select" = { fg = "bg0", bg = "blue" } @@ -90,6 +90,7 @@ "bold", ] } "ui.popup" = { fg = "grey2", bg = "bg2" } +"ui.picker.header" = { modifiers = ["bold", "underlined"] } "ui.window" = { fg = "bg4", bg = "bg_dim" } "ui.help" = { fg = "fg", bg = "bg2" } "ui.text" = "fg" diff --git a/runtime/themes/everforest_light.toml b/runtime/themes/everforest_light.toml index b7448455c..04482c89d 100644 --- a/runtime/themes/everforest_light.toml +++ b/runtime/themes/everforest_light.toml @@ -64,7 +64,7 @@ "diff.minus" = "red" "ui.background" = { bg = "bg0" } -"ui.background.separator" = "bg_visual" +"ui.background.separator" = "grey0" "ui.cursor" = { fg = "bg1", bg = "grey2" } "ui.cursor.insert" = { fg = "bg0", bg = "grey1" } "ui.cursor.select" = { fg = "bg0", bg = "blue" } @@ -89,6 +89,7 @@ "bold", ] } "ui.popup" = { fg = "grey2", bg = "bg2" } +"ui.picker.header" = { modifiers = ["bold", "underlined"] } "ui.window" = { fg = "bg4", bg = "bg_dim" } "ui.help" = { fg = "fg", bg = "bg2" } "ui.text" = "fg" From f9aae99379e4b0906cf18ca86a076310e7c857ef Mon Sep 17 00:00:00 2001 From: Frans Skarman Date: Wed, 14 Aug 2024 17:43:31 +0000 Subject: [PATCH 32/41] Highlight types and enum members in the rust prelude (#8535) * Add some rust builtins * rust queries: Add everything in the 2021 prelude * Update runtime/queries/rust/highlights.scm Co-authored-by: Michael Davis --------- Co-authored-by: Michael Davis --- runtime/queries/rust/highlights.scm | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index 7997c5ea0..2981075fb 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -55,6 +55,55 @@ "'" @label (identifier) @label) +; --- +; Prelude +; --- + +((identifier) @type.enum.variant.builtin + (#any-of? @type.enum.variant.builtin "Some" "None" "Ok" "Err")) + + + +((type_identifier) @type.builtin + (#any-of? + @type.builtin + "Send" + "Sized" + "Sync" + "Unpin" + "Drop" + "Fn" + "FnMut" + "FnOnce" + "AsMut" + "AsRef" + "From" + "Into" + "DoubleEndedIterator" + "ExactSizeIterator" + "Extend" + "IntoIterator" + "Iterator" + "Option" + "Result" + "Clone" + "Copy" + "Debug" + "Default" + "Eq" + "Hash" + "Ord" + "PartialEq" + "PartialOrd" + "ToOwned" + "Box" + "String" + "ToString" + "Vec" + "FromIterator" + "TryFrom" + "TryInto")) + ; --- ; Punctuation ; --- From ff33b07756548935577aefc15cf48a1beb27b162 Mon Sep 17 00:00:00 2001 From: Per-Gunnar Date: Wed, 14 Aug 2024 19:44:44 +0200 Subject: [PATCH 33/41] Clarify lesson 10.1 wording (#11478) Co-authored-by: Per-gunnar Eriksson --- runtime/tutor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/tutor b/runtime/tutor index 431d24f8f..98b9f3af1 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -1044,8 +1044,8 @@ lines. 1. Move the cursor to the line marked '-->' below. 2. Select both lines with xx or 2x. 3. Type s to select, type "would" and enter. - 4. Use ( and ) to cycle the primary selection and remove the - very second "would" with Alt-, . + 4. Use ( and ) to cycle the primary selection and deselect + the second "would" with Alt-, . 5. Type c "wood" to change the remaining "would"s to "wood". --> How much would would a wouldchuck chuck From b90ec5c77985bd444e7043fe738bb51b396ed496 Mon Sep 17 00:00:00 2001 From: Jaakko Paju Date: Sat, 17 Aug 2024 20:27:50 +0300 Subject: [PATCH 34/41] Add/improve textobject queries (#11513) * Add textobject queries for YAML * Add textobject queries for SQL * Add textobject queries for HOCON * Add textobject queries for git-config * Add textobject queries for env * Add textobject queries for Dockerfile * Add textobject queries for docker-compose * Add textobject queries for prisma * Add entry textobject queries for hcl * Add entry textobject queries for Nix * Update docs --- book/src/generated/lang-support.md | 16 ++++++++-------- runtime/queries/docker-compose/textobjects.scm | 1 + runtime/queries/dockerfile/textobjects.scm | 4 ++++ runtime/queries/env/textobjects.scm | 6 ++++++ runtime/queries/git-config/textobjects.scm | 6 ++++++ runtime/queries/hcl/textobjects.scm | 5 +++++ runtime/queries/hocon/textobjects.scm | 10 ++++++++++ runtime/queries/nix/textobjects.scm | 3 +++ runtime/queries/prisma/textobjects.scm | 17 +++++++++++++++++ runtime/queries/sql/textobjects.scm | 4 ++++ runtime/queries/yaml/textobjects.scm | 7 +++++++ 11 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 runtime/queries/docker-compose/textobjects.scm create mode 100644 runtime/queries/dockerfile/textobjects.scm create mode 100644 runtime/queries/env/textobjects.scm create mode 100644 runtime/queries/git-config/textobjects.scm create mode 100644 runtime/queries/hocon/textobjects.scm create mode 100644 runtime/queries/prisma/textobjects.scm create mode 100644 runtime/queries/sql/textobjects.scm create mode 100644 runtime/queries/yaml/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 4ce9edb9d..cb1c815f2 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -34,8 +34,8 @@ | devicetree | ✓ | | | | | dhall | ✓ | ✓ | | `dhall-lsp-server` | | diff | ✓ | | | | -| docker-compose | ✓ | | ✓ | `docker-compose-langserver`, `yaml-language-server` | -| dockerfile | ✓ | | | `docker-langserver` | +| docker-compose | ✓ | ✓ | ✓ | `docker-compose-langserver`, `yaml-language-server` | +| dockerfile | ✓ | ✓ | | `docker-langserver` | | dot | ✓ | | | `dot-language-server` | | dtd | ✓ | | | | | earthfile | ✓ | ✓ | ✓ | `earthlyls` | @@ -46,7 +46,7 @@ | elixir | ✓ | ✓ | ✓ | `elixir-ls` | | elm | ✓ | ✓ | | `elm-language-server` | | elvish | ✓ | | | `elvish` | -| env | ✓ | | | | +| env | ✓ | ✓ | | | | erb | ✓ | | | | | erlang | ✓ | ✓ | | `erlang_ls` | | esdl | ✓ | | | | @@ -61,7 +61,7 @@ | gherkin | ✓ | | | | | git-attributes | ✓ | | | | | git-commit | ✓ | ✓ | | | -| git-config | ✓ | | | | +| git-config | ✓ | ✓ | | | | git-ignore | ✓ | | | | | git-rebase | ✓ | | | | | gjs | ✓ | ✓ | ✓ | `typescript-language-server`, `vscode-eslint-language-server`, `ember-language-server` | @@ -83,7 +83,7 @@ | hcl | ✓ | ✓ | ✓ | `terraform-ls` | | heex | ✓ | ✓ | | `elixir-ls` | | helm | ✓ | | | `helm_ls` | -| hocon | ✓ | | ✓ | | +| hocon | ✓ | ✓ | ✓ | | | hoon | ✓ | | | | | hosts | ✓ | | | | | html | ✓ | | | `vscode-html-language-server` | @@ -158,7 +158,7 @@ | pod | ✓ | | | | | ponylang | ✓ | ✓ | ✓ | | | powershell | ✓ | | | | -| prisma | ✓ | | | `prisma-language-server` | +| prisma | ✓ | ✓ | | `prisma-language-server` | | prolog | | | | `swipl` | | protobuf | ✓ | ✓ | ✓ | `bufls`, `pb` | | prql | ✓ | | | | @@ -186,7 +186,7 @@ | sml | ✓ | | | | | solidity | ✓ | ✓ | | `solc` | | spicedb | ✓ | | | | -| sql | ✓ | | | | +| sql | ✓ | ✓ | | | | sshclientconfig | ✓ | | | | | starlark | ✓ | ✓ | | | | strace | ✓ | | | | @@ -228,6 +228,6 @@ | xit | ✓ | | | | | xml | ✓ | | ✓ | | | xtc | ✓ | | | | -| yaml | ✓ | | ✓ | `yaml-language-server`, `ansible-language-server` | +| yaml | ✓ | ✓ | ✓ | `yaml-language-server`, `ansible-language-server` | | yuck | ✓ | | | | | zig | ✓ | ✓ | ✓ | `zls` | diff --git a/runtime/queries/docker-compose/textobjects.scm b/runtime/queries/docker-compose/textobjects.scm new file mode 100644 index 000000000..4ba254e82 --- /dev/null +++ b/runtime/queries/docker-compose/textobjects.scm @@ -0,0 +1 @@ +; inherits: yaml diff --git a/runtime/queries/dockerfile/textobjects.scm b/runtime/queries/dockerfile/textobjects.scm new file mode 100644 index 000000000..975fd4c5e --- /dev/null +++ b/runtime/queries/dockerfile/textobjects.scm @@ -0,0 +1,4 @@ +(comment) @comment.inside + +(comment)+ @comment.around + diff --git a/runtime/queries/env/textobjects.scm b/runtime/queries/env/textobjects.scm new file mode 100644 index 000000000..4bdbf5ec7 --- /dev/null +++ b/runtime/queries/env/textobjects.scm @@ -0,0 +1,6 @@ +(comment) @comment.inside + +(comment)+ @comment.around + +(variable_assignment + (_) @entry.inside) @entry.around diff --git a/runtime/queries/git-config/textobjects.scm b/runtime/queries/git-config/textobjects.scm new file mode 100644 index 000000000..4335f1392 --- /dev/null +++ b/runtime/queries/git-config/textobjects.scm @@ -0,0 +1,6 @@ +(comment) @comment.inside + +(comment)+ @comment.around + +(variable + (_) @entry.inside) @entry.around diff --git a/runtime/queries/hcl/textobjects.scm b/runtime/queries/hcl/textobjects.scm index 1e6505876..c5ee4ff2d 100644 --- a/runtime/queries/hcl/textobjects.scm +++ b/runtime/queries/hcl/textobjects.scm @@ -4,3 +4,8 @@ (function_arguments ((_) @parameter.inside . ","? @parameter.around) @parameter.around) +(attribute + (_) @entry.inside) @entry.around + +(tuple + (_) @entry.around) diff --git a/runtime/queries/hocon/textobjects.scm b/runtime/queries/hocon/textobjects.scm new file mode 100644 index 000000000..aa4583933 --- /dev/null +++ b/runtime/queries/hocon/textobjects.scm @@ -0,0 +1,10 @@ +(comment) @comment.inside + +(comment)+ @comment.around + +(pair + (_) @entry.inside) @entry.around + +(array + (_) @entry.around) + diff --git a/runtime/queries/nix/textobjects.scm b/runtime/queries/nix/textobjects.scm index 1508d4c2b..196ef46cb 100644 --- a/runtime/queries/nix/textobjects.scm +++ b/runtime/queries/nix/textobjects.scm @@ -7,3 +7,6 @@ (function_expression body: (_) @function.inside) @function.around +(binding + (_) @entry.inside) @entry.around + diff --git a/runtime/queries/prisma/textobjects.scm b/runtime/queries/prisma/textobjects.scm new file mode 100644 index 000000000..a59ac221c --- /dev/null +++ b/runtime/queries/prisma/textobjects.scm @@ -0,0 +1,17 @@ +(model_declaration + ((statement_block) @class.inside)) @class.around + +(call_expression + (arguments (_) @parameter.inside . ","? @parameter.around) @parameter.around) + +(column_declaration) @entry.around + +(array (_) @entry.around) + +(assignment_expression + (_) @entry.inside) @entry.around + +(developer_comment) @comment.inside + +(developer_comment)+ @comment.around + diff --git a/runtime/queries/sql/textobjects.scm b/runtime/queries/sql/textobjects.scm new file mode 100644 index 000000000..975fd4c5e --- /dev/null +++ b/runtime/queries/sql/textobjects.scm @@ -0,0 +1,4 @@ +(comment) @comment.inside + +(comment)+ @comment.around + diff --git a/runtime/queries/yaml/textobjects.scm b/runtime/queries/yaml/textobjects.scm new file mode 100644 index 000000000..8b9bd0560 --- /dev/null +++ b/runtime/queries/yaml/textobjects.scm @@ -0,0 +1,7 @@ +(comment) @comment.inside + +(comment)+ @comment.around + +(block_mapping_pair + (_) @entry.inside) @entry.around + From e2904794749ccc709a238a10e6ee364411c2b820 Mon Sep 17 00:00:00 2001 From: nryz <11363433+nryz@users.noreply.github.com> Date: Mon, 19 Aug 2024 21:45:38 +0100 Subject: [PATCH 35/41] copy shell completion to nix output (#11518) --- flake.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake.nix b/flake.nix index c230dc317..c7e4fdce5 100644 --- a/flake.nix +++ b/flake.nix @@ -126,6 +126,7 @@ # disable fetching and building of tree-sitter grammars in the helix-term build.rs HELIX_DISABLE_AUTO_GRAMMAR_BUILD = "1"; buildInputs = [stdenv.cc.cc.lib]; + nativeBuildInputs = [pkgs.installShellFiles]; # disable tests doCheck = false; meta.mainProgram = "hx"; @@ -141,6 +142,7 @@ cp contrib/Helix.desktop $out/share/applications cp logo.svg $out/share/icons/hicolor/scalable/apps/helix.svg cp contrib/helix.png $out/share/icons/hicolor/256x256/apps + installShellCompletion contrib/completion/hx.{bash,fish,zsh} ''; }); helix = makeOverridableHelix self.packages.${system}.helix-unwrapped {}; From 4e729dea023ca31d0a5ad8fb0b73496cfea3b243 Mon Sep 17 00:00:00 2001 From: RoloEdits Date: Mon, 19 Aug 2024 15:28:59 -0700 Subject: [PATCH 36/41] fix: ensure view is initiated for jump_* commands (#11529) --- helix-term/src/commands.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 9ccd8ea10..6e037a471 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -5138,6 +5138,8 @@ fn jump_forward(cx: &mut Context) { } doc.set_selection(view.id, selection); + // Document we switch to might not have been opened in the view before + doc.ensure_view_init(view.id); view.ensure_cursor_in_view_center(doc, config.scrolloff); }; } @@ -5158,6 +5160,8 @@ fn jump_backward(cx: &mut Context) { } doc.set_selection(view.id, selection); + // Document we switch to might not have been opened in the view before + doc.ensure_view_init(view.id); view.ensure_cursor_in_view_center(doc, config.scrolloff); }; } From 9e7c488ee33eaabab6ee7c3436f4c58b8c647b4f Mon Sep 17 00:00:00 2001 From: 0rphee <0rph3e@proton.me> Date: Mon, 19 Aug 2024 17:38:46 -0600 Subject: [PATCH 37/41] Update gruvbox themes (#11477) --- runtime/themes/gruvbox.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/themes/gruvbox.toml b/runtime/themes/gruvbox.toml index 220843b50..e91b6f322 100644 --- a/runtime/themes/gruvbox.toml +++ b/runtime/themes/gruvbox.toml @@ -94,6 +94,8 @@ "ui.menu" = { fg = "fg1", bg = "bg2" } "ui.menu.selected" = { fg = "bg2", bg = "blue1", modifiers = ["bold"] } "ui.popup" = { bg = "bg1" } +"ui.picker.header.column" = { underline.style = "line" } +"ui.picker.header.column.active" = { modifiers = ["bold"], underline.style = "line" } "ui.selection" = { bg = "bg2" } "ui.selection.primary" = { bg = "bg3" } From 38e6fcd5c51478635ffa405815c7b9bbeadc35a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:41:49 +0900 Subject: [PATCH 38/41] build(deps): bump the rust-dependencies group with 7 updates (#11530) Bumps the rust-dependencies group with 7 updates: | Package | From | To | | --- | --- | --- | | [serde](https://github.com/serde-rs/serde) | `1.0.207` | `1.0.208` | | [serde_json](https://github.com/serde-rs/json) | `1.0.124` | `1.0.125` | | [tokio](https://github.com/tokio-rs/tokio) | `1.39.2` | `1.39.3` | | [libc](https://github.com/rust-lang/libc) | `0.2.155` | `0.2.158` | | [pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) | `0.11.0` | `0.12.0` | | [cc](https://github.com/rust-lang/cc-rs) | `1.1.10` | `1.1.13` | | [which](https://github.com/harryfei/which-rs) | `6.0.2` | `6.0.3` | Updates `serde` from 1.0.207 to 1.0.208 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.207...v1.0.208) Updates `serde_json` from 1.0.124 to 1.0.125 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.124...1.0.125) Updates `tokio` from 1.39.2 to 1.39.3 - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.39.2...tokio-1.39.3) Updates `libc` from 0.2.155 to 0.2.158 - [Release notes](https://github.com/rust-lang/libc/releases) - [Changelog](https://github.com/rust-lang/libc/blob/0.2.158/CHANGELOG.md) - [Commits](https://github.com/rust-lang/libc/compare/0.2.155...0.2.158) Updates `pulldown-cmark` from 0.11.0 to 0.12.0 - [Release notes](https://github.com/raphlinus/pulldown-cmark/releases) - [Commits](https://github.com/raphlinus/pulldown-cmark/compare/v0.11.0...v0.12.0) Updates `cc` from 1.1.10 to 1.1.13 - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.10...cc-v1.1.13) Updates `which` from 6.0.2 to 6.0.3 - [Release notes](https://github.com/harryfei/which-rs/releases) - [Changelog](https://github.com/harryfei/which-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/harryfei/which-rs/compare/6.0.2...6.0.3) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: libc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: pulldown-cmark dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rust-dependencies - dependency-name: cc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: which dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 41 +++++++++++++++++++++++--------------- helix-lsp-types/Cargo.toml | 4 ++-- helix-term/Cargo.toml | 4 ++-- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d70026343..d33f430f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,9 +136,12 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.1.10" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -1689,9 +1692,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -1937,9 +1940,9 @@ checksum = "744a264d26b88a6a7e37cbad97953fa233b94d585236310bcbc88474b4092d79" [[package]] name = "pulldown-cmark" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8746739f11d39ce5ad5c2520a9b75285310dbfe78c541ccf832d38615765aec0" +checksum = "4d31cbfcd94884c3a67ec210c83efb06cb43674043458b0ad59f6947f8462c23" dependencies = [ "bitflags 2.6.0", "memchr", @@ -2122,18 +2125,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.207" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.207" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", @@ -2142,9 +2145,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.124" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", "memchr", @@ -2184,6 +2187,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -2432,9 +2441,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", @@ -2664,9 +2673,9 @@ checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "which" -version = "6.0.2" +version = "6.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d9c5ed668ee1f17edb3b627225343d210006a90bb1e3745ce1f30b1fb115075" +checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", diff --git a/helix-lsp-types/Cargo.toml b/helix-lsp-types/Cargo.toml index 1dcc8f8c0..655b36f2f 100644 --- a/helix-lsp-types/Cargo.toml +++ b/helix-lsp-types/Cargo.toml @@ -22,8 +22,8 @@ license = "MIT" [dependencies] bitflags = "2.6.0" -serde = { version = "1.0.207", features = ["derive"] } -serde_json = "1.0.124" +serde = { version = "1.0.208", features = ["derive"] } +serde_json = "1.0.125" serde_repr = "0.1" url = {version = "2.0.0", features = ["serde"]} diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index d09919da5..5f691d44a 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -53,7 +53,7 @@ log = "0.4" nucleo.workspace = true ignore = "0.4" # markdown doc rendering -pulldown-cmark = { version = "0.11", default-features = false } +pulldown-cmark = { version = "0.12", default-features = false } # file type detection content_inspector = "0.2.4" thiserror = "1.0" @@ -74,7 +74,7 @@ grep-searcher = "0.1.13" [target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100 signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } -libc = "0.2.155" +libc = "0.2.158" [target.'cfg(target_os = "macos")'.dependencies] crossterm = { version = "0.28", features = ["event-stream", "use-dev-tty", "libc"] } From 620dfceb849d6b68d41d4f7678bb4675009fef4d Mon Sep 17 00:00:00 2001 From: Yavorski <3436517+yavorski@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:28:36 +0300 Subject: [PATCH 39/41] Add cshtml to html file-types (#11540) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 12b0ad049..cc437f78c 100644 --- a/languages.toml +++ b/languages.toml @@ -834,7 +834,7 @@ source = { git = "https://github.com/serenadeai/tree-sitter-scss", rev = "c478c6 name = "html" scope = "text.html.basic" injection-regex = "html" -file-types = ["html", "htm", "shtml", "xhtml", "xht", "jsp", "asp", "aspx", "jshtm", "volt", "rhtml"] +file-types = ["html", "htm", "shtml", "xhtml", "xht", "jsp", "asp", "aspx", "jshtm", "volt", "rhtml", "cshtml"] block-comment-tokens = { start = "" } language-servers = [ "vscode-html-language-server" ] auto-format = true From af7a1fd20c0a2915e0dae1b5bea7cb6bde6c2746 Mon Sep 17 00:00:00 2001 From: Lennard Hofmann Date: Sun, 25 Aug 2024 21:27:10 +0200 Subject: [PATCH 40/41] lsp: Gracefully ignore invalid diagnostic severity (#11569) --- helix-view/src/document.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 15aa81dae..91ec27874 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1920,12 +1920,15 @@ impl Document { return None; }; - let severity = diagnostic.severity.map(|severity| match severity { - lsp::DiagnosticSeverity::ERROR => Error, - lsp::DiagnosticSeverity::WARNING => Warning, - lsp::DiagnosticSeverity::INFORMATION => Info, - lsp::DiagnosticSeverity::HINT => Hint, - severity => unreachable!("unrecognized diagnostic severity: {:?}", severity), + let severity = diagnostic.severity.and_then(|severity| match severity { + lsp::DiagnosticSeverity::ERROR => Some(Error), + lsp::DiagnosticSeverity::WARNING => Some(Warning), + lsp::DiagnosticSeverity::INFORMATION => Some(Info), + lsp::DiagnosticSeverity::HINT => Some(Hint), + severity => { + log::error!("unrecognized diagnostic severity: {:?}", severity); + None + } }); if let Some(lang_conf) = language_config { From 1b5295a3f3d7cccd96eed5bfd394807a4dae87fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 23:56:28 +0900 Subject: [PATCH 41/41] build(deps): bump the rust-dependencies group with 4 updates (#11585) Bumps the rust-dependencies group with 4 updates: [serde](https://github.com/serde-rs/serde), [serde_json](https://github.com/serde-rs/json), [cc](https://github.com/rust-lang/cc-rs) and [gix](https://github.com/Byron/gitoxide). Updates `serde` from 1.0.208 to 1.0.209 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.208...v1.0.209) Updates `serde_json` from 1.0.125 to 1.0.127 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/1.0.125...1.0.127) Updates `cc` from 1.1.13 to 1.1.15 - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.13...cc-v1.1.15) Updates `gix` from 0.64.0 to 0.66.0 - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.64.0...gix-v0.66.0) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: cc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: gix dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rust-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 246 +++++++++++++++---------------------- helix-lsp-types/Cargo.toml | 4 +- helix-vcs/Cargo.toml | 2 +- 3 files changed, 101 insertions(+), 151 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d33f430f9..d2f906698 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,9 +136,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.1.13" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "shlex", ] @@ -349,15 +349,6 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - [[package]] name = "dunce" version = "1.0.5" @@ -545,9 +536,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.64.0" +version = "0.66.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78414d29fcc82329080166077e0f7689f4016551fdb334d787c3d040fe2634f" +checksum = "9048b8d1ae2104f045cb37e5c450fc49d5d8af22609386bfc739c11ba88995eb" dependencies = [ "gix-actor", "gix-attributes", @@ -567,7 +558,6 @@ dependencies = [ "gix-ignore", "gix-index", "gix-lock", - "gix-macros", "gix-object", "gix-odb", "gix-pack", @@ -594,9 +584,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.5" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e454357e34b833cc3a00b6efbbd3dd4d18b24b9fb0c023876ec2645e8aa3f2" +checksum = "fc19e312cd45c4a66cd003f909163dc2f8e1623e30a0c0c6df3776e89b308665" dependencies = [ "bstr", "gix-date", @@ -608,9 +598,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37ce99c7e81288c28b703641b6d5d119aacc45c1a6b247156e6249afa486257" +checksum = "ebccbf25aa4a973dd352564a9000af69edca90623e8a16dad9cbc03713131311" dependencies = [ "bstr", "gix-glob", @@ -643,9 +633,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d76867867da891cbe32021ad454e8cae90242f6afb06762e4dd0d357afd1d7b" +checksum = "dff2e692b36bbcf09286c70803006ca3fd56551a311de450be317a0ab8ea92e7" dependencies = [ "bstr", "gix-path", @@ -669,9 +659,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.38.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28f53fd03d1bf09ebcc2c8654f08969439c4556e644ca925f27cf033bc43e658" +checksum = "78e797487e6ca3552491de1131b4f72202f282fb33f198b1c34406d765b42bb0" dependencies = [ "bstr", "gix-config-value", @@ -690,9 +680,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b328997d74dd15dc71b2773b162cb4af9a25c424105e4876e6d0686ab41c383e" +checksum = "03f76169faa0dec598eac60f83d7fcdd739ec16596eca8fb144c88973dbe6f8c" dependencies = [ "bitflags 2.6.0", "bstr", @@ -703,21 +693,21 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.7" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" +checksum = "35c84b7af01e68daf7a6bb8bb909c1ff5edb3ce4326f1f43063a5a96d3c3c8a5" dependencies = [ "bstr", "itoa", + "jiff", "thiserror", - "time", ] [[package]] name = "gix-diff" -version = "0.44.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1996d5c8a305b59709467d80617c9fde48d9d75fd1f4179ea970912630886c9d" +checksum = "92c9afd80fff00f8b38b1c1928442feb4cd6d2232a6ed806b6b193151a3d336c" dependencies = [ "bstr", "gix-command", @@ -735,9 +725,9 @@ dependencies = [ [[package]] name = "gix-dir" -version = "0.6.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c975679aa00dd2d757bfd3ddb232e8a188c0094c3306400575a0813858b1365" +checksum = "0ed3a9076661359a1c5a27c12ad6c3ebe2dd96b8b3c0af6488ab7c128b7bdd98" dependencies = [ "bstr", "gix-discover", @@ -755,9 +745,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67662731cec3cb31ba3ed2463809493f76d8e5d6c6d245de8b0560438c13450e" +checksum = "0577366b9567376bc26e815fd74451ebd0e6218814e242f8e5b7072c58d956d2" dependencies = [ "bstr", "dunce", @@ -790,9 +780,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.11.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6547738da28275f4dff4e9f3a0f28509f53f94dd6bd822733c91cb306bca61a" +checksum = "4121790ae140066e5b953becc72e7496278138d19239be2e63b5067b0843119e" dependencies = [ "bstr", "encoding_rs", @@ -811,9 +801,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6adf99c27cdf17b1c4d77680c917e0d94d8783d4e1c73d3be0d1d63107163d7a" +checksum = "f2bfe6249cfea6d0c0e0990d5226a4cb36f030444ba9e35e0639275db8f98575" dependencies = [ "fastrand", "gix-features", @@ -822,9 +812,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.16.4" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7df15afa265cc8abe92813cd354d522f1ac06b29ec6dfa163ad320575cb447" +checksum = "74908b4bbc0a0a40852737e5d7889f676f081e340d5451a16e5b4c50d592f111" dependencies = [ "bitflags 2.6.0", "bstr", @@ -855,9 +845,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6afb8f98e314d4e1adc822449389ada863c174b5707cedd327d67b84dba527" +checksum = "e447cd96598460f5906a0f6c75e950a39f98c2705fc755ad2f2020c9e937fab7" dependencies = [ "bstr", "gix-glob", @@ -868,9 +858,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.33.1" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9a44eb55bd84bb48f8a44980e951968ced21e171b22d115d1cdcef82a7d73f" +checksum = "0cd4203244444017682176e65fd0180be9298e58ed90bd4a8489a357795ed22d" dependencies = [ "bitflags 2.6.0", "bstr", @@ -905,22 +895,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gix-macros" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "gix-object" -version = "0.42.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25da2f46b4e7c2fa7b413ce4dffb87f69eaf89c2057e386491f4c55cadbfe386" +checksum = "2f5b801834f1de7640731820c2df6ba88d95480dc4ab166a5882f8ff12b88efa" dependencies = [ "bstr", "gix-actor", @@ -937,9 +916,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.61.1" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20d384fe541d93d8a3bb7d5d5ef210780d6df4f50c4e684ccba32665a5e3bc9b" +checksum = "a3158068701c17df54f0ab2adda527f5a6aca38fd5fd80ceb7e3c0a2717ec747" dependencies = [ "arc-swap", "gix-date", @@ -957,9 +936,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.51.1" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0594491fffe55df94ba1c111a6566b7f56b3f8d2e1efc750e77d572f5f5229" +checksum = "3223aa342eee21e1e0e403cad8ae9caf9edca55ef84c347738d10681676fd954" dependencies = [ "clru", "gix-chunk", @@ -975,9 +954,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.17.4" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31d42378a3d284732e4d589979930d0d253360eccf7ec7a80332e5ccb77e14a" +checksum = "b9802304baa798dd6f5ff8008a2b6516d54b74a69ca2d3a2b9e2d6c3b5556b40" dependencies = [ "bstr", "faster-hex", @@ -987,9 +966,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.9" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d23d5bbda31344d8abc8de7c075b3cf26e5873feba7c4a15d916bce67382bd9" +checksum = "38d5b8722112fa2fa87135298780bc833b0e9f6c56cc82795d209804b3a03484" dependencies = [ "bstr", "gix-trace", @@ -1000,9 +979,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d307d1b8f84dc8386c4aa20ce0cf09242033840e15469a3ecba92f10cfb5c046" +checksum = "5d23bf239532b4414d0e63b8ab3a65481881f7237ed9647bb10c1e3cc54c5ceb" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1026,9 +1005,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.45.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "636e96a0a5562715153fee098c217110c33a6f8218f08f4687ff99afde159bb5" +checksum = "ae0d8406ebf9aaa91f55a57f053c5a1ad1a39f60fdf0303142b7be7ea44311e5" dependencies = [ "gix-actor", "gix-features", @@ -1047,9 +1026,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6868f8cd2e62555d1f7c78b784bece43ace40dd2a462daf3b588d5416e603f37" +checksum = "ebb005f82341ba67615ffdd9f7742c87787544441c88090878393d0682869ca6" dependencies = [ "bstr", "gix-hash", @@ -1061,9 +1040,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.27.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b13e43c2118c4b0537ddac7d0821ae0dfa90b7b8dbf20c711e153fb749adce" +checksum = "ba4621b219ac0cdb9256883030c3d56a6c64a6deaa829a92da73b9a576825e1e" dependencies = [ "bstr", "gix-date", @@ -1075,9 +1054,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b030ccaab71af141f537e0225f19b9e74f25fefdba0372246b844491cab43e0" +checksum = "b41e72544b93084ee682ef3d5b31b1ba4d8fa27a017482900e5e044d5b1b3984" dependencies = [ "gix-commitgraph", "gix-date", @@ -1090,9 +1069,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1547d26fa5693a7f34f05b4a3b59a90890972922172653bcb891ab3f09f436df" +checksum = "0fe4d52f30a737bbece5276fab5d3a8b276dc2650df963e293d0673be34e7a5f" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -1102,9 +1081,9 @@ dependencies = [ [[package]] name = "gix-status" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f7b084cb65c3d007ce6bb479755ca13d602ca3cd91c4f08d7e59904de33736" +checksum = "f70d35ba639f0c16a6e4cca81aa374a05f07b23fa36ee8beb72c100d98b4ffea" dependencies = [ "bstr", "filetime", @@ -1125,9 +1104,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2e0f69aa00805e39d39ec80472a7e9da20ed5d73318b27925a2cc198e854fd" +checksum = "529d0af78cc2f372b3218f15eb1e3d1635a21c8937c12e2dd0b6fc80c2ca874b" dependencies = [ "bstr", "gix-config", @@ -1160,9 +1139,9 @@ checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" [[package]] name = "gix-traverse" -version = "0.39.2" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e499a18c511e71cf4a20413b743b9f5bcf64b3d9e81e9c3c6cd399eae55a8840" +checksum = "030da39af94e4df35472e9318228f36530989327906f38e27807df305fccb780" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1177,9 +1156,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.27.4" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2eb9b35bba92ea8f0b5ab406fad3cf6b87f7929aa677ff10aa042c6da621156" +checksum = "fd280c5e84fb22e128ed2a053a0daeacb6379469be6a85e3d518a0636e160c89" dependencies = [ "bstr", "gix-features", @@ -1202,9 +1181,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.8.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c27dd34a49b1addf193c92070bcbf3beaf6e10f16a78544de6372e146a0acf" +checksum = "81f2badbb64e57b404593ee26b752c26991910fd0d81fe6f9a71c1a8309b6c86" dependencies = [ "bstr", "thiserror", @@ -1212,9 +1191,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.34.1" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f7326ebe0b9172220694ea69d344c536009a9b98fb0f9de092c440f3efe7a6" +checksum = "c312ad76a3f2ba8e865b360d5cb3aa04660971d16dec6dd0ce717938d903149a" dependencies = [ "bstr", "gix-attributes", @@ -1672,6 +1651,31 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +[[package]] +name = "jiff" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ef8bc400f8312944a9f879db116fed372c4f0859af672eba2a80f79c767dd19" +dependencies = [ + "jiff-tzdb-platform", + "windows-sys 0.59.0", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05fac328b3df1c0f18a3c2ab6cb7e06e4e549f366017d796e3e66b6d6889abe6" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8da387d5feaf355954c2c122c194d6df9c57d865125a67984bb453db5336940" +dependencies = [ + "jiff-tzdb", +] + [[package]] name = "js-sys" version = "0.3.61" @@ -1804,12 +1808,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-traits" version = "0.2.15" @@ -1829,15 +1827,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "object" version = "0.31.1" @@ -1917,12 +1906,6 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "proc-macro2" version = "1.0.76" @@ -2125,18 +2108,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", @@ -2145,9 +2128,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -2391,39 +2374,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tinyvec" version = "1.6.0" diff --git a/helix-lsp-types/Cargo.toml b/helix-lsp-types/Cargo.toml index 655b36f2f..1ecb3d810 100644 --- a/helix-lsp-types/Cargo.toml +++ b/helix-lsp-types/Cargo.toml @@ -22,8 +22,8 @@ license = "MIT" [dependencies] bitflags = "2.6.0" -serde = { version = "1.0.208", features = ["derive"] } -serde_json = "1.0.125" +serde = { version = "1.0.209", features = ["derive"] } +serde_json = "1.0.127" serde_repr = "0.1" url = {version = "2.0.0", features = ["serde"]} diff --git a/helix-vcs/Cargo.toml b/helix-vcs/Cargo.toml index 79d736a1e..245fdb8dc 100644 --- a/helix-vcs/Cargo.toml +++ b/helix-vcs/Cargo.toml @@ -19,7 +19,7 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "p parking_lot = "0.12" arc-swap = { version = "1.7.1" } -gix = { version = "0.64.0", features = ["attributes", "status"], default-features = false, optional = true } +gix = { version = "0.66.0", features = ["attributes", "status"], default-features = false, optional = true } imara-diff = "0.1.7" anyhow = "1"