itemis / xtext-languageserver-example Goto Github PK
View Code? Open in Web Editor NEWThis project forked from cdietrich/xtext-languageserver-example
An Example for an Xtext Language Server
License: Eclipse Public License 1.0
This project forked from cdietrich/xtext-languageserver-example
An Example for an Xtext Language Server
License: Eclipse Public License 1.0
[A binding to org.eclipse.xtext.resource.IResourceDescriptions annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.LIVE_SCOPE) was already configured at org.eclipse.xtext.service.DefaultRuntimeModule.configureIResourceDescriptionsLiveScope(DefaultRuntimeModule.java:229)., A binding to org.eclipse.xtext.resource.IResourceDescriptions annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.LIVE_SCOPE) was already configured at org.eclipse.xtext.service.DefaultRuntimeModule.configureIResourceDescriptionsLiveScope(DefaultRuntimeModule.java:229).]
Solution: in package.json update from version 1.22 to 1.25.
"engines": {
"vscode": "^1.25.0"
},
Environment: macOS Mojave
Java Version 1.8.0_201
I cloned the project and followed the instructions given in README.md
Calling ./gradlew startCode
in the project root directory on command line ends up with the error message:
0 [main] INFO text.xtext.generator.XtextGenerator - Initializing Xtext generator
5 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
59 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering project org.xtext.example.mydsl at 'file:/Users/q188463/Projects/SoSA/Development/xtext-languageserver-example/org.xtext.example.mydsl/'
59 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering project org.xtext.example.mydsl.tests at 'file:/Users/q188463/Projects/SoSA/Development/xtext-languageserver-example/org.xtext.example.mydsl.tests/'
60 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering project org.xtext.example.mydsl.ide at 'file:/Users/q188463/Projects/SoSA/Development/xtext-languageserver-example/org.xtext.example.mydsl.ide/'
66 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Using resourceSet registry. The registered Packages will not be registered in the global EPackage.Registry.INSTANCE!
250 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
252 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
261 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
261 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
595 [main] INFO erator.parser.antlr.AntlrToolFacade - Downloading file from 'http://download.itemis.com/antlr-generator-3.2.0-patch.jar' ...
Downloading ANTLR parser generator failed: download.itemis.com
Please install the feature 'Xtext Antlr SDK' manually using the external updatesite:
'http://download.itemis.com/updates/'.
(see http://www.eclipse.org/Xtext/download.html for details)
611 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow org.xtext.example.mydsl.GenerateMyDsl:
[ERROR]:
*ATTENTION*
It is highly recommended to use ANTLR's parser generator (get it from 'http://xtext.itemis.com/').
As an alternative to ANTLR you could also use the alternative implementation shipped with Xtext.
To do so use the generator fragment 'org.eclipse.xtext.generator.parser.packrat.PackratParserFragment' in your mwe2 file instead.(Element: -UNKNOWN-; Reported by: XtextGenerator)
java.lang.RuntimeException: Problems running workflow org.xtext.example.mydsl.GenerateMyDsl:
[ERROR]:
*ATTENTION*
It is highly recommended to use ANTLR's parser generator (get it from 'http://xtext.itemis.com/').
As an alternative to ANTLR you could also use the alternative implementation shipped with Xtext.
To do so use the generator fragment 'org.eclipse.xtext.generator.parser.packrat.PackratParserFragment' in your mwe2 file instead.(Element: -UNKNOWN-; Reported by: XtextGenerator)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: java.lang.RuntimeException:
[ERROR]:
*ATTENTION*
It is highly recommended to use ANTLR's parser generator (get it from 'http://xtext.itemis.com/').
As an alternative to ANTLR you could also use the alternative implementation shipped with Xtext.
To do so use the generator fragment 'org.eclipse.xtext.generator.parser.packrat.PackratParserFragment' in your mwe2 file instead.(Element: -UNKNOWN-; Reported by: XtextGenerator)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.handleIssues(Mwe2Bridge.java:59)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.preInvoke(Mwe2Bridge.java:69)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.preInvoke(AbstractWorkflowComponent.java:207)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.preInvoke(AbstractCompositeWorkflowComponent.java:30)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
... 4 more
How can I install the Xtext Antlr SDK from an Eclipse update site on command line?
Version: 2020-06 (4.16.0)
Build id: 20200416-1403
I installed Xtext Antlr SDK from the given Itemis update site.
Importing the source tree as Gradle project into my Eclipse workspace gives me errors:
Description | Resource | Path | Location | Type |
---|---|---|---|---|
AbstractMyDslIdeModule cannot be resolved to a type. | MyDslIdeModule.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide | line: 15 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/MyDslIdeModule.xtend | Xtend Problem |
AbstractMyDslRuntimeModule cannot be resolved to a type. | MyDslRuntimeModule.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl | line: 10 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslRuntimeModule.xtend | Xtend Problem |
AbstractMyDslScopeProvider cannot be resolved to a type. | MyDslScopeProvider.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/scoping | line: 13 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/scoping/MyDslScopeProvider.xtend | Xtend Problem |
AbstractMyDslValidator cannot be resolved to a type. | MyDslValidator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation | line: 15 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend | Xtend Problem |
Duplicate method _format(Object, IFormattableDocument) in type MyDslFormatter | MyDslFormatter.java | /org.xtext.example.mydsl/xtend-gen/org/xtext/example/mydsl/formatting2 | line 15 | Java Problem |
Duplicate method _format(Object, IFormattableDocument) in type MyDslFormatter | MyDslFormatter.java | /org.xtext.example.mydsl/xtend-gen/org/xtext/example/mydsl/formatting2 | line 22 | Java Problem |
Greeting cannot be resolved to a type. | MyDslFormatter.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2 | line: 14 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2/MyDslFormatter.xtend | Xtend Problem |
Greeting cannot be resolved to a type. | MyDslFormatter.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2 | line: 19 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2/MyDslFormatter.xtend | Xtend Problem |
Greeting cannot be resolved to a type. | MyDslValidator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation | line: 20 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend | Xtend Problem |
Model cannot be resolved to a type. | MyDslFormatter.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2 | line: 13 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2/MyDslFormatter.xtend | Xtend Problem |
Model cannot be resolved to a type. | MyDslParsingTest.xtend | /org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/tests | line: 20 /org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/tests/MyDslParsingTest.xtend | Xtend Problem |
MyDslGrammarAccess cannot be resolved to a type. | MyDslIdeContentProposalProvider.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist | line: 14 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist/MyDslIdeContentProposalProvider.xtend | Xtend Problem |
MyDslStandaloneSetupGenerated cannot be resolved to a type. | MyDslStandaloneSetup.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl | line: 10 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslStandaloneSetup.xtend | Xtend Problem |
org.xtext.example.mydsl.myDsl.Greeting cannot be resolved to a type. | MyDslFormatter.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2 | line: 8 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2/MyDslFormatter.xtend | Xtend Problem |
org.xtext.example.mydsl.myDsl.Greeting cannot be resolved to a type. | MyDslGenerator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator | line: 11 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator/MyDslGenerator.xtend | Xtend Problem |
org.xtext.example.mydsl.myDsl.Greeting cannot be resolved to a type. | MyDslValidator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation | line: 7 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend | Xtend Problem |
org.xtext.example.mydsl.myDsl.Model cannot be resolved to a type. | MyDslFormatter.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2 | line: 9 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2/MyDslFormatter.xtend | Xtend Problem |
org.xtext.example.mydsl.myDsl.Model cannot be resolved to a type. | MyDslParsingTest.xtend | /org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/tests | line: 13 /org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/tests/MyDslParsingTest.xtend | Xtend Problem |
org.xtext.example.mydsl.myDsl.MyDslPackage cannot be resolved to a type. | MyDslIdeContentProposalProvider.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist | line: 9 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist/MyDslIdeContentProposalProvider.xtend | Xtend Problem |
org.xtext.example.mydsl.myDsl.MyDslPackage cannot be resolved to a type. | MyDslValidator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation | line: 8 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend | Xtend Problem |
org.xtext.example.mydsl.services.MyDslGrammarAccess cannot be resolved to a type. | MyDslIdeContentProposalProvider.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist | line: 10 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist/MyDslIdeContentProposalProvider.xtend | Xtend Problem |
Superclass must be a class | MyDslIdeModule.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide | line: 15 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/MyDslIdeModule.xtend | Xtend Problem |
Superclass must be a class | MyDslRuntimeModule.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl | line: 10 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslRuntimeModule.xtend | Xtend Problem |
Superclass must be a class | MyDslScopeProvider.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/scoping | line: 13 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/scoping/MyDslScopeProvider.xtend | Xtend Problem |
Superclass must be a class | MyDslStandaloneSetup.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl | line: 10 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslStandaloneSetup.xtend | Xtend Problem |
Superclass must be a class | MyDslValidator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation | line: 15 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend | Xtend Problem |
Syntax error on tokens, delete these tokens | MyDslParsingTest.java | /org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests | line 14 | Java Problem |
The field MyDslParsingTest.parseHelper refers to the missing type Model | MyDslParsingTest.xtend | /org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/tests | line: 24 /org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/tests/MyDslParsingTest.xtend | Xtend Problem |
The method createInjector() of type MyDslIdeSetup must override a superclass method. | MyDslIdeSetup.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide | line: 16 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/MyDslIdeSetup.xtend | Xtend Problem |
The method createInjector() of type MyDslIdeSetup must override or implement a supertype method | MyDslIdeSetup.java | /org.xtext.example.mydsl.ide/xtend-gen/org/xtext/example/mydsl/ide | line 15 | Java Problem |
The method createInjectorAndDoEMFRegistration() is undefined for the type MyDslStandaloneSetup | MyDslStandaloneSetup.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl | line: 13 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDslStandaloneSetup.xtend | Xtend Problem |
The method error(String, Object, String) is undefined | MyDslValidator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation | line: 22 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend | Xtend Problem |
The method newLines(int) is undefined | MyDslFormatter.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2 | line: 20 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2/MyDslFormatter.xtend | Xtend Problem |
The method or field from is undefined for the type EObject | MyDslGenerator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator | line: 27 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator/MyDslGenerator.xtend | Xtend Problem |
The method or field from is undefined for the type EObject | MyDslGenerator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator | line: 27 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator/MyDslGenerator.xtend | Xtend Problem |
The method or field Greeting is undefined | MyDslGenerator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator | line: 26 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator/MyDslGenerator.xtend | Xtend Problem |
The method or field greetingRule is undefined | MyDslIdeContentProposalProvider.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist | line: 20 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist/MyDslIdeContentProposalProvider.xtend | Xtend Problem |
The method or field MyDslInjectorProvider is undefined | MyDslParsingTest.xtend | /org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/tests | line: 16 /org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/tests/MyDslParsingTest.xtend | Xtend Problem |
The method or field MyDslPackage is undefined | MyDslIdeContentProposalProvider.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist | line: 21 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist/MyDslIdeContentProposalProvider.xtend | Xtend Problem |
The method or field MyDslPackage is undefined | MyDslValidator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation | line: 23 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/validation/MyDslValidator.xtend | Xtend Problem |
The method or field name is undefined for the type EObject | MyDslGenerator.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator | line: 27 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator/MyDslGenerator.xtend | Xtend Problem |
The method or field newLine is undefined | MyDslFormatter.xtend | /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2 | line: 22 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/formatting2/MyDslFormatter.xtend | Xtend Problem |
Type mismatch: cannot convert from MyDslIdeModule to Module | MyDslIdeSetup.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide | line: 17 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/MyDslIdeSetup.xtend | Xtend Problem |
Type mismatch: cannot convert from MyDslRuntimeModule to Module | MyDslIdeSetup.xtend | /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide | line: 17 /org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/MyDslIdeSetup.xtend | Xtend Problem |
As Che is also compatible with LSP. Do we have any example/documentation for integrating with Eclipse Che?
From Xtext file, can we generate the Xtext based editor from this protocol? Is there any documentation?
Remote debugging is no longer working
it work only if i set an environment variable like
export MYDSL_STANDALONE_OPTS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=y,quiet=y -Xmx256m"
Hello Xtext Languageserver Example team,
The Xtext team would like to update the Xtext community website listing all the cool projects people are building around Xtext/Xtend.
See also the corresponding GitHub issue and Bugzilla ticket.
If you are interested that the Xtext Languageserver Example project is listed there, please provide the following information as a comment to this issue:
<tr>
<td><a href="project_link">project_name</a></td>
<td>project_description_max_2_sentences</td>
<td>license</td>
<td>category</td>
<td>author(s)</td>
</tr>
We will then update the Xtext community website and get it online as soon as possible.
Thanks!
Tamás
in the file org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/ServerLauncher.xtend the log file is notsuitable for windows and hard coded to cdietrich.
I can produce a pull request for this.
The timestamp has : in it which is not suitable for windows which can be fixed with (new Timestamp(System.currentTimeMillis)).toString.replaceAll(" ","")**.replaceAll(":","")**
I would be suitable for windows to use the current working directory for logs using
val currentDir = System.getProperty("user.dir")
val stdFileOut = new FileOutputStream(currentDir + "\logs\out-" + id + ".log")
I have few eclipse plugins generated with xtext for dsl languages and I need to implement same approach for VsCode.
Could you please recommend me what would be the best approach ?
Do we have a xtext plugin for vscode that could do same thing? generate a dsl language server based on a grammar ?
Thank you
Hello! I noticed the LSP was not working when you ran the Theia-vscode side of things.
To solve this I downgraded the vscode-extension-self-contained/package.json
"vscode-languageclient": "^8.0.1"
to
"vscode-languageclient": "6.1.4"
Then had to update the extension.ts imports to:
import { LanguageClient, LanguageClientOptions, ServerOptions } from 'vscode-languageclient';
Figured I'd post this here to let you know!
Xtext uses lsp4j so should we
fix the gradle stuff for windows when we have a more clean solution
The following things should be improved
I see that in the extension.ts file, the debug server options are set up to start the server with remote debug configured.
Can somebody please explain to me how I can utilize this and actually debug my language server?
I'm trying to extend the LanguageServerImpl cause I want to react when the didChangeWatchedFiles
message is sent, but I don't seem to receive a message in my language server.
We build our VS Code extension with our Xtext DSL. It works fine. The syntax support and code generate works fine. The only thing is, we would prefer, that the code generator should not start before the DSL file is saved. At the moment, the code generator starts after each input in the editor.
Is there a way to configure this?
I have created a Xtext LSP project similar to https://github.com/itemis/xtext-languageserver-example/tree/master/org.xtext.example.mydsl and I am using the jar in a VSCode extension
var serverInfo = function () {
// Connect to the language server via a io channel
var jar = context.asAbsolutePath(path.join('resources', 'dsl-ls.jar'));
var child = spawn('java', ['-Xdebug', '-Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n,quiet=y', '-jar', jar, '-log debug']);
console.log(child.stdout.toString());
child.stdout.on('data', function (chunk) {
console.log(chunk.toString());
});
child.stderr.on('data', function (chunk) {
console.error(chunk.toString());
});
return Promise.resolve(child);
};
var clientOptions = {
documentSelector: ['mydsl']
};
// Create the language client and start the client.
client = new LanguageClient('MYDSL1', serverInfo, clientOptions);
This method works quite well. But I want to debug my server on the console, so I started the server on the terminal
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n,quiet=y -jar ./mydsl-ls.jar -log debug
which is basically the same command in spawn
.
And I made changes in extension.ts
as per
xtext-languageserver-example/vscode-extension/src/extension.ts
Lines 13 to 24 in dfbb365
But I get an error on the extension output terminal without any additional info:
Connection to server is erroring. Shutting down server.
Firstly, how do I know what port the LSP server is running on? If port is not the issue, what else might be the problem?
Once atom/atom-languageclient#239 is fixed, provide Code Action Support for Atom
theia no longer supports lsp directly
replace example with one using vscode
see
https://github.com/cdietrich/theia-xtext-vscode-example
Move atom stuff to fork
https://github.com/atom-ide-community/atom-ide-languageclient
once that one is up to date
then we also can ditch this old master branch
and move to one of the WIP branch
Hello, this is not a project's issue. Sorry about that, I hope you are fine with it, otherwise I can copy in a different place if you point me out.
Issue
I created my DSL. It works on Eclipse and in Web mode. In order to be able to create a VS Code extension I followed this project's general structure.
Everything works as expected but the suggestions. By suggestions I refer to the functionality one can find in the XText Web project/Eclipse in which all the possible tokens in the current context are listed by pressing ctrl+space.
Right now when pressing ctrl+space VS Code shows the list of keywords listed in the syntax, without any particular sensitivity to the context, that is, what effectively applies after certain token.
Capabilities
I put some extra logs and realized that when Code initializes Language server it offers the following capabilities:
Result: {
"capabilities": {
"textDocumentSync": 2,
"hoverProvider": true,
"completionProvider": {
"resolveProvider": false,
"triggerCharacters": [
"."
]
},
"signatureHelpProvider": {
"triggerCharacters": [
"(",
","
]
},
"definitionProvider": true,
"referencesProvider": true,
"documentHighlightProvider": true,
"documentSymbolProvider": true,
"workspaceSymbolProvider": true,
"codeActionProvider": false,
"documentFormattingProvider": true,
"documentRangeFormattingProvider": true,
"renameProvider": {
"prepareProvider": true
},
"executeCommandProvider": {
"commands": []
},
"workspace": {
"workspaceFolders": {
"supported": true,
"changeNotifications": true
}
},
"semanticHighlighting": {
"scopes": []
}
}
}
At this point I am not sure whether I misunderstood VS Code<>Xtext (LSP4J) integration possibilities or I am missing something or doing something wrong.
It seems you're the only one around that worked on this and shared your work, so maybe you can help me here.
Thanks
I used this template in 2020 to build my own VS Code extension.
Everything worked back then, but when I open the workspace with the very same eclipse version again today (2020-06), the library "Project and External Dependencies" does not show and all the dependencies to Xtext and related libs are broken.
Building from gradle still works, and I assume the issue is related to how buildship sets up the classpath, but I tried to refresh the gradle project and get this "Library entry" back so I can use the eclipse IDE to browse my projects again, but I cannot make it work. Any ideas how I can fix that?
UPDATE
In case you experience the same issue, try this solution of setting up a new workspace and importing the root gradle project, it worked for me:
#79 (comment)
MyDslCodeActionService works only when applied at first try with changeserializer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.