JSON is not JavaScript

302 views
Skip to first unread message

Eddie Monge

unread,
Nov 17, 2013, 3:25:03 PM11/17/13
to vim...@googlegroups.com
JSON is a hyper-strict subset of JavaScript-like syntax. It should not be treated as JS. Treating it as JS breaks all sorts of other plugins for minimum gain, if any.

https://github.com/b4winckler/macvim/pull/39

39.diff.txt

Ingo Karkat

unread,
Nov 18, 2013, 3:31:50 AM11/18/13
to vim...@googlegroups.com
On 17-Nov-2013 21:25 +0100, Eddie Monge wrote:

> JSON is a hyper-strict subset of JavaScript-like syntax. It should not be treated as JS. Treating it as JS breaks all sorts of other plugins for minimum gain, if any.
>
> https://github.com/b4winckler/macvim/pull/39
>

There's a dedicated JSON (syntax + indent) plugin. I think it should be
included in the official runtime, and I've just asked the author to
request this:
https://github.com/elzr/vim-json/issues/20

-- regards, ingo

Bram Moolenaar

unread,
Nov 18, 2013, 2:09:38 PM11/18/13
to Eddie Monge, vim...@googlegroups.com
OK, but it would be nice to have syntax and indent files for json.
Which would borrow some parts from Javascript.
Can't be difficult, someone wants to take this on?

Oh, Ingo mentions there is some. Hmm, it's unclear where it came from.


--
I have read and understood the above. X________________

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Nikolay Pavlov

unread,
Nov 18, 2013, 2:24:41 PM11/18/13
to vim...@googlegroups.com, Eddie Monge


On Nov 18, 2013 11:09 PM, "Bram Moolenaar" <Br...@moolenaar.net> wrote:
>
>
> Eddie Monge wrote:
>
> > JSON is a hyper-strict subset of JavaScript-like syntax. It should not
> > be treated as JS. Treating it as JS breaks all sorts of other plugins
> > for minimum gain, if any.
> >
> > https://github.com/b4winckler/macvim/pull/39
>
> OK, but it would be nice to have syntax and indent files for json.
> Which would borrow some parts from Javascript.
> Can't be difficult, someone wants to take this on?

You can just as well borrow parts of YAML. It is also a JSON superset, but with way too less features as the programming language like JavaScript.

>
> Oh, Ingo mentions there is some.  Hmm, it's unclear where it came from.
>
>
> --
> I have read and understood the above. X________________
>
>  /// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net   \\\
> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org        ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
>

> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

elzr

unread,
Aug 22, 2014, 6:13:19 PM8/22/14
to vim...@googlegroups.com, ed...@eddiemonge.com
Hi Bram,

I'm the author of the JSON plugin Ingo mentioned[1]. It's built on Jeroen Ruigrok van der Werven's JSON plugin[2] and he himself recommends this update. Both works are MIT licensed[3].

I'd hereby like to submit the plugin for inclusion in the official runtime and commit myself to its maintenance. Since 9 months ago Ingo approached me about it but I wasn't sure at the moment if the plugin was ready or popular enough. With no marketing on my part the plugin has reached 241 stars on github and we've closed 20 issues[4] as its functionality has grown and been refined.

Thanks,

-Eli Parra

1: https://github.com/elzr/vim-json
2: http://www.vim.org/scripts/script.php?script_id=1945
3: https://github.com/elzr/vim-json/issues/6
4: https://github.com/elzr/vim-json/issues?q=is%3Aissue+is%3Aclosed

Bram Moolenaar

unread,
Aug 23, 2014, 9:24:17 AM8/23/14
to elzr, vim...@googlegroups.com, ed...@eddiemonge.com

Eli -

> I'm the author of the JSON plugin Ingo mentioned[1]. It's built on
> Jeroen Ruigrok van der Werven's JSON plugin[2] and he himself
> recommends this update. Both works are MIT licensed[3].
>
> I'd hereby like to submit the plugin for inclusion in the official
> runtime and commit myself to its maintenance. Since 9 months ago Ingo
> approached me about it but I wasn't sure at the moment if the plugin
> was ready or popular enough. With no marketing on my part the plugin
> has reached 241 stars on github and we've closed 20 issues[4] as its
> functionality has grown and been refined.

Thanks. I will assume you want this distributed under the Vim license.

For the ftplugin, please add a header with the maintainer.

The indent file mentions Rogerz Zhang as the maintainer.
Apparently it's from http://github.com/rogerz/vim-json.
I rather have him send it to me.

