-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add OCaml support with ocamlformat #154
base: master
Are you sure you want to change the base?
Conversation
It seems that the failed tests are unrelated to this cl, but in prettier and clang-format. The ocamlformat vroom tests passed :) |
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.
Thanks! And thanks for bearing with me on delays getting it reviewed!
let l:fname = expand('%:p') | ||
if !empty(l:fname) | ||
let l:cmd += ['--name', l:fname] | ||
let l:fname_pattern = '"' . escape(l:fname, '\') . '"' |
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.
Consider defining this closer to the usage. Currently it looks really fishy doing all this escaping and concatenation without any hints what it's used for until much further down.
let l:matchidx = 1 | ||
while 1 | ||
let l:tokens = matchlist(v:exception, | ||
\ '\vFile ' . l:fname_pattern . ', line (\d+), characters (\d+)-\d+:\n(.*)\n', 0, l:matchidx) |
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.
Instead of the double indirection matching the output using (1) a pattern built from (2) a dynamic variable, could you just do a looser match for anything that looks like "filename or " and skip any that don't match? This seems like it could be brittle if e.g. paths may be absolute/relative, or have any trivial extra characters like "./".
Signed-off-by: Ari Archer <truncateddinosour@gmail.com>
No description provided.