Giter Site home page Giter Site logo

json-eclipse-plugin's Introduction

Eclipse Json Editor Plugin

epl10 GitHub tag Build Status

screenshot

This plugin adds support for JSON files to eclipse. You can install the latest version directly from this update site:

http://boothen.github.io/Json-Eclipse-Plugin/

You can also get this plugin from the eclipse Marketplace.

A small video demonstration is available on YouTube

Features

  • Supports every eclipse flavor (JavaEE, CDT, RCP, you name it!)
  • Supports eclipse version 3.7 - 2019-12-R and most probably later versions
  • Conforms to the JSON standard as defined in the RFC 4627 by D. Crockford
  • Deep Integration (File wizards, tree outline, preference pages)
  • Quick Outline with reg-ex support (CTRL + O)
  • Highly configurable code formatting (CTRL + SHIFT + F)
  • Custom syntax highlighting
  • Text folding and range highlighters
  • Detects duplicate keys
  • Reliable, resilient and fast syntax tree parsing and validation through ANTLR 4
  • Available for free - that's a feature, isn't it?

Developer Guides

See this getting started page or the release management cheat sheet.

License

This software is licensed in compliance with the eclipse Foundation under the eclipse Public License 1.0.

SourceForge

This plugin was formerly hosted at https://sourceforge.net/projects/eclipsejsonedit/

json-eclipse-plugin's People

Contributors

boothen avatar gossi avatar msteiger avatar pulse00 avatar sorontur avatar tolland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

json-eclipse-plugin's Issues

Comment support

Hi,

i know that json is not intended to support comments, but parser like jackson do support this.
sometimes it is really very handy to have some comments in json-files.

is there any chance of getting comment-support (there is already color-support for comments ;-) for the plugin?

thanks in advance

Screenshot 2021-04-15 at 12 47 54

Folding feature is not there for the plugin

For complex JSON objects, JSON folding is necessary. It is very difficult to read JSON without folding. please add this feature to the plugin. I'm attaching an image for best folding example. collapse all is must for the folding
json auto folding for complex objects

Issues with Neon.1

What I noticed after a quick test on Linux (Ubuntu 16.4):

  1. No syntax highlighting on existing json files.
  2. Deletes existing line when writing a closing curled bracket.

Use smart auto-edit feature for bracket placement

Auto bracket creation doesn't take into context the number of brackets already in the document and will create a new one even if there are already an even number.

An IAutoEditStrategy registered in JsonSourceViewerConfiguration.getAutoEditStrategies() could provide the context to correctly adjust the whitespace.

Support for multi line string values

It would be nice for the validation and autoformat function to accept multi line strings as valid/already formatted (or to allow this via some flags in config etc)

For example:

{"text":"this is some text"}

gets correctly formatted to

{
	"text":"this is some text"
}

but

{
	"text":"this is 
	some text"
}

gets transformed to

{
	"text":sometext
}

Sync outline with editor

It would be nice if when you click a "node" in the Outline panel, the editor would move to it.
I have large JSON file as configuration files for some of our applications (several thousands of line) this feature would come in handy.

Completely not working on Eclipse Oxygen?

I may just be using it wrong, but when I install it it does not give me the option to use a "Json editor" for my .json files...

Sorry I'm not including very many details. This is truly why I am stumped too. It is not erroring (afaik, I am unsure how to check).

~ Installed via Eclipse Marketplace ~

Extra features/options for the formater

I'd like this features for the formatter (maybe others will too):

  • don't indent/explode nested objects and arrays if they contain only one level
    For something like:
    {"a":1,"b":{"x":2,"y":3},"c":[4,5,6]}
    instead of getting
{
	"a": 1,
	"b": {
		"x": 2,
		"y": 3
	},
	"c": [
		4,
		5,
		6
	]
}

get something like:

