Skip to content
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

fix: parse arguments properly in certain circumstances #103

Closed
wants to merge 3 commits into from

Conversation

amaanq
Copy link
Contributor

@amaanq amaanq commented Apr 29, 2023

Closes #102

Didn't test everything imaginable, but the ones linked in the issue parse fine now

vim.foo({bar})

vim.foo( {bar})

nvim_foo({bar})

nvim_foo({bar},{baz})

nvim_foo({bar}, {baz})

image

@clason
Copy link
Member

clason commented Apr 30, 2023

Hmm, that fails two tests (tree-sitter test, or make all).

@amaanq
Copy link
Contributor Author

amaanq commented Apr 30, 2023

that failing would make sense, i'll update the tests accordingly :) but idk why CI didn't catch that

@amaanq
Copy link
Contributor Author

amaanq commented Apr 30, 2023

Seems like that might've fixed one of the tests anyways

@clason
Copy link
Member

clason commented Apr 30, 2023

but idk why CI didn't catch that

because you didn't push the generated parser.c?

@clason
Copy link
Member

clason commented Apr 30, 2023

I think you also need to add [ (see, e.g., :h nvim_buf_detach_event).

@clason
Copy link
Member

clason commented Apr 30, 2023

And can you add a new test for these?

@amaanq amaanq force-pushed the arguments branch 2 times, most recently from 2dc09e1 to 3a98393 Compare April 30, 2023 10:17
@amaanq
Copy link
Contributor Author

amaanq commented Apr 30, 2023

done

@clason

This comment was marked as resolved.

@amaanq

This comment was marked as resolved.

@clason

This comment was marked as resolved.

@clason
Copy link
Member

clason commented Apr 30, 2023

This adds a regression in indent.txt (:h ft-sh-indent) around

b:sh_indent_options['default']	Default amount of indent.

The 'default' is now recognized as a optionlink. (But not the lines below, curiously -- because they have a dash in them.)

There's also a few other regressions in taglinks, such as :h v_aB in motion.txt and |,| in map.txt (while most of them can be fixed by changing the help file, this cannot, so it's a blocker).

@amaanq
Copy link
Contributor Author

amaanq commented May 1, 2023

Added another ugly hack for it, lmk of any others oddities

@clason
Copy link
Member

clason commented May 1, 2023

Still breaks the taglink in map.txt.

@amaanq
Copy link
Contributor Author

amaanq commented May 11, 2023

This flew off the radar...what's the taglink in map.txt? I'm unfamiliar with vimdoc semantics

@clason
Copy link
Member

clason commented May 11, 2023

|,| (which is a link to the tag for ,).


nvim_foo({bar}, {baz})

nvim_buf_detach_event[{buf}]
Copy link
Member

@justinmk justinmk Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

args may have whitespace ({arg arg}) but that's already tested on line 4

Actually, allowing whitespace in args is not part of vim's help syntax, and it causes lots of problems. So I reverted that "feature" in #97

Copy link
Member

@justinmk justinmk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks worth a try. Thanks!

@justinmk
Copy link
Member

Will revisit/rebase this after #97

@justinmk
Copy link
Member

Rebased in #108

'[',
']',
'[\'',
'\']',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are [' and '] important special cases or could we drop these?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that was done to work around the b:sh_indent_options mentioned earlier. So if those are fixed by your other changes (or deemed "won't fix" by simply wrapping them in backticks) they could indeed go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Argument in some functions is not recognized if not preceded by whitespace
3 participants