Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCaseInsensitiv Scoping - how to do it?
https://www.eclipse.org/forums/index.php/mv/msg/1102632/1822110/#msg_1822110
How building a case insenstive language (we need it, our backend is PL/SQL) ist done is clear to me so far, I use as documentetd this in the workflow
scopeProvider = {
ignoreCase = true // Case Insensitive
}
So how do I tell the Scopes to be case insensitiv?
Thanks, Max
]]>Max Weißböck2020-02-27T12:46:59-00:00Re: CaseInsensitiv Scoping - how to do it?
https://www.eclipse.org/forums/index.php/mv/msg/1102632/1822115/#msg_1822115
org.eclipse.xtext.scoping.Scopes.scopeFor(Iterable<? extends EObject>)
and create your own ones with
calling
public SimpleScope(IScope parent, Iterable<IEObjectDescription> descriptions, boolean ignoreCase) {
with true for ignorecase
is you neither find the SimpleScope class not the Scopes class
i assume there is something wrong with your classapth or imports]]>Christian Dietrich2020-02-27T14:07:16-00:00Re: CaseInsensitiv Scoping - how to do it?
https://www.eclipse.org/forums/index.php/mv/msg/1102632/1822130/#msg_1822130
As it was a little tricky for me (and others had problems with this to) here is the pragmatic way I resolved it
- make a copy of Class org.eclipse.xtext.scoping.Scopes and name it <yourpackage>.scoping.IgnoreCaseScopes
- inside yor copied Class replace every occurence of new SimpleScope(...) with new SimpleScope(..., true)
- in your code replace every occurence of Scopes.scopeFor with IgnoreCaseScopes.scopeFor
I'm shure this is not the most elegant way to do it, but it (mostly) worked for me. I still have one problem, see next post.]]>Max Weißböck2020-02-27T16:47:52-00:00Re: CaseInsensitiv Scoping - how to do it?
https://www.eclipse.org/forums/index.php/mv/msg/1102632/1822285/#msg_1822285
I now can write (we have a PL/SQL based DSL)
var i number
I := 5
So far so good. But I still can write
var i number
var I number
I := 5
I should get an error now, as i or I is declared twice now.
What do I miss, what did I wrong?
]]>Max Weißböck2020-03-03T08:51:28-00:00Re: CaseInsensitiv Scoping - how to do it?
https://www.eclipse.org/forums/index.php/mv/msg/1102632/1822293/#msg_1822293
Christian Dietrich2020-03-03T10:29:01-00:00Re: CaseInsensitiv Scoping - how to do it?
https://www.eclipse.org/forums/index.php/mv/msg/1102632/1822307/#msg_1822307
Now I understand why in the Xtext doc regarding case insensitivity you are talking from broken shift key :-) ... support in Xtext for this is not out of the box.
I'm no fan of case insensitivity either, but as we have to generate PL/SQL it is a must for the DSL.]]>Max Weißböck2020-03-03T17:00:41-00:00