Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:27 Go to next message
Mark Christiaens is currently offline Mark ChristiaensFriend
Messages: 63
Registered: October 2010
Member
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 08:28]

Report message to a moderator

Re: Strange selection in editor when selecting something in outline [message #668567 is a reply to message #668555] Fri, 06 May 2011 09:08 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
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 Apr 27 04:11:07 GMT 2024

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

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

Back to the top