Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Strange selection in editor when selecting something in outline
Strange selection in editor when selecting something in outline [message #668555] Fri, 06 May 2011 04:27 Go to next message
Eclipse UserFriend
I just noticed something strange. When I open the outline, couple the outline with the text editor (with the double arrow icon) and then select an item from the outline tree, the corresponding selection in the editor is sometimes unexpected. For example when in VHDL I have the following line:
clk     : in std_logic; 

The corresponding (somewhat simplified) grammar rule is:
PortElement:
	names+=PortName (',' names+=PortName)* ':' (mode=PortElementMode)?
	subtype=SubtypeIndication;

I would expect that if I click on the "clk" item in the outline, the "clk" (which is the string that corresponds to that item in the editor) is selected. Instead, only the ":" keyword is selected? Often the selection is what I expect it to be but not always. Is this intentional or should I file a bug?
---
Mark Christiaens
Discover the Future of VHDL Design
Go to www.sigasi.com

[Updated on: Fri, 06 May 2011 04:28] by Moderator

Re: Strange selection in editor when selecting something in outline [message #668567 is a reply to message #668555] Fri, 06 May 2011 05:08 Go to previous message
Eclipse UserFriend
Hi Mark,

this is intentional. The default implementation of the
ILocationInFileProvider tries to find the name of the element. If it has
no name (like your PortElement), the first keyword is selected that
belongs to the production rule that created the element. You'll have to
customize the location in your own ILocationInFileProvider.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 06.05.11 10:27, schrieb Mark Christiaens:
> I just noticed something strange. When I open the outline, couple the
> outline with the text editor (with the double arrow icon) and then
> select an item from the outline tree, the corresponding selection in the
> editor is sometimes unexpected. For example when in VHDL I have the
> following line:
> clk : in std_logic; The corresponding (somewhat simplified) grammar rule
> is:
> PortElement:
> names+=PortName (',' names+=PortName)* ':' (mode=PortElementMode)?
> subtype=SubtypeIndication;
> I would expect that if I click on the "clk" item in the outline, the
> "clk" (which is the string that corresponds to that item in the editor)
> is selected. Instead, only the ":" keyword is selected? Often the
> selection is what I expect it to be but not always. Is this intentional
> or should I file a bug?
> ---
> Mark Christiaens
> Discover the Future of VHDL Design
> Go to http://www.sigasi.com
>
Previous Topic:[MWE2] Help executing mwe2 workflows from java
Next Topic:XtextEditor based on a string
Goto Forum:
  


Current Time: Sat Jul 05 01:38:14 EDT 2025

Powered by FUDForum. Page generated in 0.02767 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top