I can include the syntax file. The date in the header should be updated
though. Fortunately that happens automatically when I write it :-)

The HiLink command that is used is a very old mechanism. These days it
should be OK to just use "hi def link".

- Bram

--
Never go to the toilet in a paperless office.

elzr

unread,
Aug 24, 2014, 8:26:55 PM8/24/14
to vim...@googlegroups.com, ely....@gmail.com
Bram,

Thanks for the tips.
I've updated/added maintainer headers & moved to "hi def link" in the syntax file.
Yes on the Vim license.

I've just emailed Rogerz Zhang about our thread, asking him to chime in.

-Eli

Rogerz Zhang

unread,
Aug 25, 2014, 9:21:50 AM8/25/14
to vim...@googlegroups.com, ely....@gmail.com, ed...@eddiemonge.com
Hi, Bram


On Saturday, August 23, 2014 9:24:17 PM UTC+8, Bram Moolenaar wrote:
> Eli -
> > I'm the author of the JSON plugin Ingo mentioned[1]. It's built on
>
> > Jeroen Ruigrok van der Werven's JSON plugin[2] and he himself
>
> > recommends this update. Both works are MIT licensed[3].

> The indent file mentions Rogerz Zhang as the maintainer.
>
> Apparently it's from http://github.com/rogerz/vim-json.
>
> I rather have him send it to me.

I've add an MIT license[1] to my original code. I assume it is compatible with VIM license.

@Eli,

I've add a link to your repository[2] since I'm no longer maintaining it. Thanks for your work.

1. https://github.com/rogerz/vim-json/blob/master/LICENSE
2. https://github.com/elzr/vim-json

--
rogerz

elzr

unread,
Aug 25, 2014, 2:35:41 PM8/25/14
to vim...@googlegroups.com, ely....@gmail.com, ed...@eddiemonge.com
Thanks rogerz!

Bram, I've changed the header of the indent file on my JSON plugin so it now lists me as the current maintainer and rogerz as the original author (it had already started diverging from Zhang's version).

With this and rogerz's MIT licensing, I think we're ready. :)

glts

unread,
Aug 25, 2014, 3:09:38 PM8/25/14
to vim...@googlegroups.com
Hi Eli,

thank you for your efforts.

I've noticed this plugin will conceal double quotes by default.

For me, this is unacceptable. I, and I assume many programmers, prefer
to see the actual code I'm editing. All of it.

Sorry to add this discordant note to the thread. It's no big deal to use
the provided g: variable but defaults are important.

Cheers,


--
David

Bram Moolenaar

unread,
Aug 25, 2014, 5:04:30 PM8/25/14
to glts, vim...@googlegroups.com
I agree, hiding quotes should be an optional item, not the default.
I don't think I would want that option on.

--
hundred-and-one symptoms of being an internet addict:
64. The remote to the T.V. is missing...and you don't even care.

Bram Moolenaar

unread,
Aug 25, 2014, 5:04:32 PM8/25/14
to elzr, vim...@googlegroups.com, ed...@eddiemonge.com

Ely Parra wrote:

> Thanks rogerz!
>
> Bram, I've changed the header of the indent file on my JSON plugin so
> it now lists me as the current maintainer and rogerz as the original
> author (it had already started diverging from Zhang's version).
>
> With this and rogerz's MIT licensing, I think we're ready. :)

I'm getting confused about what version of the file we are talking
about. I don't see the license in the current version of the indent
file. That would normally mean the Vim license applies, but since it
was MIT before, that should be explicitly stated.

--
hundred-and-one symptoms of being an internet addict:
65. The last time you looked at the clock it was 11:30pm, and in what
seems like only a few seconds later, your sister runs past you to
catch her 7am school bus.

Bram Moolenaar

unread,
Aug 29, 2014, 9:14:40 AM8/29/14
to elzr, vim...@googlegroups.com, ed...@eddiemonge.com

Ely Parra wrote:

> Thanks rogerz!
>
> Bram, I've changed the header of the indent file on my JSON plugin so
> it now lists me as the current maintainer and rogerz as the original
> author (it had already started diverging from Zhang's version).
>
> With this and rogerz's MIT licensing, I think we're ready. :)

There is an error in the indent file:

function s:IsInString(lnum, col)
return synIDattr(synID(a:lnum, a:col, 1), 'name') == jsonString
endfunction


I assume jsonString should be in quotes.

--
From "know your smileys":
~#:-( I just washed my hair, and I can't do nuthin' with it.
Reply all
Reply to author
Forward
0 new messages