Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Creating multiple XText Eclipse editors for one extension
Creating multiple XText Eclipse editors for one extension [message #1809971] Fri, 26 July 2019 12:54 Go to next message
Eclipse UserFriend
Is it possible to create multiple Eclipse UI editors for one extension (example: .mydsl)? I'd like to have one editor that is syntax highlighting only and one editor that also is tied to the JVM Inference code generation. I tried creating a separate plugin project and copying over my grammar, but it seems the two plugin projects are fighting each other and I can no longer trigger the JVM Inference logic from my original plugin with that approach.
Re: Creating multiple XText Eclipse editors for one extension [message #1809973 is a reply to message #1809971] Fri, 26 July 2019 14:29 Go to previous messageGo to next message
Eclipse UserFriend
Follow up: I see now the second plugin was producing an error which prevented the original plugin from running the JVM model inference. The plugins are playing nicer together now, but I still think I am approaching this wrong. Can I create two separate xtext models for the same file extension without interfering with each other?
Re: Creating multiple XText Eclipse editors for one extension [message #1809974 is a reply to message #1809973] Fri, 26 July 2019 15:05 Go to previous messageGo to next message
Eclipse UserFriend
I have heavy doubts
But I have no idea what the actual problem is you try to solve
Re: Creating multiple XText Eclipse editors for one extension [message #1809975 is a reply to message #1809974] Fri, 26 July 2019 15:15 Go to previous messageGo to next message
Eclipse UserFriend
I have a working JVM model inference generator, but it is a little slow. I had an idea to create a second editor view that is just dumb syntax highlighting (no code generator, type checking, etc.). I did this by creating an entirely new xtext project with a different namespace but the same file extension. What I have now seems to work more or less, but I'm not clear on the XText lifecycle for two xtext projects sharing the same extension. I noticed that the AST of one project is affected by the second project, which I did not expect.

Your response makes me think this is not going to be a good route to pursue. Thanks!
Re: Creating multiple XText Eclipse editors for one extension [message #1809976 is a reply to message #1809975] Fri, 26 July 2019 15:28 Go to previous messageGo to next message
Eclipse UserFriend
but what is the criteria for which mode?
or if you want to use a dumb editor always why no writing one without xtext and remove the one xtext registers from plugin.xml
Re: Creating multiple XText Eclipse editors for one extension [message #1809977 is a reply to message #1809976] Fri, 26 July 2019 15:40 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Eclipse supports multiple editors per extension and opening uses the most recently used/default. You can use Open With... to select which you use explicitly.

This should all happen before any Xtext functionality is involved so it should just work.

But, you already have two plugins per editor, do you really want four? As Christian hints, find out what your real problem is and perhaps have some preferences/configuration/alternative menu entries.

Regards

Ed Willink
Re: Creating multiple XText Eclipse editors for one extension [message #1809978 is a reply to message #1809977] Fri, 26 July 2019 16:13 Go to previous message
Eclipse UserFriend
Thanks I think the plugin.xml file was the lead I needed, the second plugin was contributing features I didn't want which were clashing! The idea of the two views was a dumb/fast editor (an interim solution until I fix the underlying slowness issues) and a slower but more complete editor view with all the standard features view.
Previous Topic:Exception when referencing between Resources in same ResourceSet
Next Topic:Background Color of Embedded Xtext editor does not follow dark theme
Goto Forum:
  


Current Time: Wed Mar 19 06:27:10 EDT 2025

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

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

Back to the top