Community
Participate
Working Groups
Created attachment 249463 [details] example project Given: plug-in project import org.eclipse.ui.console.TextConsole class Test { def static void main(String[] args) { val TextConsole textConsole = null textConsole. } } TextConsole has got a method getDocument, but it isn't offered in content assist and if write it down manually, it is marked as error, as it reportedly doesn't exist. I eventually guessed it could have something to do with the return type IDocument whose containing plug-in org.eclipse.jface.text wasn't yet listed as dependency in the MANIFEST file. When adding this dependency and save the MANIFEST file, the error marker goes away in the package explorer but remains in the still open Xtend editor. Also the CA still doesn't contain the now available type. Only closing and reopening the editor makes the getDocument method reference valid. If I write down the code accordingly in a Java class, an error marker is shown stating "The method getDocument() from the type TextConsole refers to the missing type IDocument". And I also get offered a quickfix for adding the missing dependency to org.eclipse.jface.text. So here Xtend's editor behavior differs noteably from a Eclipse JDT editor.
Should be fixed with 2.7.x I'll test-drive the fix with the attached project.
Observed behavior: Java proposes #getDocument in CA, but when selected, it flags the method with an error that IDocument is not on the classpath. Xtend doesn't propose #getDocument in CA list in the first place. To address that issue, we'd have to enable binding recovery in the JdtBasedTypeFactory. That's unfortunately out of scope for 2.8 since the code currently expects complete bindings and binding recovery will yield incomplete bindings. To risky, but tentatively scheduled for 2.9 to improve user experience.