-
Notifications
You must be signed in to change notification settings - Fork 52
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
Advanced JSON Editor #253
Comments
Adding @xcoulon to this discussion as he's made some experiment about some json editor for JBoss Tools. |
Thanks @mickaelistria I suppose you mean https://github.com/xcoulon/jbosstools-jsoneditor project . It is based on XText. I'm not sure that WTP Project accept XText? I would like that WTP provide :
with IJSONModel like like WTP CSS & XML projects, I will study if it's easy to do. |
I'm not familiar with the IDOMModel and ICSSModel you mentionned above. What are the benefits of such models ? |
I completely agree it would be great to have a json editor that is extensible like this. |
There are 2 Editors without dependencies:
They are already within @Nodeclipse see |
I don't know very well XText but if I have understood you have an editor wich maintains an EMF instance (in your case aen EMF JSONObject model), When user changes the code in the editor, the EMF insance is updated. Is that? ICSSModel, IDOMModel works like this. So if you change code in the editor, it updated the ICSSModel, IDOMModel. IDOMModel manages a IDOMDocument which is the DOM Document. So you have every time a valid DOM Document in memory even if the editor contains not XML valid. If you change the IDOMDocument (ex : you call with Java code IDOmDocument#createElement, it creates an element in this instance and the editor ir updated.) It's very cool mean to update a XML file by preserving spaces, tabulation, etc
Yes it's my fear. I think we should have a commons and advanced JSON Editor. The best place I think is WTP project. So we need to develop IJsonModel, JFlex grammar etc. It's more hard tasks than XText I think, but if we do that like existing XML and CSS editor, WTP could accept more this editor. More I have seen that WTP will provide bower features (very cool!). Having a JSON Editor inside WTP could help a lot to provide an advanced JSON Editor for bower.json (compeltion, validation, etc).
Yes it's my goal too.
Cool!
Yes I have seen that, but you cannot updated it with some JSON model and they ar enot extension to provide your custom completion, validation, etc That's why I think WTP should provide a JSON Editor. I will study that and create a github project for this WTP JSON Editor |
@angelozerr why JFlex grammar and not something like Antlr ? There's already a grammar for JSON with Antlr v4: https://github.com/antlr/grammars-v4/blob/master/json/JSON.g4 |
We have spent some time on fixing http://marketplace.eclipse.org/content/json-editor-plugin to provide all required support, that is among others, scientific notation, correct validation, outline fixes etc. Validation works only on save, and only in projects with WTP validation builder. Please check it in MyEclipse. If you are interested in getting the source code we can provide it. JSON is freaking simple and making the structure too complex will not work well for you, I think. That editor already has tokenizer and error tolerant parsers. Simple, but working. I think you should be able to reuse it with probably with minor enhancements to support regions. Important thing to do also, is it to decide on the model API. There are various JSON libraries, but you need to locate something like org.w3c.dom library for XML or org.w3c.dom.css for CSS. A standard for accessing JSON objects. Very interesting project :) |
@piotrtomiak if you want to contribute it to WTP we are all for this. @vrubezhny is a committer on JSDT where this would fit very well so we can make this happen if you are interested. |
I though use the JSON model https://json-processing-spec.java.net/nonav/releases/1.0/fcs/javadocs/index.html
I would like to do the same thing than WTP for CSS and DOM (usse JFlex parser). @xcoulon are you interested to help me for https://github.com/angelozerr/eclipse-wtp-json/blob/master/org.eclipse.wst.json.core/Resource/parserTools/highlighting/JSONTokenizer.jflex ? |
@vrubezhny @dgolovin @mickaelistria @maxandersen @pascalleclercq @gamerson @paulvi @fbricon @piotrtomiak, @xcoulon @kaloyan-raev I have started the JSON Editor based on WTP and I can highlight JSON content. This highlight is based on JFlex lexer (like WTP CSS and DOM). The editor is based on WTP org.eclipse.wst.sse.ui.StructuredTextEditor. Today only highlight is avaiable. My goal is to provide extensible editor to manage easily same feature than PhpStorm http://blog.jetbrains.com/phpstorm/2015/01/working-with-composer-json-in-phpstorm/ You can see screenshot and explanation at https://github.com/angelozerr/eclipse-wtp-json IMHO I think everybody could be interested with this JSON Editor kind. Any contribution are welcome! I close this issue since https://github.com/angelozerr/eclipse-wtp-json exists. |
Hey @angelozerr , would you be interested in contributing this editor to WTP? Since it uses the same dependencies, it would be pretty straightforward to include it. |
@mickaelistria it's exaclty my wish. I had a comment about that at https://github.com/angelozerr/eclipse-wtp-json |
@angelozerr So maybe you should try to have it in WTP immediatly, before everyone gets used to your GitHub repo and migration becomes costly. |
To be honnest with you, I don't prefer doing that. I would like to have users feedback, manage my wiki as I wish, create release every time, like I do with tern.java. The packag ename follows the sam ename than css, xml : org.eclipse.wst.json.* |
You'd get more user feedback by including it in WTP directly, and trying to get in into Mars release train, than by having it on a separate project. If it's on GitHub, it appears as yet-another-JSON-editor. If it's in WTP, it becomes the "official" JSON editor of Eclipse IDE. |
Angelo, I just have a couple of boring remarks :
Maybe @waynebeaton can chime in and give you more details on what's reasonable to expect, from a timeframe standpoint. |
@mickaelistria for the moment it's just a POC. I must find time to improve it. So I don't prefer setting this project in WTP Incubation. More I find github tooling (like issues, wiki etc) more user friendly than Eclipse wiki, bugzilla. My idea is to contribute to WTP once JSON Editor will be stable. My idea is to use this JSON Editor inside tern.java too to have an editor for .jshintrc, .eslintrc, .tern-project JSON file. (But the installation of JSON Editor will not be required).
Argh-( I use this namespace for my other projects :
I would like to contribute to Eclipse with those projects. Waiting for just that they become a little more stable. |
|
is fine using org.eclipse if intent is to contribute upstream, but shouldn't be including them in final/public releases. For that you really should step up on wtp-dev and ask for having incubator status or something of that sort. The longer we wait for that the harder everything is going to be. |
@angelozerr Developing this (and any other) plug-in under the Eclipse Foundation will indeed attract more contributions. Some companies, especially big corporations, have complex internal processes for allowing their employees contributing to open source projects. Such process goes much simpler if the project is under Eclipse Foundation compared to those "in the wild". This was the case in my previous company. |
@angelozerr and BTW, the same is valid for the adoption. Those big corporations would be more willing to include an Eclipse.org project in their products than one from the wild. It's another big fat process for adoption of open source projects. |
Ok it seems that everybody wish to host WTP JSON in WTP repository incubation. My fear is that I can create a release when I wish. I don't know how to create release with maven, etc It's @pascalleclercq who does that. This topic interest me, but I have no time and I would like really provide a JSON Editor based on WTP. For the moment, it's just a POC, I don't know if I will able to implement my ideas. If I see that JSON Editor start working, I will create a bugzilla and @mickaelistria I hope you will have time to port the JSON Editor in WTP (Thanks). |
Here a sample of
.tern-project
:I would like to provide a JSON editor for the .tern-project file :
But too :
It exists several JSON Editor :
But there are some limitations :
I tell me it should be very cool to have a JSON Editor based on WTP like CSS or DOM WTP.
This JSON Editor could be extended to support other file like JSHint config file
.jshintrc
@vrubezhny @dgolovin @mickaelistria @maxandersen @pascalleclercq @gamerson @paulvi @fbricon @piotrtomiak What do you think about that?
The text was updated successfully, but these errors were encountered: