eclipse / xtext

Eclipse Xtext™ is a language development framework
http://www.eclipse.org/Xtext
Eclipse Public License 2.0
752 stars 317 forks source link

Xtext Warning on import "http://www.eclipse.org/xtext/xbase/Xbase" #2413

Open miklossy opened 5 years ago

miklossy commented 5 years ago

Importing the Xtext Homeautomation Example into Eclipse Photon/2018-09 and opening the RuleEngine.xtext file leads to the following warning:

screenshot

cdietrich commented 5 years ago

i cannot reproduce this on Mac OS X

cdietrich commented 5 years ago

Neither on Windows

miklossy commented 5 years ago

I have just updated to the latest Xtext nightly build and the warnings are gone. I cannot reproduce that problem any more.

@cdietrich I suggest to close this ticket with cannotreproduce / worskforme.

miklossy commented 5 years ago

Sometimes I still get this warning, but cannot say how to reproduce. See also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=482007

cdietrich commented 4 years ago

still wonder how to reproduce this

miklossy commented 4 years ago

I can reproduce the problem when starting Eclipse with a fresh worspace and importing the Xtext Homeautomation Example into it:

screencast

cdietrich commented 4 years ago

hmmm this is working for me. which xtext version do you use? maybe this is a windows only problem

miklossy commented 4 years ago

Actually I test this with Xtext 2.19 nightly build. The hard-coded Xtext Version in the RuleEngineTokenSource header is really confusing.

cdietrich commented 4 years ago

@miklossy which is your "host eclipse" version?

miklossy commented 4 years ago

The host Eclipse is 2019-06.

I debugged this a little bit and found that the XtextValidator.isRegisteredPackage(referencedPackage) returns true resulting into the validation warning.

cdietrich commented 4 years ago

hmmm i wonder why.

miklossy commented 4 years ago

I observed the following values in the isRegisteredPackage method:

  1. in case of a warning ePackage.getNsURI(): http://www.eclipse.org/xtext/xbase/Xbase ePackage.eResource().getURI().toString():``http://www.eclipse.org/xtext/xbase/Xbase

  2. in case of no warning
    ePackage.getNsURI(): http://www.eclipse.org/xtext/xbase/Xbase ePackage.eResource().getURI().toString(): platform:/resource/org.eclipse.xtext.xbase/model/Xbase.ecore

The ePackage.eResource().getURI().toString() call sometimes returns platform:/resource/org.eclipse.xtext.xbase/model/Xbase.ecore and sometimes http://www.eclipse.org/xtext/xbase/Xbase. The latter case results in the warning.

szarnekow commented 4 years ago

This could be a race or an ordering issue in the build.

jbadeau commented 4 years ago

Any update on this?

Eclipse: 2019-06 (4.12.0) Xtext Complete SDK 2.17.0.v20190226-1756

cdietrich commented 4 years ago

No

asiehsalehi commented 4 years ago

Hi any update? Eclipse Oxygen.3a Release (4.7.3a) Xtext Complete SDK 2.19.0.v20190902-1322

I have the waring when importing the model project within the workspace.

cdietrich commented 4 years ago

No update on this issue

szarnekow commented 4 years ago

Does the warning disappear after a subsequent clean build?

asiehsalehi commented 4 years ago

not really!

miklossy commented 4 years ago

See also #367013 and #412443

PhilippSalvisberg commented 3 years ago

I also get this warning with Eclipse 2020-12 and Xtext 2.24.0 on macOS BigSur:

image

after reopening the .xtext file the warning disappears:

image

szarnekow commented 3 years ago

This is usually caused by bigger class path changes (e.g. new target platform) when the editor is reconciled before the build is done. Indeed closing / reopening or a clean build on the project with the grammar "usually" helps to get rid of the warning if the project setup itself is correct.

pjljvandelaar commented 7 months ago

Problem seems still not be solved fundamentally

image