Comments (15)
The first line of each code cell in my notebooks is now underlined with a curly line. When hovering over it, the message appears that there are too many blank lines. See this screenshot:
from jupyterlab-lsp.
from jupyterlab-lsp.
There is no python-markdown
server, I but apparently the UI might be confusing there. More likely it is suggesting installation of a Markdown server. Can you post a screenshot?
from jupyterlab-lsp.
There above it says that Markdown is missing ;) It says python-markdown in the tooltip because a markdown document is embedded in a Python notebook.
Though I guess the statusbar item should be less verbose.
from jupyterlab-lsp.
In earlier versions there was no message saying that a markdown server was missing. Also, now the python lsp server complains that there are too many blank lines between code lines. I suppose this is because it doesn't see the markdown cells?
from jupyterlab-lsp.
In earlier versions there was no message saying that a markdown server was missing
Oh yeah, this is a new feature since JupyterLab 4+ compatible versions. Previously there was no support for Markdown cells. Now you can get syntax errors, grammar checks etc when you have a suitable server installed.
Also, now the python lsp server complains that there are too many blank lines between code lines. I suppose this is because it doesn't see the markdown cells?
No, that would be unrelated. Can you post a specific example?
from jupyterlab-lsp.
The first line of each code cell in my notebooks is now underlined with a curly line. When hovering over it, the message appears that there are too many blank lines. See this screenshot:
The above error is discussed in the other issue, #1054 . Very irritating code highlighting.
from jupyterlab-lsp.
Now you can get syntax errors, grammar checks etc when you have a suitable server installed.
Is there such a LSP server for markdown? On https://jupyterlab-lsp.readthedocs.io/en/latest/Language%20Servers.html it is suggested to use unified-language-server, installable as dev dependcy with npm/yarn. This would mean a rebuild of jupyterlab, right? Any other solution (the ideal would be a python markdown lsp sever).
from jupyterlab-lsp.
@krassowski Just read on the doc
If you wish to install these someplace else, you may need to specify where you install them with extra_node_roots.
I have added that trait to my server --LanguageServerManagerAPI.extra_node_roots=<absolute_path>
with various variant of the absolute path (the folder where node_module is, the node_module folder, the unified-language-server folder) without luck.
from jupyterlab-lsp.
Is there such a LSP server for markdown?
@echarles yes, unified-language-server
works for markdown. There are probably other Markdown language servers, we should have a look to see if there is a good one which does not require Node.js (there was not one back when I looked few years ago).
This would mean a rebuild of jupyterlab, right?
No, this is not required.
various variant of the absolute path (the folder where node_module is, the node_module folder, the
unified-language-server
folder) without luck.
It might be that a new version of unified-language-server
does not work. On CI we are testing "^0.3.0". In general the heuristic search for npm
servers is defined here:
jupyterlab-lsp/python_packages/jupyter_lsp/jupyter_lsp/types.py
Lines 216 to 235 in b159ae2
so running with --debug
you should see which paths get checked. For unified-language-server
it searches for:
from jupyterlab-lsp.
we should have a look to see if there is a good one which does not require Node.js (there was not one back when I looked few years ago).
I quickly looks for python ones but did not find. @fcollonval pointed me to the vscode (nodejs) one https://github.com/microsoft/vscode/tree/main/extensions/markdown-language-features/server which would require additional config as documented on https://jupyterlab-lsp.readthedocs.io/en/latest/Configuring.html#language-servers
. On CI we are testing "^0.3.0". In...
so running with --debug you should see which paths get checked. For unified-language-server it searches for
Pinning and pointing to the folder above the node_modules made it work but clicking on TAB in a markdown cell or document does nothing...
from jupyterlab-lsp.
When I click on TAB in a Markdown content, I see the following log, but nothing shows up (btw the LSP autocomplete for python works fine).
[D 2024-05-15 10:49:48.393 ServerApp] [unified-language-server] Handling a message
from jupyterlab-lsp.
When I click on TAB in a Markdown content
Not every language serer implements Tab completion. unified-language-server
implements spell checking via linting (textDocument/publishDiagnostics
), and two requests which jupyterlab-lsp does not yet support (textDocument/codeAction
and textDocument/formatting
- although I had code actions running locally) - the list of what they implement is here: https://github.com/unifiedjs/unified-language-server?tab=readme-ov-file#requests
from jupyterlab-lsp.
The VScode one does implement completions but only for links as per https://github.com/microsoft/vscode/tree/main/extensions/markdown-language-features/server#server-capabilities
from jupyterlab-lsp.
Thx a lot @krassowski for the explanation. I get indeed spell check working and may try later the vscode one for completion.
from jupyterlab-lsp.
Related Issues (20)
- Follow the XDG base directory specification for the .virtual_documents folder
- Only one "Code Completion" settings seen when enabling "Continuous hinting" HOT 2
- pycodestyle false positive HOT 2
- Is @krassowski/jupyterlab-lsp still need to be installed? HOT 1
- Acceptance tests are failing on Windows with Python 3.8 (but pass with Python 3.11) HOT 2
- Need to update mitigation of file editors `extensionFactory` issue before release
- IHaskell + HLS support HOT 2
- Consider using the `bin` field from `package.json` for specs derived from `NodeModuleSpec`
- Jupyterlab-lsp Error: Uncaught Exception GET /lsp/ws/pyls (::1) HOT 5
- jupyter_lsp - different location of jupyter-lsp-notebook.json between 2.2.2 and 2.2.3 HOT 3
- Markdown cells generate a lot of errors in browser logs and seem to block other extensions, like jupyterlab-spellchecker HOT 2
- GitHub release artifacts are not separate for jupyter-lsp and jupyterlab-lsp HOT 1
- Code Jump only in the same notebook HOT 4
- Plugin has no transformers yet. HOT 2
- JSON completion introduces unexpected character HOT 1
- Environment variables set for lsp servers leak into the server/kernel
- Define custom code extractors in settings HOT 4
- getting this error about `jupyter_lsp` HOT 2
- Auto completion do not need to click `Tab` HOT 2
- Renaming symbol empties all raw cells
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyterlab-lsp.