-
-
Notifications
You must be signed in to change notification settings - Fork 34
Use monaco-languageclient instead of monaco-editor #22
Conversation
@fcollonval Thanks so much for taking the lead on this!! We are having an in-person JupyterLab team meeting 11/26-30 and my goal is to get this working and lay down a foundation for long-term LSP support in Jupyter. Please let me know what I can do to help in the meantime 👍 |
Hey @gnestor , thanks for the feedback and interest. So questions and comments: Related to monaco languageclientTo pack The trouble comes from the fact that I need to specify that entry also in the Related issues in theia and monaco-languageclient; Another mandatory setting (for the extension only) is enabling Related to the python LSP server extensionCurrently, I used simple websocket from tornado. I'm even not inheritating from Next stepBut as I felt like pushing integration further, I tried replacing ConclusionIf we can find a solution to enable classical jupyterlab extension (i.e. without the need to modify |
Thanks for those details, @fcollonval. Regarding the webpack issue: First, @blink1073 is there any new way for an extension to provide any webpack config of its own to jupyterlab? If not, then we may want to consider moving this work (your PR and jupyterlab-monaco as a whole) into jupyterlab core. Lastly, to better understand the problem, I assume |
We were trying to avoid exposing Webpack, keeping it as an implementation detail. We do however expose generic loaders: https://github.com/jupyterlab/jupyterlab/blob/125637729d75b19bdc8177e41f4d8310a09dd229/dev_mode/webpack.config.js#L131 |
Thanks for those feedbacks. @gnestor I looked deeper to the dependencies:
|
Hi @fcollonval! The JupyterLab team is together in person this week so let's get this PR merged! I created a Gitter room for us to chat about it: https://gitter.im/jupyterlab-monaco/Lobby cc @ian-r-rose @afshin @saulshanabrook First things first, I need to get this running locally. Do you have a branch of JupyterLab that this PR works with? I tried simply adding: resolve: {
alias: {
vscode: require.resolve('monaco-languageclient/lib/vscode-compatibility')
}
} to webpack.config.js in my staging directory (which for me is /Users/grant/anaconda/share/jupyter/lab/staging) and I'm getting the following:
|
Hey @gnestor I realized this morning that @juliandolby has updated to the latest Although this is probably the easiest hack, this means including Another though: this extension is already bundling the editor separately (due to worker constraints). Would it work/be interesting to bundle with webpack |
@fcollonval I know it's been a loong time since this PR, but I am wondering since it hasn't been merged, if the functionality has been moved to another extension. If so could you share what is available to have the Monaco editor in JupyterLab? |
Hey @cgpu, this was a trial but nothing went further on my side. You definitely should look at jupyterlab-lsp altough this is using CodeMirror. |
This PR builds from the nice work of @juliandolby in #12 in an attempt to reach a new stable step.
The major addition to #12:
monaco-languages
dependencies for colorization and configuration (bracketing, indent, comment and folding) supportjlabWsUrl + "lsp/" + MonacoLanguageId
) to connect to a language serverjupyter_python_languageserver
pip package.Major knowns issues:
But a new websocket is created each time a file is (re)opened=> we multiply the number of server instance (for the Python LS example)
& => reopening a previously opened file results in an unusable editor
Note: Can we get inspiration from the terminal code?
Issue linked to the Python Language Server: Some file crashes the
pyls
subprocess. This requires the all jupyterlab to be restarted. It has something to do with the server response size./closes #12