-
Notifications
You must be signed in to change notification settings - Fork 2
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
Editor mode implemented #69
base: main
Are you sure you want to change the base?
Conversation
Problem: at this moment we use our own format in editor mode. Reinventing the wheel can be hard and time consuming. Solution: changed this format to `TOML`.
Problem: at this moment `entry path` is required argument. Sometimes we don't want to specify entry path in editor mode while creating entry. Solution: made `entry path` in `create` command optional argument.
Problem: `tomland` is bugging on non-ascii characters and `toml` spec doesn't support some escape sequences like `\NUL` or `\DEL`. Solution: rollbacked on our homebrewed editor file format and added tags support.
Problem: after changes in editor mode unit and property tests are not compiling. Moreover, they are outdated. Solution: updated these tests.
904796a
to
be67a10
Compare
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.
Currently, the only option to abort creating an entry using editor mode is to somehow kill the terminal. Could we have another way to abort the creation? Maybe by putting special line in the beginning of the file or clearing the file totally.
> pw 1234 | ||
> # ^ | ||
> # unexpected '1' | ||
> # expecting '=' or white space | ||
-} | ||
annotateParseErrors :: [ParseError] -> [AnnotatedLine] -> [AnnotatedLine] | ||
annotateParseErrors errors lines = foldl' annotateParseError lines errors | ||
annotateEditorFile :: ParseErrorBundle Text Void -> Text -> [AnnotatedLine] |
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.
When user tries to save incorrect file multiple times, the same error description appends to the end of the existing one.
Example:
BAD_FORMAT
[tags]
#^
# unexpected "[t"
# expecting "=~" or '='
#^
# unexpected "[t"
# expecting "=~" or '='
Maybe we could avoid this
Description
An
[-e|--edit]
implementation. It opens a temporary file where you seeTOML
-like representation of an entry.Also, I've made
entry path
inCreateOptions
parser optional argument.Related issue(s)
No related issues.
✅ Checklist for your Pull Request
Related changes (conditional)
silently reappearing again.
of Public Contracts policy.
and
Stylistic guide (mandatory)