deepforge
deepforge copied to clipboard
Integrate Python Language Server to Monaco Editor (Closes #1908, #571)
To run this PR locally. Checkout the branch:
- Do a docker build for the language server json file:
$ docker build -t langServers:latest -f docker/Dockerfile.langservers .
- Update
components.json
to add the following key:
"LanguageServers" : {
"hostName": "http://localhost:5000",
"servers": {
"python": {
"command": "Microsoft.Python.LanguageServer",
"init": {
"interpreter": {
"properties": {
"InterpreterPath": "/opt/conda/bin/python3"
},
"code": "import func",
"item": "functools"
}
},
"workspace": "/tmp/python-models/"
}
}
}
- Spin up the container for language servers:
$ docker run -p 5000:5000 -it langServers:latest
- Run
npm start
:
$ npm start
I have changed this PR to use microsoft's python language server. This still needs some changes to the TextEditorWidget code.
Hmm... I am seeing some errors when trying to build the docker image:
This Branch is working and tested locally. There can be deployment specific quirks which need to be verified.
Have you seen this error before while building the docker container?
No, I have not, but I will have a look.
I think the issue had to do with js-yaml
safeDump
function being removed from the latest release. I have fixed it. I have also deployed the branch at dev.deepforge.org. Should be good to go for testing in few minutes.
Nice. That fixed it for me - thanks! Now I can check out the rest of it :)
Overall, this looks good. A couple issues (I already mentioned them in slack but putting them here, too):
- performance is pretty bad currently and probably won't scale. It would be good to investigate this further and make sure this is disabled for editor.deepforge.org.
- Make sure the GitHub action is reverted so it isn't building on this branch
After ensuring it is disabled for editor.deepforge.org and the GitHub action is reverted, feel free to go ahead and merge it!
In verbose mode, using the ConsoleWindow
, we are getting the following error message:
DeepForge Language Client: Error: The task was cancelled.
at https://dev.deepforge.org/extlib/src/visualizers/widgets/TextEditor/lib/vscode-ws-jsonrpc.min.js:1:8642
at https://dev.deepforge.org/extlib/src/visualizers/widgets/TextEditor/lib/vscode-ws-jsonrpc.min.js:1:8936
at https://dev.deepforge.org/extlib/src/visualizers/widgets/TextEditor/lib/vscode-ws-jsonrpc.min.js:1:9295
at https://dev.deepforge.org/extlib/src/visualizers/widgets/TextEditor/lib/vscode-ws-jsonrpc.min.js:8:24724
at p (https://dev.deepforge.org/extlib/src/visualizers/widgets/TextEditor/lib/vscode-ws-jsonrpc.min.js:8:24839)
at a (https://dev.deepforge.org/extlib/src/visualizers/widgets/TextEditor/lib/vscode-ws-jsonrpc.min.js:8:24197)
This might be at the root of performance issue as new client gets instantiated as soon as this error is encountered. The minified files have no source maps, It might be good to investigate this further.