-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement indentation #47
Conversation
@MoisMoshev thank you for the PR. I will review, and if things go well, merge it in. Thank you for the contribution!!! |
@MoisMoshev I am really swamped this week, but will look at it in more detail either later half of the week or this weekend. This is going to a major feature in the next version of the release. Thank you very much for contributing the PR! |
Excellent, makes me very happy! |
Perfect. Thanks @MoisMoshev. Will get this merged in asap. Something came up this weekend and going to have to delay my review until mid next week. my apologies. I'm looking forward to the review. |
@MoisMoshev firstly, thank you for the PR. I really appreciate it. I would love to get it in, but there are some problems. Would you mind taking a look at some of the comments and seeing if you could fix them?
|
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.
Thank you very much for the PR and for being patient. Please fix comments below.
|
||
(defun d2--sort-tokens-by-line (tokens) | ||
"Sort TOKENS by line number." | ||
(sort tokens |
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.
@MoisMoshev I ran this locally, and also ran into this problem. 3 arguments, but only accepts two. Can you clean this up?
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.
Hmm I'm confused by this, sort takes just one positional, and key arguments:
(sort SEQ &key KEY LESSP REVERSE IN-PLACE)
So it looks ok...? I don't think this changed recently. I'm running emacs 30.0.50
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.
Nevermind, just checked in Emacs 29 and indeed the signature changed. It should be
(sort SEQ PREDICATE)
brb
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.
Fixed
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.
Love it. Thank you.
d2-mode.el
Outdated
"->" "--" "<-")) | ||
(? (group ":" (one-or-more space))) | ||
(? (group (one-or-more (not (any ?{ ?}))))) | ||
"{" |
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.
"{" | |
"{")) |
d2-mode.el
Outdated
(? (group ":" (one-or-more space))) | ||
(? (group (one-or-more (not (any ?{ ?}))))) | ||
"{" | ||
)) |
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.
)) |
d2-mode.el
Outdated
(list node subnode-start end connection))) | ||
|
||
;;; declaration part handling | ||
(defun d2--decl-tag (decl) (car decl)) |
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.
TODO: Please update with doc strings
@MoisMoshev once the build checks are passing, I'll be happy to re-evaluate this and try to merge it in. The PR was really helpful. Thank you again. |
Thanks, I'll take care of it in the coming days. |
Everything fixed |
Running everything over CI/CD. Then will check locally. If looks good, will merge in. Thank you! |
Some seem like an issue in the environment, e.g.: This one I might have to fix: |
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.
approved! ci/cd to be fixed before bumping tag on repo. Thanks for the PR! It was really helpful.
Fixes #45
Implements simple parsing of current and previous lines, and calculation of indentation, depending on the syntax.
It is still a bit rough, the regexes might have to be adjusted.