{
	"a": 1,
	"b": { "x": 2, "y": 3 },
	"c": [ 4, 5, 6 ]
}
  • don't indent more than n'th level
    Es. {"a":{"b":{"x":2,"y":3,"c":[4,5,6]}}} , for n = 2 would give:
{
	"a": {
		"b": { "x": 2, "y": 3, "c": [ 4, 5, 6]}
	}
}

Random Block Selection

While typing, the plugin randomly selects a block of json and overwrites the block. This renders the plugin unusable.

My environment is:
Ubuntu 14.04
Eclipse Luna

Seems to be related to the outline, if I close the outline the selection stops.

[Feature Request] Support for json5

A sub-set of json, json5 is a more relaxed version, aimed to be easier to use by humans.

It would be awesome if this plugin could provide support for this as well; and i think ANTLR4 supports the grammer.

Feature Request: JSON data as Table

Dear Developer,

Thank You for the wonderful plugin.

Kindly add the feature to view the JSON data as a Table in Eclipse Editor.

Thanks and Regards,
Sathish.

Couldn't get it to work with Eclipse PDT

Looks like a great editor add-on for Eclipse but it just would register as an editor after installation with PDT. Zend Eclipse PDT is a packaged version of Eclipse 3.8 so should work?

Tried installing via marketplace and direct from http://boothen.github.io/Json-Eclipse-Plugin/. Both times it looked like the install finished but json files stay as text in the project explorer editor and there's no mention of the JSON Editor anywhere in preferences or the list of internal editors for files.

[Feature Request] Context aware settings?

o/ I know this project is like basically dead or just on life support,
but if you want to improve it here would be a nice suggestion.

Context aware settings where you can set formatter rules based on the current context.
To define the context I mean what JsonElementType you are right now in.
Optionally also what the previous context you are in.

I know you can set formatter options right now but these usually lead to pretty bad json writing experience.
What I wish that I could do is set rules when a element should be newly lined and when not.
To give you a example of how I like my json to look like is this:
image
https://github.com/Speiger/PrettyGsonWriter

I know that this isn't easily achievable and is a huge ask, so please don't take it as a "MUST HAVE".
If I had experience in Eclipse Plugin writing I maybe would do it on my own, but right now I rather give input on existing established plugins.

Anyhow thank you for reading my Request even if it stays unfulfilled. :)

P.s: Yes the image is intentionally taken that way.

The icons for jsonedit-outline are barely visible on a dark theme

The icons for the JSON data type (Array, Boolean, etc) in the Outline view are dark blue, so they are very hard to see when using a Dark Theme (as shown in the screenshot below).

Ideally there would be two set of icons the user can choose from (those for the dark theme would be white) or the data type symbols would be plain text with an user selectable color in the preferences window.

eclipse

Verify integrity of image registration

This applies to version 0.9.8 and might be fixed already (migrated issue from sourceforge).

The image for each node is acquired and then leaked. Using the outline view with the Json editor will result in SWT running out of handles eventually. The JsonTreeNode's getImage method is where the problem occurs.

The real problem is that the map of types-to-image should really be using an org.eclipse.jface.resource.ImageRegistry and put the ImageDescriptor followed by getting the image from that.

ImageRegistry registry = new ImageRegistry();
registry.put(JsonArrayNode.class.getName(), 
    ImageDescriptor.createFromURL(JsonNode.getResource("/icons/JsonArray.gif")))
}

public Image getImage() {
    return registry.get(jsonNode.getClass().getName());
}

Blocks JSON Schema Validation in Eclipse v4.11 (release 2019-03)

During testing of the latest release of Eclipse, v4.11 (release 2019-03)
It appears that when this plugin is installed - JSON Schema Validation (i.e. after registering the file pattern and schema URL via Window > Preferences > JSON > JSON Catalog) no longer works.

I repeated this test several times, by uninstalling the plugin - confirming that Schema Validation worked - and then re-installing the plugin and confirming that Schema Validation no longer worked.

