Skip to main content



      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 13:54 Go to next message
Eclipse UserFriend
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 14:04 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1720916 is a reply to message #1720911] Thu, 21 January 2016 14:29 Go to previous messageGo to next message
Eclipse UserFriend
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 14:30] by Moderator

Re: Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1720917 is a reply to message #1720916] Thu, 21 January 2016 14:42 Go to previous messageGo to next message
Eclipse UserFriend
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)
Re: Formatter2 Warnings Everywhere: Discouraged access: The type IHiddenRegionFormatter [message #1720925 is a reply to message #1720917] Thu, 21 January 2016 15:51 Go to previous messageGo to next message
Eclipse UserFriend
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 05:57 Go to previous message
Eclipse UserFriend
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: Sun Jul 27 09:38:56 EDT 2025

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

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

Back to the top