Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Autocomplete inconsistent with syntactic sugar
Autocomplete inconsistent with syntactic sugar [message #1735729] Wed, 22 June 2016 05:49 Go to next message
Eclipse UserFriend
I tried to get the value of a boolean data with the variable name as isValid.

for(m: resource.allContents.toIterable.filter(typeof(Directory)))
{
val info = new Information()
info.setIsValid(m.isValid) //inconsistent
}


On some part of my code, auto complete displays m.isIsValid, which still works perfectly, but is just a sore to my eyes. I would prefer that it expands similarly. Is there a way to set this in Eclipse?
Re: Autocomplete inconsistent with syntactic sugar [message #1735730 is a reply to message #1735729] Wed, 22 June 2016 06:14 Go to previous messageGo to next message
Eclipse UserFriend
am not sure if i get you

class Information {
	
	def void setIsValid(boolean b) {
		
	}
	
	def boolean getIsValid() {
		true
	}
	
}

class Demo {
	
	def doSth() {
		val i = new Information
		i.isValid = true
		i.isValid == true
	}
	
}
Re: Autocomplete inconsistent with syntactic sugar [message #1735731 is a reply to message #1735730] Wed, 22 June 2016 06:15 Go to previous messageGo to next message
Eclipse UserFriend
same for

	def boolean isIsValid() {
		true
	}
Re: Autocomplete inconsistent with syntactic sugar [message #1735953 is a reply to message #1735731] Thu, 23 June 2016 22:30 Go to previous messageGo to next message
Eclipse UserFriend
I am using autocomplete in Eclipse. My variable name is "isValid" with boolean type. When I type "m.is" and press Ctrl+Space and choose the correct variable, it will sometimes expand to m.isIsValid, which is technically the same as m.isValid. The variable is declared in xcore. And referred to in xtend.

for(m: resource.allContents.toIterable.filter(typeof(Directory)))
{
val info = new Information()
info.setIsValid(m.isValid) //can also be auto-completed as m.isIsValid
info.setIsValid(m.isIsValid) // works completely ok but is different from the previous line.
}

[Updated on: Thu, 23 June 2016 22:30] by Moderator

Re: Autocomplete inconsistent with syntactic sugar [message #1735958 is a reply to message #1735953] Thu, 23 June 2016 23:50 Go to previous message
Eclipse UserFriend
But then you have strange naming inside your Java bean right
Previous Topic:Xtend cannot see methods in Xtext's generated classes
Next Topic:[Xtext] Referring to an enum member
Goto Forum:
  


Current Time: Wed Jul 02 22:59:27 EDT 2025

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

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

Back to the top