Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter
Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1720911] Thu, 21 January 2016 18:54 Go to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 220
Registered: May 2012
Senior Member
Trying my first formatter2 work... with a whitespace language. Only example documentation I can find is the homeautomation example.

Nearly every access to the API I make gets a warning:

Discouraged access: The type IHiddenRegionFormatter is not accessible
due to restriction on required project <your project>


What does this mean? Where would I fix/adjust it?

Luna Xtext 2.8
Re: Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1720913 is a reply to message #1720911] Thu, 21 January 2016 19:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14080
Registered: July 2009
Senior Member
it means: the api is not final and it may and will change in future releases (e.g. if you update to xtext 2.9)
if you can live with that you can use it anyway but you may not complain if api changes and you have to rework your formatter with a future release


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1720916 is a reply to message #1720911] Thu, 21 January 2016 19:29 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 220
Registered: May 2012
Senior Member
Something pretty fundamental is not setup correctly:

Discouraged access: The type AbstractFormatter2 is not accessible due to restriction on required project <your project>

... and that warning is on the import statement!

Of course, all I knew to do was this in my MWE2 file:

// formatter API
// fragment = formatting.FormatterFragment auto-inject {}
//fragment = ecore2xtext.FormatterFragment auto-inject {}
fragment = formatting2.Formatter2Fragment {}


My project was using the ecore2xtext.FormatterFragment beforehand since I've imported from an existing ecore model.

Needless to say, I'm having issues figuring out where to even start with the new formatter API. (and I didn't know the last one either)

[Updated on: Thu, 21 January 2016 19:30]

Report message to a moderator

Re: Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1720917 is a reply to message #1720916] Thu, 21 January 2016 19:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14080
Registered: July 2009
Senior Member
as i said: if you can live with the restriction simply ignore the warning. (and maybe follow https://bugs.eclipse.org/bugs/show_bug.cgi?id=363685)

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1720925 is a reply to message #1720917] Thu, 21 January 2016 20:51 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 220
Registered: May 2012
Senior Member
Thank you. Your response was so quick, I didn't even see it before I wrote my next post. You're fast!
Re: Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1795847 is a reply to message #1720925] Mon, 01 October 2018 09:57 Go to previous message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 134
Registered: February 2016
Senior Member
The Discouraged access warnings can be eliminated by defining an explicit access rule on the org.eclipse.xtext.formatting2 package.
See also https://github.com/eclipse/xtext-eclipse/pull/835
Previous Topic:Transitive imports using EmbeddedEditor (standalone java application)
Next Topic:Parsing in-memory codes with crossrefs between resources in RCP application
Goto Forum:
  


Current Time: Wed Oct 27 01:26:01 GMT 2021

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

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

Back to the top