-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: Collapse identifiers seperated by hyphens or underscores if they exist in the file dictionary #199
Conversation
Tests need to be fixed. |
@@ -242,6 +242,11 @@ impl TokenKind { | |||
matches!(self, TokenKind::Punctuation(Punctuation::At)) | |||
} | |||
|
|||
pub fn is_case_separator(&self) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be two separate functions, but it's probably OK for now. If someone really wants it I can figure out how to do OR in pattern matching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably fine to leave this here, but if you do, add a doc-comment that explains what a "case separator" is and why it's needed.
I would much rather create an OR Pattern
and use that though, since we need one anyway. It's up to you which you decide to do (laziness is totally fine in this case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great in harper-ls. Just a small issue for harper-cli
Overall, this is really great work @grantlemons. I've left a few (nitpicky) comments on some bits. They should be pretty straightforward changes. Other than those, would you mind changing your commit messages to match Conventional Commits? Feel free to force-push to the feature branch. I would also mention issue #160 in them:
|
@@ -242,6 +242,11 @@ impl TokenKind { | |||
matches!(self, TokenKind::Punctuation(Punctuation::At)) | |||
} | |||
|
|||
pub fn is_case_separator(&self) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably fine to leave this here, but if you do, add a doc-comment that explains what a "case separator" is and why it's needed.
I would much rather create an OR Pattern
and use that though, since we need one anyway. It's up to you which you decide to do (laziness is totally fine in this case).
pub use markdown::Markdown; | ||
pub use mask::Mask; | ||
pub use plain_english::PlainEnglish; | ||
|
||
pub use crate::token::{Token, TokenKind, TokenStringExt}; | ||
|
||
#[cfg(not(feature = "concurrent"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this wasn't already here. How was harper-cli
able to compile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk, I just checked, and it turns out mask::Masker
uses Sync too and doesn't have a concurrent cfg.
…mmentParser with it
684c4b0
to
3e322c9
Compare
… is_case_seperator comment to tokens.rs
No description provided.