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

Adding JQ Syntax to vim! #14619

Closed
wants to merge 3 commits into from
Closed

Adding JQ Syntax to vim! #14619

wants to merge 3 commits into from

Conversation

vito-c
Copy link
Contributor

@vito-c vito-c commented Apr 22, 2024

I am adding jq syntax to vim as well as updating the maintainer for json.
@itchyny @dtolnay @Freed-Wu

let s:save_cpoptions = &cpoptions
set cpoptions&vim

if exists(':CompilerSet') != 2
Copy link
Member

Choose a reason for hiding this comment

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

You can remove the exists(':CompilerSet') test. We just removed this from the other compilers.

let b:did_ftplugin = 1

let s:save_cpoptions = &cpoptions
set cpoptions&vim
Copy link
Member

Choose a reason for hiding this comment

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

You are not using line-continuation here, so you can remove the save and restore of 'cpoptions'

syn match jqNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
syn match jqNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala

if !exists('jq_quote_highlight')
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a section at :h syntax.txt for this configuration settig?

"hi def link jqRepeat Repeat
"hi def link jqException Exception
"hi def link jqInclude Include
"hi def link jqDecorator Define
Copy link
Member

Choose a reason for hiding this comment

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

can you remove those commented out sections?

@chrisbra
Copy link
Member

can you please also update https://github.com/vim/vim/blob/master/.github/CODEOWNERS?

@vito-c vito-c force-pushed the jqsyntax branch 2 times, most recently from 65e1f2b to d495c69 Compare April 26, 2024 20:10
@vito-c
Copy link
Contributor Author

vito-c commented Apr 26, 2024

@chrisbra Should I resolve the comments as I fix the issues or do you want to resolve them after you have verified?

@chrisbra
Copy link
Member

Ah thanks. The documentation is still wrong, it uses :set, but I can fix this when merging.

@chrisbra chrisbra closed this in 79952b9 Apr 26, 2024
clason added a commit to clason/neovim that referenced this pull request Apr 27, 2024
runtime(jq): include syntax, ftplugin and compiler plugin

closes: vim/vim#14619

vim/vim@79952b9

Co-authored-by: Vito <vito.blog@gmail.com>
clason added a commit to neovim/neovim that referenced this pull request Apr 27, 2024
runtime(jq): include syntax, ftplugin and compiler plugin

closes: vim/vim#14619

vim/vim@79952b9

Co-authored-by: Vito <vito.blog@gmail.com>
setlocal commentstring=#%s
compiler jq

let &cpoptions = s:save_cpoptions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need to remove this as well

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.

None yet

2 participants