NOTE: This project is deprecated. It is superseded by textX-LS.
This is a VS code extension which uses textX-languageserver. It implements Language Server Protocol.
Extension can be found on marketplace.
If you are getting message "Python 3 is required!", you should try to manually add a path to python 3.
Go to File -> Preferences -> Settings (shortcut: CTRL + Comma) and in User or Workspace settings tab add a new key-value pair "textxls.pythonPath": "PATH_TO_PYTHON3"
dsl Workflow [wf] {
general {
publisher: "test"
version: "0.0.1"
}
paths {
grammar: "workflow/workflow.tx"
outline: "workflow/workflow.txol"
coloring: "workflow/workflow.txcl"
}
}
Press F1 and start typing one of following commands:
Export metamodel to dot(createsdotfile for your grammar in projects root; textx command)Export model to dot(createsdotfile for your model(s) in projects root; textx command)Generate vscode extension(generates vs code extension for language defined with.txconfig)
If everything works fine, after invoking Generate vscode extension command, you should see new gen directory in your projects root.
- Make sure you have vsce installed on your machine (npm install -g vsce)
cd genvsce package- This will generate new.vsixfile in gen directory- Install extension
NOTE:
Generated vs code extensions have their own language server which are activated just on language specified in .txconfig file.
If you have both textx-ls and your generated extension installed, you should disable textx-ls extension or remove .txconfig file from workspace.
Please take a look at package.json
- Install dependencies
npm install - In extension.ts comment startLangServer and uncomment startLangServerTCP
// START FOR PUBLISH
lsDisp = startLangServer(python, [textxls_main], []);
// START CLIENT TCP
// lsDisp = startLangServerTCP(5000);
context.subscriptions.push(lsDisp);- Be sure you run language server in tcp mode. Steps to run language server
- Press F5
- Open [examples] directory (https://github.com/textX/textX-languageserver/tree/master/examples)
Language server should start if you have valid .txconfig file in projects root.
This project is licensed under the MIT License - see the LICENSE.md file for details
