-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JEWEL-600] Use chars indexes for markdown edits #2922
base: master
Are you sure you want to change the base?
Conversation
TODO: address Jacob's suggestions: Please consider renaming variables or extracting some functionality into smaller functions that explain themselves in the title, and/or adding some more larger comments. e.g. all the stuff about prefix, suffix, and positions doesn't really make sense in the context of processing a string which represents markdown imo. Perhaps textMatchingBeforeEdits and and textMatchingAfterEdits, would be more appropriate. Additionally, firstBlock could be firstMarkdownBlockThatNeedsProcessed or firstChangedMarkdownBlock A comment explaining what the function is doing at the high level would help a lot too. e.g. "Process markdown quickly by comparing it to the previously processed markdown and discarding text that matched before the edits and after the edits by doing string comparisons on the text. After processing update our state again with our newly processed markdown blocks." (or something) or perhaps just a comment showing an example would help e.g. "abcdefg" vs "abcefg". |
@obask please always preface PR titles with |
23ad03d
to
56452a3
Compare
...l/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt
Outdated
Show resolved
Hide resolved
...l/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt
Outdated
Show resolved
Hide resolved
@obask Is it still a draft? Are there any other substantial changes planned? |
Yesterday he said he'd rebase to solve the CI issues and mark as ready to review. @obask can you please do it? |
151ba05
to
738b568
Compare
738b568
to
4794382
Compare
@obask static analysis is failing, can you take a look? |
4794382
to
2b8a55f
Compare
Format project doesn't rearrange (star) imports, so I did it in an IDE. It should work now. |
There is still some static analysis issue (and yes, star imports are only really addressed by the IDE, because ktfmt doesn't have access to the classpath to resolve these imports) |
Our previouis version was marking a previouis and the following blocks as modified, while it's not needed in most cases. We can use use 0.24.0 inputIndex parameter to simply keep an index from char to block and avoid splitting lines and doing complicated search for a modified substring.
2b8a55f
to
eee09a3
Compare
Our previouis version was marking a previouis
and the following blocks as modified, while it's
not needed in most cases.
We can use use 0.24.0 inputIndex parameter to
simply keep an index from char to block and avoid
splitting lines and doing complicated search for
a modified substring.