Git Product home page Git Product logo

editorconfig-eclipse's People

Contributors

angelozerr avatar hyness avatar johanhammar avatar ncjones 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  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

editorconfig-eclipse's Issues

Editor for .editorconfig

It should be cool if you could provide an editor with syntax coloration validation completion for .editorconfig

Add the complete installation step in README

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)

not working on eclipse 2021-12 (4.22.0)?

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?

Support Eclipse 3.8

The Eclipse available in Debian and Ubuntu is version 3.8.1.

Please make this plug-in support Eclipse 3.8.x and later.

User Story 1: tabs and spaces config per project

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.

Switch to EPL license?

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?

As you type validation inside editorconfig editor

The editorconfig editor should mark error when you are typing inside the editorconfig editor:

  • syntax error like section which are not closed.
  • semantic error like 'XXX' option name doesn't exists, or 'indenre t_style = 10' is false because indent_style waits for space or tab

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

Move project to Eclipse.org

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:

  • The project could remain hosted at GitHub (under eclipse/editorconfig-eclipse), or moved to [email protected]
  • It would remain in incubation phase to allow more API and architectural changes
  • It would be free to do builds and releases whenever it's useful, no need to follow the usual release train.

If you're interested, I'd be glad to assist you in making it happen.

Add to Eclipse Marketplace

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.

Ability to apply config to a project hierarchy

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:

  • apply them on the whole workspace, or
  • apply them on the project hierarchy (when children do not feature their own editorconfig)
  • apply them only to current module

Extension Point to apply preferences for any editor

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:

  • JDT, Ant, XML, etc global preferences are updated each time any editor gains focus (this problem will be fixed by #30)
  • it's not possible to support a custom editor.

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>
  • editorIds is used to know which "preferencesUpdater" must be applied (convert editorconfig preference to the editor preferences)
  • property/value from/to are used to know how to convert editorconfig property to the editor peferences property.

@ncjones @mickaelistria what do you think about this idea?

ec4e - similar project (only for Generic Editor)

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:

  • apply the all properties of editorconfig with GenericEditor
  • provides an editorconfig editor based on GenericEditor, tm4e for syntax coloration

  • 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:

editorconfigcodelensdemo

@ncjones hope you will understand my choice, I don't want to have trouble with you. It was a pleasure to work with you!

Installing editorconfig plugin from eclipse marketplace doesn't work

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.

Suggest to apply config at import

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.

Split plugins to Core/UI

If you wish that I do a PR for EditorConfig editor #7 (comment) we should:

  • split plugin into 2 plugins core+ui
  • rename plugin with com.ncjones.editorconfig.core and com.ncjones.editorconfig.ui

XML Editor behaves incorrectly when using tabs and indent_size other than 1

Problem

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.)

Steps to reproduce

  1. Have this plugin installed (of course)
  2. Use indent_style = tab and any indent_size bigger than 1
  3. Format any XML file

Notes

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.

EditorConfig Eclipse not working on Windows

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?

Support for more properties?

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?

editorconfig-eclipse does not apply new encoding and line-ending style

Use-case:

  1. Choose some file in your project
  2. Set .editorconfig to following
    • indent_style = tab
    • indent_size = 4
    • end_of_line = crlf
    • charset = latin1
  3. Reformat some file, check if encoding and EOL style have changed
  4. Set .editorconfig to following
    • indent_style = space
    • indent_size = 4
    • end_of_line = lf
    • charset = utf-8
  5. Reformat the file again. Check if encoding and EOL style have changed

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

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.