Community
Participate
Working Groups
Generic Editor should use indentation folding strategy by default (like VSCode). I have developped a generic folding strategy (VSCode like) inside typescript.java which folds editor content by using indents at https://github.com/angelozerr/typescript.java/blob/master/eclipse/ts.eclipse.ide.ui/src/ts/eclipse/ide/ui/folding/IndentFoldingStrategy.java In my case, I have extended this class for TypeScript at https://github.com/angelozerr/typescript.java/blob/master/eclipse/jsdt/ts.eclipse.ide.jsdt.ui/src/ts/eclipse/ide/jsdt/internal/ui/editor/TypeScriptFoldingStrategy.java to fold content for "import" block. Please note that my folding strategy works well but it should be improved perhaps because it folds the whole content of the editor every time you update a part of editor content. But performance are very good without this optimization. If you are interested, I could do a PR with my IndentFoldingStrategy. Tell me if you are interested and where I could host this class (in which packages).
Hey Angelo! We'd be for sure interested in a patch providing this reconciler directly in the generic editor bundle, and making it used by default when no other one is available.
> Hey Angelo! We'd be for sure interested in a patch providing this reconciler directly in the generic editor bundle Cool! > and making it used by default when no other one is available. You mean bind reconciler with "org.eclipse.core.runtime.text"? In other words declare the reconciler extension point in the genericeditor plugin.xml : ----------------------------- <extension point="org.eclipse.ui.genericeditor.reconcilers"> <reconciler class="org.eclipse.ui.internal.genericeditor.folding.DefaultFoldingReconciler" contentType="org.eclipse.core.runtime.text"> </reconciler> </extension> ----------------------------- If I do that, folding will be done every time. Do you want that? Perhaps in the future we should have a preferences to disable folding for a given content type? It's an another topic, but I tell me if genericeditor should improve reconciler extension point to register a list of IReconcilerStrategy for a given reconciler (one reconciler for a list of IReconcilerStrategy) to avoid having just one Thread to extecute list of IReconcilerStrategy (spelling, folding, etc) and not have one thread (one reconciler per IReconcilerStrategy)
> You mean bind reconciler with "org.eclipse.core.runtime.text"? In other > words declare the reconciler extension point in the genericeditor plugin.xml Right, maybe we should add the after/before pattern that's implemented on hover, and make this one after=* > It's an another topic, but I tell me if genericeditor should improve > reconciler extension point to register a list of IReconcilerStrategy for a > given reconciler (one reconciler for a list of IReconcilerStrategy) to avoid > having just one Thread to extecute list of IReconcilerStrategy (spelling, > folding, etc) and not have one thread (one reconciler per > IReconcilerStrategy) Sure, please open a separate bug for this specific issue.
New Gerrit change created: https://git.eclipse.org/r/102673
> Right, maybe we should add the after/before pattern that's implemented on hover, and make this one after=* Perhaps you could do that yourself after accepting my PR? > Sure, please open a separate bug for this specific issue. Done with https://bugs.eclipse.org/bugs/show_bug.cgi?id=520686
(In reply to Angelo ZERR from comment #5) > Perhaps you could do that yourself after accepting my PR? I believe bug 520659 would be a better heuristic. > https://bugs.eclipse.org/bugs/show_bug.cgi?id=520686 Thanks.
(In reply to Mickael Istria from comment #6) > I believe bug 520659 would be a better heuristic. Sorry, I meant bug 520685. Once we have it, it would make the default indent work for all text, unless another one is associated to a more specific type. I believe it's a great way to enable "default".
@Mickael, @Lucas, please review my new PR at https://git.eclipse.org/r/#/c/102673/ Thanks!
Removing target milestone for all bugs that are not major or above.
> Removing target milestone for all bugs that are not major or above. Of course I meant "major or below". Sorry for the noise!
New Gerrit change created: https://git.eclipse.org/r/126902
@Mickael, @Lucas please review my new gerrit patch https://git.eclipse.org/r/#/c/126902/ which: * defines a new extension point foldingReconciler (like higlightreconciler) * uses the indent folding strategy as default (same behaviour than default word highlight) * add test with indent folding strategy. I tell mee too if we could have too a Toogle button to enable/disable folding. We have that for highlight, so why we cannot do that for folding?
@Mickael, @lucas what do you think about "I tell mee too if we could have too a Toogle button to enable/disable folding. We have that for highlight, so why we cannot do that for folding?"?
New Gerrit change created: https://git.eclipse.org/r/126991
@Mickael, @lucas, once you will merge my work about folding, please review the N&N at https://git.eclipse.org/r/#/c/126991/ Thanks!
(In reply to Angelo ZERR from comment #13) > @Mickael, @lucas what do you think about "I tell mee too if we could have > too a Toogle button to enable/disable folding. We have that for highlight, > so why we cannot do that for folding?"? I don't see a real need to toggle folding. It can just be ignored. Unlike highlighting which is visible in the editor and could distract a user, folding is off to the side and up to the user to use if wanted
> I don't see a real need to toggle folding. It can just be ignored. Unlike highlighting which is visible in the editor and could distract a user, folding is off to the side and up to the user to use if wanted Thanks for your answer @Lucas. I have updated my gerrit patch to remove this information from the description of foldingReconcilers.exsd
Gerrit change https://git.eclipse.org/r/126902 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=fe1f173989deb9f16974d0c78d55f68c04a07462
New Gerrit change created: https://git.eclipse.org/r/127055
Gerrit change https://git.eclipse.org/r/127055 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=7c3eb386577f45d62416dbc3509a2c6ff8082f9d
Gerrit change https://git.eclipse.org/r/126991 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=767cad1f172a10f3fa63c5f65a25e9c5679d2cd7