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

Bug 350823

Summary: [Xbase][ContentAssist] Inferred type not visible in content assist before save
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: amazuzu, cvgaviao, jan, jochen.schmich, sebastian.zarnekow, sven.efftinge
Version: 2.0.0Flags: sven.efftinge: kepler+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: v2.4.3
Bug Depends on:    
Bug Blocks: 409580    

Description Holger Schill CLA 2011-06-30 09:21:59 EDT
If you have a DSL with Xbase integrated and you have a modelinferrer implemented like in the DomainModelExample the contentAssist does not show the inferred types before the resource gets saved. The linking work fine.
Comment 1 Sebastian Zarnekow CLA 2011-08-16 17:35:18 EDT
*** Bug 351027 has been marked as a duplicate of this bug. ***
Comment 2 Sven Efftinge CLA 2011-09-26 08:31:18 EDT
not SR2
Comment 3 Sebastian Zarnekow CLA 2012-04-02 17:01:08 EDT
*** Bug 363799 has been marked as a duplicate of this bug. ***
Comment 4 Sebastian Zarnekow CLA 2012-04-13 12:31:40 EDT
We should address this issue. It's especially important since we now allow multiple classes per Xtend file.
Comment 5 Sebastian Zarnekow CLA 2012-04-13 12:33:56 EDT
The solution with the least impact on the lookup performance would be to use the IDirtyStateManager to explicitly query the dirty resources for JvmTypes.
Comment 6 Sebastian Zarnekow CLA 2012-04-13 12:55:30 EDT
The approach works basically. However, we'd need more user data on JvmTypes to decide about the icon and the filter criteria.

Another issue is the shadowing of types.

Consider the following scenario:

=== saved Xtend file ===
class MyNewType {}

class MySecondType extends MyNewType {}
=== end ===

If I edit this file and add characters to the name of 'MyNewType', let's say 'MyNewFancyType' and use content assist afterwards on the extends clause, I'll still get a proposal for MyNewType since the java class is still available.
After saving the file, the MyNewType class will be deleted and I get an error marker in the Xtend file. Not too nice. I think we'll have to filter the inferred class files from the scope of the currently edited file by means of the available trace information.
Comment 7 Sven Efftinge CLA 2012-05-29 03:27:44 EDT
not Juno
Comment 8 Sven Efftinge CLA 2013-08-21 08:09:32 EDT
The major part of this bug has already fixed, i.e. new types from dirty state get proposed. Also the editor in dirty state won't link against types removed in the editor but still existent on disk.

We don'T want to do the outstanding bit described in comment #6, as the additional complexity and performance overhead is not worth it, given the very rare situation where this could cause an invalid proposal.

I.e. we live with proposals of elements which exist on disk but will be deleted after save.
Comment 9 Eclipse Webmaster CLA 2017-10-31 10:46:38 EDT
Requested via bug 522520.

-M.
Comment 10 Eclipse Webmaster CLA 2017-10-31 10:57:53 EDT
Requested via bug 522520.

-M.