Replies: 1 comment 1 reply
-
i assume for 3.4 must be asked at https://github.com/eclipse/tm4e. please feel free to enhance the docs (xtext-website repo) to explain how to specify path to the textmate grammar in the textmates eclipse config. for 3.5. no you don't need / should not to start a runtime config if you configure lsp4e to launch via launch config. to have it visible you need to manually launch ServerLauncher class once. (in ide project, use new launch config button in run configs dialog) => please help enhancing the docs cc @miklossy |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Although I have used Xtext extensively in the past, I am only now trying to understand the use of LSP with newer versions of Xtext. I have been trying to use the documentation at https://www.eclipse.org/Xtext/documentation/340_lsp_support.html. I am using Eclipse.
I first tried to work though this section with Eclipse for Java and DSL Developers 2022-12. When I was unsuccessful I tried again with version 2023-06 with the same result. I suppose that I must be making some incorrect assumptions, so I will try to go through the instructions step-by-step and identify assumptions made in the hopes that someone will set me straight.
Step 1: This starts with the second (advanced) Xtext Project creation dialog. The first dialog requires identifying the name of the language and the extension. I have filled in the first dialog with values compatible with the Xtext - 15 Minutes Tutorial (Domainmodel) and with the defaults (MyDsl) both, in case this somehow makes a difference.
Step 2: I have assumed that in "Implement[ing] the Domainmodel language following the Xtext - 15 Minutes Tutorial", the project should use the Advanced Xtext Configuration settings shown in Step 1.
Step 3.1: I have configured a Text child for both a MyDsl project and for a Domainmodel project, as explained in Step 1.
Step 3.2: Likewise, I've done this for both a MyDsl project and for a Domainmodel project. I have verified that the ServerLauncher is started and at least some calls are made to LanguageServerImpl methods.
Step 3.3: This step seems straightforward. I have done this also with both a MyDsl project and a Domainmodel project.
Step 3.4: I do not know what to name nor where to place the suggested TextMate json file. I've looked at the TextMate documentation and do not see that it answers these questions. However, without doing Step 3.4 I would still expect the Language Server to provide other capabilities as referenced in Step 3.5.
Step 3.5: I first assumed that although not explicitly stated, a new Eclipse instance should be started via an Eclipse Application launch configuration to generate a new instance of Eclipse, similar to what is done in the Xtext - 15 Minutes Tutorial. The Xtext - 15 Minutes Tutorial states that the new project should be a Java Project ("... create a new project of your choice, e.g.. File -> New -> Project... -> Java Project ..."). In the new instance of Eclipse I created a new General Project, as I have always done for my Xtext DSL projects, and created a file test.dmodel and opened it in a Generic Text Editor but there was no code completion. I then created a new Java Project, created a test.dmodel file, and opened it in the Generic Text Editor but again there was no indication of any services from the language server. I then created a new Java project in my plug-in development Eclipse and created a test.dmodel file and opened it in a Generic Text Editor. Here also I did not get the expected code-completion service shown in Step 3.5. Note that as I was reaffirming these results, I suddenly started getting language server services (code completion) in both the General and the Java projects in the new instance of Eclipse, but not in the project in plug-in development instance of Eclipse.
Note that the code-completion content that I get is not that shown in the documentation:
.
In conclusion, I now have language server services working in some paths of my trial-and-error exploration and the question for Step 3.4 might be the only unresolved question. However, I will post post this as composed in the hopes that it might be of use in making the documentation less ambiguous for future users.
Beta Was this translation helpful? Give feedback.
All reactions