Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320506

Summary: quick fix to create not-yet-existing rules when working on grammar
Product: [Modeling] TMF Reporter: Dietmar Stoll <btickets>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: clay, Holger.Schill, sebastian.zarnekow, sven.efftinge
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: M2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
proposed patch with tests
none
proposed patch with tests
none
proposed patch with tests none

Description Dietmar Stoll CLA 2010-07-21 09:30:31 EDT
Build Identifier: 

If there is a non-existing rule while writing a new Xtext grammar, a quick fix which creates this rule would be nice for lazy people :)
Example: The developer writes a new rule, e.g. 'Type' like so

Type:
	Basetype|Entity;

Assuming that the rule 'Basetype' doesn't yet exist, an error is shown. A quick fix could now create a new rule 'Basetype', with colon and semicolon and placing the cursor after the colon.

Reproducible: Always
Comment 1 Michael Clay CLA 2010-08-15 15:42:24 EDT
Created attachment 176640 [details]
proposed patch with tests
Comment 2 Michael Clay CLA 2010-08-15 15:48:15 EDT
Created attachment 176641 [details]
proposed patch with tests

fixed wrong package name to o.e.xtext.xtext.ui
Comment 3 Sebastian Zarnekow CLA 2010-08-15 15:56:31 EDT
Michael, thanks for the patch.

Could you please remove the quick-fix for the fully qualified grammar name? I don't like the implementation of the validation rule and would rather reimplement that one based on the actual package fragments. A fix would thereby imply a package-rename which seems to be out of scope.
Comment 4 Michael Clay CLA 2010-08-15 16:08:25 EDT
Created attachment 176642 [details]
proposed patch with tests

removed quick-fix for the fully qualified grammar name
Comment 5 Sebastian Zarnekow CLA 2010-08-25 14:18:14 EDT
Scheduled for M2 to make sure the patch gets some attention.
Comment 6 Sven Efftinge CLA 2010-09-03 15:20:04 EDT
Very nice! :-)

Only two things:

1) Please move the XtextGrammarLinkingDiagnosticMessageProvider to the runtime  bundle "org.eclipse.xtext.xtext.XtextLinkingDiagnosticMessageProvider".

2) The enum fix seems to be meant to fix the empty literal by setting the id's name as keyword. However, when testing the keyword is just removed (Which is also ok, but the code looks different).
Comment 7 Michael Clay CLA 2010-09-09 15:57:42 EDT
fixed in HEAD
Comment 8 Karsten Thoms CLA 2017-09-19 16:14:55 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.