editorconfig-eclipse icon indicating copy to clipboard operation
editorconfig-eclipse copied to clipboard

Check with JSDT

Open mickaelistria opened this issue 9 years ago • 11 comments

JSDT has a feature request on the topic of supporting .editorconfig: https://bugs.eclipse.org/bugs/show_bug.cgi?id=463071 . You should add some comments there explaining how your plugin currently work with JSDT, and what could halp to have both projects interacting well.

mickaelistria avatar Jul 17 '15 07:07 mickaelistria

I think the better mean to support any editor is to provide an extension point to apply format instead of hard coding preferences to update for each editors

angelozerr avatar Jul 17 '15 07:07 angelozerr

I agree with the extension point approach.

ncjones avatar Jul 18 '15 09:07 ncjones

As mentioned in #9, not all editorconfig settings have been implemented yet and I don't know what an editorconfig extensionpoint should look like. I think it is acceptible to add support for popular editors such as Javascript directly to this plugin as a short-term solution. For the indentation support we just need to know the names of the settings that JSDT uses for indendation style and size.

ncjones avatar Jul 18 '15 13:07 ncjones

I've looked at several projects using .editorconfig, and it really seems like the goal and common usage of of editorconfig is to attach the setting to the project.I do not think that we need to have a registry and an extension point to share those editor configs as Eclipse plugin.

mickaelistria avatar Nov 16 '15 13:11 mickaelistria

common usage of of editorconfig is to attach the setting to the project.

@mickaelistria if you read section "Where are these files stored?" from http://editorconfig.org/, the preferences is not linked to a project but to a file. I'm afraid that it's not possible today with Eclipse, since preferences belongs to a Workspace or Project.

In case of .editorconfig, the preferences of the editor, belongs to the location of the IFile and not from the IProject preferences.

angelozerr avatar Nov 16 '15 13:11 angelozerr

Indeed, the editorconfig rules can apply to a single file, and this is not really Eclipse can support currently. Let's just be clear about that: the Eclipse IDE cannot in short-term support fully editorconfig. But let's focus on what's possible right now. Each project has one or multiple editorconfig files. In most cases, those rules are defined by extension, and many times, it's always the same indent, the same tab/space setting for all rules in the file. So those can be used for project-wide or workspace-wide settings without too much risk. See also my suggestion on comment #23 for ideas of usage.

mickaelistria avatar Nov 16 '15 14:11 mickaelistria

@angelozerr I've commented on your Eclipse JSDT issue report.

I don't see anything happening anytime soon with Eclipse to support genuine editorconfig support so I think we should add JS support directly into this plugin. I will close this and open a separate issue for adding JS support if you don't mind.

ncjones avatar Nov 17 '15 12:11 ncjones

@ncjones Have you considered contributing your plugin to Eclipse?

mickaelistria avatar Nov 17 '15 12:11 mickaelistria

This plugin is a hack that attempts to work around the fact that Eclipse's editor plugin architecture is fundamentally incompatible with editorconfig so I don't expect this to ever be contributed to Eclipse as it currently stands. If I, or someone else (hint), implement #7 then we will have a better idea about what it might take to get this done properly.

ncjones avatar Nov 17 '15 12:11 ncjones

Contributing to Eclipse doesn't imply have it shipped and enabled by default in the IDE. But it means that other Eclipse projects can safely rely on it, and then be able to provide specific extensions.

mickaelistria avatar Nov 17 '15 12:11 mickaelistria

Ok, then yes. I think that should be a goal.

ncjones avatar Nov 17 '15 13:11 ncjones