Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to validate wildcard package import
How to validate wildcard package import [message #1746280] Wed, 26 October 2016 12:15 Go to next message
Andrey Petrenko is currently offline Andrey PetrenkoFriend
Messages: 8
Registered: March 2016
Junior Member
Is it possible to validate imports like

import xava.util.*

I want to highlight error message that there is no such package 'xava.util'

I know that I can validate member import rule like

'import' name=[type::JvmType|QualifiedName] wildcard?='.*'?

In that case, if someone input wrong type scope returns null and validator highlight error.

But in the case of package wild card import name can be any string.

Btw xtend just shows warning message that wild card import are deprecated
Re: How to validate wildcard package import [message #1746444 is a reply to message #1746280] Fri, 28 October 2016 18:53 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 81
Registered: January 2016
Location: Kiel

The common types EPackage doesn't 'model' any Java packages, so you can not have cross references to them.
But if you have a source to tell you whether such a package exists (e.g. JDT), you can write a validation rule and check it.

TypeFox - Support And Consulting For Xtext
Previous Topic:Xtext error recovery
Next Topic:Restrict scope but still do it accross multiple files
Goto Forum:

Current Time: Sat Sep 23 02:11:48 GMT 2017

Powered by FUDForum. Page generated in 0.02104 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software