Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [hibachi-dev] SourceRange for an AdaVariable

Adam Haselhuhn wrote:
If I understand correctly, the situation you're mentioning only occurs when there are multiple variables declared with a single type, as in O1 and O2 in your example below.

Yes, that is correct.

IAdaVariable object refers to the name and type, so the range must include both. We could have the range for the O2 variable be "O2 : out Integer", but I don't like the idea splitting up a declaration like that.

This certainly makes a lot of sense and answers my question (it is not a bug but a conscious design decision). But while it makes sense it still causes me issues - which is my problem, not yours. I guess I was hoping that this might be a part of Hibachi that was more flexible or had not been fully flushed out.

What I am trying to do is map text selections and IAdaElements. For example, if a user selects something in the tree in the outline view, how do I figure out what that selection looks like in the text editor. What I ran into was that the source range was bigger than expected.

For example:
procedure P1 (I : in Integer; O1, O2 : out Integer)

Using the current logic results in the following mapping.
IAdaVariable | Text
-----------------------------------
I            | I : in Integer
O1           | O1, O2 : out Integer
O2           | O1, O2 : out Integer

What I was hoping to have is the following:
IAdaVariable | Text
-----------------------------------
I            | I
O1           | O1
O2           | O2


With that in mind I will have to work around this by digging deeper into the source range before showing the results to the user.

Thanks for letting me know,
todd


Back to the top