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

Bug 359367

Summary: [XbaseWithAnnotations] Missing PrefixMatcher exchange for ProposalProvider
Product: [Modeling] TMF Reporter: Holger Schill <Holger.Schill>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 2.1.0Flags: sebastian.zarnekow: indigo+
Target Milestone: SR2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 359377    
Attachments:
Description Flags
Patch none

Description Holger Schill CLA 2011-09-29 04:54:04 EDT
If a language extends XbaseWithAnnotations and the ProposalProvider extends XbaseWithAnnotationsProposalprovider there is a need to exchange the original PrefixMatcher for the method XbaseWithAnnotationsProposalprovider.completeXAnnotationValueFielReference_declaringType in the same way it is done in XbaseProposalProvider.completeXFeatureCall_DeclaringType. Otherwise there are no proposals for fqn-named DeclaredTypes because the delimiter in the DataTypeRule StaticQualifier is '::' and not '.' as in QualifiedName.

A problem is that some of the methods called in completeXFeatureCall_DeclaringType are protected. So there is no access from XbaseWithAnnotationsProposalprovider. Delegating to completeXFeatureCall_DeclaringType from completeXAnnotationValueFielReference_declaringType is a solution but feels like a hack.

Any thoughts?
Comment 1 Sebastian Zarnekow CLA 2011-09-29 04:56:51 EDT
The protected methods should be public.

However, it is more important to change completeXFeatureCall_DeclaringType. It should delegate completely to a method with a better name (e.g. proposeDeclaringTypeForStaticInvocation) and completeXAnnotationValueFielReference_declaringType should delegate to that method, too. Holger, could you take care of this one?
Comment 2 Holger Schill CLA 2011-09-29 05:26:37 EDT
Yes.
Comment 3 Holger Schill CLA 2011-09-29 05:45:18 EDT
Created attachment 204278 [details]
Patch

I don not know if we can change the visibility of the mentioned methods. Therefor I attach a patch to discuss this.
Comment 4 Sebastian Zarnekow CLA 2011-09-29 06:18:25 EDT
Looks good to me at a first glance. Do you get any warnings from the API tooling?
Comment 5 Holger Schill CLA 2011-09-29 06:34:28 EDT
No. No warnings.
Comment 6 Holger Schill CLA 2011-09-29 06:37:08 EDT
pushed to master.
Comment 7 Karsten Thoms CLA 2017-09-19 17:28:28 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 8 Karsten Thoms CLA 2017-09-19 17:39:36 EDT
Closing all bugs that were set to RESOLVED before Neon.0