-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor completion and signature help using hooks
- Loading branch information
1 parent
c4fc6c3
commit 9c1de44
Showing
19 changed files
with
1,022 additions
and
560 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod env; | ||
pub mod path; | ||
pub mod rope; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use ropey::RopeSlice; | ||
|
||
pub trait RopeSliceExt: Sized { | ||
fn ends_with(self, text: &str) -> bool; | ||
fn starts_with(self, text: &str) -> bool; | ||
} | ||
|
||
impl RopeSliceExt for RopeSlice<'_> { | ||
fn ends_with(self, text: &str) -> bool { | ||
let len = self.len_bytes(); | ||
if len < text.len() { | ||
return false; | ||
} | ||
self.get_byte_slice(len - text.len()..) | ||
.map_or(false, |end| end == text) | ||
} | ||
|
||
fn starts_with(self, text: &str) -> bool { | ||
let len = self.len_bytes(); | ||
if len < text.len() { | ||
return false; | ||
} | ||
self.get_byte_slice(..len - text.len()) | ||
.map_or(false, |start| start == text) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.