Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Orion | folding scopes

Hi Ammar,

I don't think there's a workaround, other than to implement the functionality.  This would basically involve listening on the text model for "Changed" events, computing the updated set of scope bounds (character start/end indexes) and updating the set of annotations on the annotation model.

Computing the updated set of bounds is the most involved step, and most prone to affecting editor performance.  To see how Orion's styler computes the matching bracket for a selected bracket see http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.editor/web/orion/editor/textStyler.js?id=R7_0#n1049 .

For an example of Orion's styler computing the set of annotations see http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.editor/web/orion/editor/textStyler.js?id=R7_0#n955 (blocks represent regions of text and can contain sub-blocks).

Grant




From:        Ammar Ahmad <ammarahmad.122@xxxxxxxxx>
To:        orion-dev@xxxxxxxxxxx
Date:        12/11/2014 10:39 AM
Subject:        [orion-dev] Orion | folding scopes
Sent by:        orion-dev-bounces@xxxxxxxxxxx




Hi Grant/All,

Thanks for a quick reply on this. 

We needed a small bit of help on this folding of scopes (expand collapse) for the JSON files. Is there a workaround to get this thing working for the time being until we have the feature inbuilt in Orion.

Your help would be highly appreciated, we need this feature very much.

Regards,
Ammar



Date: Wed, 10 Dec 2014 11:02:26 -0500
From: Grant Gayed <
Grant_Gayed@xxxxxxxxxx>
To: Orion developer discussions <
orion-dev@xxxxxxxxxxx>
Subject: Re: [orion-dev] Orion | Expand Collapse/Folding ruler for
        JSON code
Message-ID:
        <
OF78E1AD4F.1BEFF74D-ON85257DAA.00574B55-85257DAA.00581CDA@xxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"


Hi Ammar,


You're not seeing folding for comments because comments are not valid JSON
[1].  If you were in a .js file then you would see folding annotations for
them.


Folding of scopes ("{" & "}") is not currently implemented.  There's an
existing feature request in this area [2], though if you want you can log
a specific request for this [3].


Grant


[1] 
http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
[2] 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=365769
[3]

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&bug_severity=enhancement
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/orion-dev

Back to the top