Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Language default editor(Why when creating a language with Xtext the default editor is not it more that of language but of Xtext?)
Language default editor [message #1732770] Thu, 19 May 2016 23:58 Go to next message
Yves LEDUC is currently offline Yves LEDUCFriend
Messages: 56
Registered: May 2015
Member
Why in a Xtext project, the publisher created is not taken as the default editor?
Why the default option of the editor in the manifest Extensions tab it is no longer taken into account when set to true?

The parameterization is found both in the plugin.xml but is no longer taken into account when it was in previous versions of Xtext !!!!!

How bearing it programmatically?
How to overcome this problem with code?

Thanks
Re: Language default editor [message #1732774 is a reply to message #1732770] Fri, 20 May 2016 07:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i cannot follow you

do you mean

<editor
            class="org.xtext.example.mydsl1.ui.MyDslExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
            contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
            default="true"
            extensions="mydsl1"
            id="org.xtext.example.mydsl1.MyDsl"
            name="MyDsl Editor">
        </editor>


that default="true" is not taken into account, even in a new workspace?

and what is the "old" and the "new" version of xtext


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 20 May 2016 07:35]

Report message to a moderator

Re: Language default editor [message #1732890 is a reply to message #1732774] Sun, 22 May 2016 07:39 Go to previous messageGo to next message
Yves LEDUC is currently offline Yves LEDUCFriend
Messages: 56
Registered: May 2015
Member
Thanks

Version Eclipse DSL Tools Mars.2 versus Eclipse DSL Tools Mars.1
Yes, even with a new workspace.
Yes it is the default=true (defined with the wizard).

Here is the beginning of my plugin.xml file.

<plugin>
<extension
point="org.eclipse.ui.editors">
<editor
class="com.infoly.eclipse.xtext.algo.ui.AlgorithmicExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
default="true"
extensions="alg,algo"
icon="icons/AlgoMico.png"
id="com.infoly.eclipse.xtext.algo.Algorithmic"
name="Algorithmic Editor">
</editor>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="com.infoly.eclipse.xtext.algo.ui.AlgorithmicExecutableExtensionFactory:org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler"
commandId="org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclaration">
<activeWhen>
<reference
definitionId="com.infoly.eclipse.xtext.algo.Algorithmic.Editor.opened">
</reference>
</activeWhen>
</handler>
<handler
class="com.infoly.eclipse.xtext.algo.ui.AlgorithmicExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
commandId="com.infoly.eclipse.xtext.algo.Algorithmic.validate">
<activeWhen>
<reference
definitionId="com.infoly.eclipse.xtext.algo.Algorithmic.Editor.opened">
</reference>
</activeWhen>
</handler>
<!-- copy qualified name -->
<handler
class="com.infoly.eclipse.xtext.algo.ui.AlgorithmicExecutableExtensionFactory:org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedNameHandler"
commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName">
<activeWhen>
<reference definitionId="com.infoly.eclipse.xtext.algo.Algorithmic.Editor.opened" />
</activeWhen>
</handler>
<handler
class="com.infoly.eclipse.xtext.algo.ui.AlgorithmicExecutableExtensionFactory:org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedNameHandler"
commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName">
<activeWhen>
<and>
<reference definitionId="com.infoly.eclipse.xtext.algo.Algorithmic.XtextEditor.opened" />
<iterate>
<adapt type="org.eclipse.xtext.ui.editor.outline.IOutlineNode" />
</iterate>
</and>
</activeWhen>
</handler>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="com.infoly.eclipse.xtext.algo.Algorithmic.Editor.opened">
<and>
<reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
<with variable="activeEditor">
<test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
value="com.infoly.eclipse.xtext.algo.Algorithmic"
forcePluginActivation="true"/>
</with>
</and>
</definition>
<definition id="com.infoly.eclipse.xtext.algo.Algorithmic.XtextEditor.opened">
<and>
<reference definitionId="isXtextEditorActive"/>
<with variable="activeEditor">
<test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
value="com.infoly.eclipse.xtext.algo.Algorithmic"
forcePluginActivation="true"/>
</with>
</and>
</definition>
</extension>

[Updated on: Sun, 22 May 2016 07:43]

Report message to a moderator

Re: Language default editor [message #1732891 is a reply to message #1732890] Sun, 22 May 2016 08:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
And you are sure you tried it with a fresh workspace and the Plugin is properly started

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Language default editor [message #1732921 is a reply to message #1732891] Mon, 23 May 2016 06:36 Go to previous messageGo to next message
Yves LEDUC is currently offline Yves LEDUCFriend
Messages: 56
Registered: May 2015
Member
Yes, I have to try everything, but I just noticed that Eclipse appears at startup:

!SESSION 2016-05-23 08:07:45.850 -----------------------------------------------
eclipse.buildId=4.5.2.M20160212-1500
java.version=1.8.0_71
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=fr_FR
Framework arguments: -product org.eclipse.platform.ide
Command-line arguments: -product org.eclipse.platform.ide -data F:\PROJETS\2016\160523/../runtime/Algorithmic-160523 -dev file:F:/PROJETS/2016/160523/.metadata/.plugins/org.eclipse.pde.core/Algorithmic-160523/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.egit.ui 2 0 2016-05-23 08:07:55.554
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Yves'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.oomph.setup.ui 2 0 2016-05-23 08:07:55.876
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
at org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(SetupUIPlugin.java:353)
at org.eclipse.oomph.setup.ui.SetupUIPlugin.access$4(SetupUIPlugin.java:347)
at org.eclipse.oomph.setup.ui.SetupUIPlugin$1$1.run(SetupUIPlugin.java:244)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


I have the same problem to start perspective to start the application (it will be displayed in the list of prospects during a manual start as the default perspective but it does not start).
Re: Language default editor [message #1732924 is a reply to message #1732921] Mon, 23 May 2016 06:37 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
sry i have no idea. can you share a minimal reproduceable example

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Xtext dbms grammar
Next Topic:Cross linking multiple DSLs in Web Editor
Goto Forum:
  


Current Time: Wed Apr 24 23:42:28 GMT 2024

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

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

Back to the top