Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351296 - [xtend] Make extension name optional
Summary: [xtend] Make extension name optional
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-06 05:59 EDT by Karsten Thoms CLA
Modified: 2017-09-19 18:13 EDT (History)
3 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2011-07-06 05:59:56 EDT
The name of included extensions in Xtend classes is mandatory, but normally there is no reason to use the extension instance directly in the Xtend code. It would be better if the variable name is optional and inferred internally.

class MyXtendClass {
  @Inject MyExtension  // omit myExtensionName
}
Comment 1 Jan Koehnlein CLA 2011-07-06 06:05:27 EDT
We've had this initially, but it introduces an ambiguity in the grammar, because the parser cannot decide whether it is an optional extension name or an optional return type of a following function.
Comment 2 Jan Koehnlein CLA 2011-07-06 06:06:15 EDT
Oops, forget that last comment, we now have a def keyword.
Comment 3 Sven Efftinge CLA 2011-07-06 07:08:38 EDT
It would be ambiguous whether the following is two or one field:

'''
Foo Bar
'''

If we make it dependent on the existence of the 'extension' keyword it might work.
We'll have to check what kind of effects this has on content assist and error recovery.
Comment 4 Sebastian Zarnekow CLA 2011-08-29 09:37:32 EDT
Pushed to master.
Comment 5 Karsten Thoms CLA 2017-09-19 18:03:00 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 18:13:12 EDT
Closing all bugs that were set to RESOLVED before Neon.0