Community
Participate
Working Groups
Such extension point will provide array of IAutoEditStrategy for ExtensionBasedTextViewerConfiguration.getAutoEditStrategies. This will also help LSP4E to provide advanced editor operations. Current default implementation only adds indentation in new line.
Maybe it would be nice to support something similar to https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributeslanguages (language-configuration.json)
New Gerrit change created: https://git.eclipse.org/r/87308
Actually, I'm not sure whether this actually belong to: * the editor (as suggested) * the document (as documentListener) so it can apply on any keystroke * the DocumentBuffer/Resource so it can apply on save. The more I work with the generic editor, the more I have the impression that a document listener can be a better fit. However, there are can easily issue if you change a document as part of the documentListener (for example if you have multiple edits pending and introduce a new one before them).
@Michal: what's your opinion regarding my last comment? What do you think about relying on Document Listener for those?
(In reply to Mickael Istria from comment #4) > @Michal: what's your opinion regarding my last comment? What do you think > about relying on Document Listener for those? I'm not sure how it will look without any initial implementation. You want to reuse somehow IAutoEditStrategy or just have new interface. I'm also not sure what's the problem with current mechanism. Are there any major disadvanteges?
(In reply to Michal Niewrzal from comment #5) > I'm not sure how it will look without any initial implementation. Actually, there would be no initial implementation. It would just be a recommendation for poeple who want auto-edit to use the documentSetup extension point and add a listener/an IAutoEditorStrategy on the document directly. > You want to reuse somehow IAutoEditStrategy or just have new interface. Reuse, reuse, reuse! No new public APIs for Generic editor! > I'm also not > sure what's the problem with current mechanism. Are there any major > disadvanteges? The only disadvantage I see is that it's more code for a feature that *might* already be possible to provide without new code. [2 seconds later] So I did look at the code and it's not possible to plug an IAutoEditStrategy directly on an IDocument (too bad), so your proposal may be the best way to do things. I'll have a closer look very soon (ping me otherwise).
(In reply to Mickael Istria from comment #6) > So I did look at the code and it's not possible to plug an IAutoEditStrategy > directly on an IDocument (too bad), so your proposal may be the best way to > do things. I'll have a closer look very soon (ping me otherwise). Take your time. I have no pressure with this but I just miss default auto edit strategy (indentation, brackets closing) in generic editor :)
Gerrit change https://git.eclipse.org/r/87308 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=a960a556bb97303083f87165350bdc44c55d701e
Thanks a lot for this great contribution Michal. Before closing this bug we need to: * add an entry in Platform's N&N * add this extension point to the automated documentation, and a note about it in the "human" documentation * add the extension from the example to the PDE template for Generic Editor. Unless you prefer otherwise, I suggest we keep this bug open to track those tasks,
(In reply to Mickael Istria from comment #9) > Thanks a lot for this great contribution Michal. Mickael, you are on the project for some time now. I would expect that you have read https://wiki.eclipse.org/Version_Numbering. Maybe you have read it and you have forgotten the details again. So, please do again. What's worse is that you do not seem to have set up your 4.8 workspace correctly as expected by a committer. To set up API Tools is a requirement for active committers. You seem to have failed on that, because it would have told you that the version is wrong. Please improve on this. I have better use to spend my time than cleaning up such issues. I've fixed the version number with http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=422ac20e0c3cc4109fac9eb0fa60d4f387ba4227
(In reply to Dani Megert from comment #10) Sorry, the version change was justified because a new extension point was added. This is not handled by PDE Tools and version guidelines. Nevertheless code was committed that resulted in an error in the IDE, which should not happen by an experienced committer. A problem filter should have been added. I've fixed the wiki, the version and the problem filter. The API Tools issue is bug 518988.
New Gerrit change created: https://git.eclipse.org/r/100435
New Gerrit change created: https://git.eclipse.org/r/100547
Gerrit change https://git.eclipse.org/r/100431 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=869cdd5e0f643c80c95fe040d40e6ec2c271252c
Gerrit change https://git.eclipse.org/r/100435 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.common.git/commit/?id=f076b44dc524b2a88c330bc0512b1f4d9f656e64
Gerrit change https://git.eclipse.org/r/100547 was merged to [master]. Commit: http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=65bba5761b93b0a3a7d5b7d13f591fe006e280d9
Feature and related patches merged. Thanks a lot for this good contribution Michal!