I did not see any errors being logged to the Eclipse log file.

Tested with Java JDK 12, on a Windows 10 laptop

issue with mac

I am getting following error:

An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: binary,epp.package.jee.executable.cocoa.macosx.x86_64,4.5.1.20150917-1200
No repository found containing: binary,org.eclipse.platform.ide.executable.cocoa.macosx.x86_64,4.5.1.M20150904-0015

how to install it on eclipse mars on mac?

Thanks,
Amit

Support default colors for dark theme

The default font colors are suitable for light theme but there seems to be no defaults for dark theme. When installing the plugin fresh from marketplace to a dark theme eclipse (4.11) it looks very bad:

image

I would suggest to provide either a dedicated defaults button in preferences or to provide a css file for dark theme support (e4 style).

Here my suggestions for a good looking defaults:

image

image

REQUEST: Instructions for offline installation

At work, they have implemented a firewall rule against github.io, so I am unable to obtain updates nor able to get a new instance for a new computer because of it. But I don't have such a limit at home, plus can clone from github.com.

So how can I install the plugin from either local repository or create a zip file archive to install from?

(Want to learn more about Eclipse plugins and offline installation)

Installed, but won't do anything

Hello, I've installed the plugin on Eclipse for Java Developers (Photon) from the Eclipse Marketplace.
Then I've restarted Eclipse, but now my json files are still being opened with the Text Editor, and I can't find any JSON Editor anywhere by looking through the settings, thus I assume it wasn't installed correctly or something, yet the Marketplace lists it as installed. I don't understand what I did wrong. Is it compatible with Photon?

JSON Editor Plugin cannot be installed to Eclipse 2018-12 (4-10.0)

Using Eclipse 2018-12 (4.10.0) I am no longer able to install the plugin by eclipse marketplace.

The reason is the missing entry of supported eclipse version (4.10 is missing, 4.9 and 4.11 are listed) - see next picture from https://marketplace.eclipse.org/content/json-editor-plugin?mpc=true&mpc_state=#group-details

Could you please enable the checkbox entry for 4.10 in marketplace listing? I missing the plugin on my new eclipse installation...

Best wishes
Albert

image

JSON Editor plug-in renders JSON files unreadable

This is an issue that affects many Eclipse plug-ins, it has gotten worse with the years and become especially acute with Photon (affects about 90% of the plug-ins I use). Eclipse advertises plug-ins from the Marketplace whenever the user opens a particular file type, say JSON, HTML, PHP, SQL, etc. However, when these plug-ins are installed those files become unreadable. I reported this issue against the Workbench itself, but folks there insist that this issue must be reported to the plug-in developers.

This JSON plug-in is one of the many plug-ins affected. Here is a screenshot of a JSON file right after installing the plug-in:

I have a hard time believing so many developers purposely ship plug-ins that do not function out-of-the- box. I am therefore reporting this issue here to understand what is the sentiment this side of the development stack.

Thank you.

Formatter settings: possible to make use of space conditional ?

The formatter settings don't seem to allow a conditional use of space, e.g. to make a space show up after a colon for a key only if the corresponding value is neither an array nor an object.

For example, I would like to be able to configure the formatter to produce this layout

{
  "key1":
  {
    "key2": "value2"
  }
}

Note how there is a space between the colon following "key2" and before "value" but not after the colon following "key1" and the inner object. The newlines before and after the braces are intentional, so the formatter is configured accordingly as well - I also could not find an option for those to provide the "conditional space" behavior.

If I understand the possible settings correctly, they only allow for either a space after both colons or none at all. Is there a way to achieve this ? If not, please consider this as a request :-)

Add Package export to com.boothen.jsonedit.editor

Hi,

I like to use your editor in a RCP project. Therefore i need to wrap it in my world. Currently that is not possible because the package where the JsonTextEditor class is located is not exported. Could you add such an export? That would be very great.

Kind Regards,
Patrick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.