ncjones / editorconfig-eclipse Goto Github PK
View Code? Open in Web Editor NEWEditorConfig plugin for the Eclipse IDE
License: Apache License 2.0
EditorConfig plugin for the Eclipse IDE
License: Apache License 2.0
why to have indent_size=2 less than tab_width=3 ?
https://github.com/ncjones/editorconfig-eclipse/blob/master/.editorconfig
It should be cool if you could provide an editor with syntax coloration validation completion for .editorconfig
Update you Update-Site, please.
https://github.com/editorconfig-eclipse/editorconfig-eclipse.github.io
The version 0.3.0 is missing!
We need this, then we can not use the Eclipse Marketplace!
Executing command 'mvn install' on root directory after initializing and updating submodule does not proceed because the submodule is not yet compiled.
Include in README file that the submodule should be compiled first via (mvn install)
I've installed on Eclipse
Version: 2021-12 (4.22.0)
Build id: 20211202-1639
I can't see any evidence it is working. When I format my Java code (ctrl+shift+f) it picks up the usual Eclipse Code Style Formatter settings and seems to take no notice of the contents of the .editorconfig file in my path.
My editorconfig file is in
/home/roger/meaningful/workspace/datasync-service
My eclipse project root is
/home/roger/meaningful/workspace/datasync-service
and my java file is
/home/roger/meaningful/workspace/datasync-service/src/test/java/io/meaningfultechnology/datasync/control/splitpub/impl/LockControllerImplTest.java
So I believe I have everything in the right place. Eclipse tells me the plugin is installed
What step did I miss?
The Eclipse available in Debian and Ubuntu is version 3.8.1.
Please make this plug-in support Eclipse 3.8.x and later.
Story:
It is enough to put .editorconfig
in the root of the project with
indent_style = value
indent_size = n
then files will look the same in any editor, and selection to use tabs or spaces will be preserved.
Eclipse workspace can have projects that have different configs.
When project does not have .editorconfig
default settings per workspaces are used.
I've installed the plugin.
And now I'm lost: how do I enable it for a project?
Since editorconfig-eclipse have the intention to switch to Eclipse.org #31 perhaps it should be better to use EPL license instead of using Apache 2 license?
@mickaelistria what do you think about that?
Hi,
in the readme I see it supports Text, Java, XML and Ant editors.
Are there plans to support C language files?
br
The editorconfig editor should mark error when you are typing inside the editorconfig editor:
To do that we need an editorconfig parser which is able to collect location offset where errors occur.
I had worked on this issue and pushed my work now. See https://github.com/angelozerr/editorconfig-java-parser
To allow inclusion of the project in vanilla Eclipse IDE, and to take advantage of the community of potential good contributors that are active at Eclipse.org, it would be interesting to consider making this project an Eclipse.org project.
Things to know:
If you're interested, I'd be glad to assist you in making it happen.
When I install the plugin by Eclipse Marketplace (https://marketplace.eclipse.org/node/2506426) the version installed is 0.2.2.201508040438, but don't recognize the last version (0.3.0).
I try update, uninstall and install again, but the only version used is 0.2.2.201508040438.
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.
You should consider adding yout plugin yo Eclipse Marketplace (and link to the marketplace entry in your readme) in order to make it easier for users to try it.
Many modular projects have a single editor config file at their root and this applies to all modules (which are projects in the Eclipse world). When applying editor config preferences, user should be given the choice to:
Today the editorconfig settings update preferences for hard coded for some Editors (JDT, Ant, XML, etc) each time an editor has focus although it could not be a supported editori (JDT preferences is updated if the editor which gains focus is a js file).
In other words, there are several problem:
To fix those 2 problems, we could remove hard coded apply of preferences and delegate it to an extension point like this:
<extension point="org.eclipse.editorconfig.ui.preferencesUpdaters">
<!-- JSDT Java Editor -->
<preferencesUpdater
editorIds="org.eclipse.wst.jsdt.ui.CompilationUnitEditor" >
<property from="indent_style" to="org.eclipse.jdt.core.formatter.tabulation.char" preferenceName="org.eclipse.jdt.core" >
<value from="space" to="space" />
<value from="tab" to="tab" />
</property>
<!-- JSDT Java Editor with indent_size -->
<property from="indent_size" to="org.eclipse.jdt.core.formatter.tabulation.size" preferenceName="org.eclipse.jdt.core" >
<value type="string" />
</property>
</preferencesUpdater>
<!-- Ant Editor -->
<preferencesUpdater
editorIds="org.eclipse.ant.ui.internal.editor.AntEditor" >
<!-- Ant Editor with indent_style -->
<property from="indent_style" to="formatter_tab_char" preferenceName="org.eclipse.ant.ui" >
<value from="space" to="false" type="boolean" />
<value from="tab" to="true" type="boolean" />
</property>
</preferencesUpdater>
</extension>
@ncjones @mickaelistria what do you think about this idea?
I would like just say you that I'm developping a new plugin for editorconfig which works only with GenericEditor https://github.com/angelozerr/ec4e
This plugins apply all properties (trim trailing whitespace, charset encoding, indentation etc) but only for a given instance of editor by using a custom IPreferenceStore instead of modifying the workspace eclipse preferences.
It works only with GenericEditor (JDT Editor, WTP XML Editor doesn't works very good because there are not based on GenericEditor).
https://github.com/angelozerr/ec4e is based on several technologies:
provides an editorconfig editor based on https://github.com/angelozerr/ec4j instead using standard editorconfig-core-java to parse editorconfig editor. This parser is able to manage location for section, option, etc and provides services for any Java IDE (completion, hover, validation, etc)
provides Codelens for section pattern:
@ncjones hope you will understand my choice, I don't want to have trouble with you. It was a pleasure to work with you!
Platform: eclipse neon.3 (4.6.3), windows 10, java 1.8_102
Eclipse fails to install the editor from the marketplace. I get the following error message:
Unable to read repository at https://editorconfig-eclipse.github.io/repository/content.xml.
Transport initialization error.
Unable to update submodule when url in .gitmodule is defined as [email protected]:editorconfig/editorconfig-core-java.git when non github user or non-ssh github user clones the module
On a given .editorconfig file, even without opening an editor, there could be an "Apply Editor Config globally" action that would change the globel preference store.
Hey,
thanks for working on this!
There's also another editorconfig-eclipse plugin being developed; https://github.com/danielgcf/editorconfig-eclipse
Perhaps you guys should collaborate? :-)
Posted also there; danielgcf/editorconfig-eclipse#2
When importing a project, it would be nice to detect the import of a .editorconfig file, and when preferences are not in sync with it, to ask user whether they want those settings to be applied.
Currently, the editorconfig settings are applied globally. Ideally, those should be applied per editor as editorconfig have a much finer scope than the global workspace (they can tweak individual projects or folders).
In order to make this plugin more accessible to those using .editorconfig files in Eclipse IDE, the Marketplace entry should add the fileExtension_editorconfig tag to be discovered when a user tries to open a .editorconfig file.
Please clean-up a bit
https://github.com/search?utf8=%E2%9C%93&q=editorconfig-eclipse
Possibly https://github.com/editorconfig would be even better place
This is not for hurry
If you wish that I do a PR for EditorConfig editor #7 (comment) we should:
If indent_style = tab
and indent_size = 2
(or anything other than 1
) the XML editor behaves incorrectly. The tabs will (correctly) be the width specified by indent_size
but indentation will be done with a number of tabs equal to the indent_size
instead of just a single tab. (The reason 1
works is because it will use only one tab which will be only one unit wide. It looks ugly but technically behaves correctly.)
indent_style = tab
and any indent_size
bigger than 1
I believe the issue is on this line. The problem is due to an oddity of the XML editor. The "indentation size" option is not how many units the indentation is, it is how many of the indentation character (see here) to use. (Why they have it set up like this is beyond me. It seems silly. I can't imagine anyone ever wanting to use multiple tabs to represent a single level of indentation.)
The simplest solution would be something like below.
@Override
public void visitIndentStyle(final ConfigProperty<IndentStyleOption> property) {
// ...
setPreference("org.eclipse.wst.xml.core", "indentationChar", spacesForTabs ? "space" : "tab");
// add this conditional to set size to 1 is using tabs
if (!spacesForTabs) {
setPreference("org.eclipse.wst.xml.core", "indentationSize", "1");
}
// ...
}
@Override
public void visitIndentSize(final ConfigProperty<Integer> property) {
// ...
// add this conditional to only set indent size when using spaces
if (<using spaces>) { // Not sure how to get that property here though...
setPreference("org.eclipse.wst.xml.core", "indentationSize", indentSizeString);
}
// ...
}
The only issue is not having access to the ConfigProperty
for IndentStyleOption
inside visitIndentSize
. An alternative would be to make sure visitIndentStyle
is called after visitIndentSize
so it can override if it is needed, but I don't know how easy that would be with this code base, I haven't looked too far into it.
Currently, the code copies the source of editorconfig-java to build. This is not safe because remote code can change and break the build. It seems better to consume directly the jar of a specific version using Maven.
As mentioned in the Installation Steps, I installed the plugin.
My .editorconfig looks like this:
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
I copied this file in my project root directory.
Then I clicked on Source -> Format.
It changed the indent_style from space to tab; however, as mentioned in editorconfig this Format option should let it be on space style.
Is there any other setting I need to do?
We wish to use editorconfig for a new project in our company. Some of our developers use Eclipse(STS) and some use NetBeans, but issue is this plugin doesn't support trim_trailing_whitespace
and insert_final_newline
, which are a must-have for us(the NetBeans plugin does support them).
Are there any timelines for support of these properties?
Please sign each release, so we can know provenance of future releases, and help protect against malicious updates.
Use-case:
In my case encoding and EOL style did not change. I have checked with IntelliJ IDEA - it does apply mentioned changes.
I'm using
Spring Tool Suite Version: 3.7.3.RELEASE Build Id: 201602250940 Platform: Eclipse Mars.2 (4.5.2)
EditorConfig Eclipse 0.2.2.201508040438 editorconfig-eclipse-feature.feature.group Nathan Jones
See EditorActivationSelectionListener#selectionChanged. This issue is worked around in #10.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.