Comments (4)
Thanks for the detailed report. Supporting this was a high priority and it used to work before the rewrite for JupyterLab 4.0. This is similar to #1009 and earlier issues on this topic.
This is a hard topic
The problem is that the kernels do not return the the information necessary to resolve whether the completion should be inserted after or in place of the existing text. This means that we need to use some heuristics for reconciliation of completions from various sources which breaks the edge cases like the latex symbols (which are substitutions). If someone has time to take a look I will prioritise review, but otherwise this might need a foundational change in jupyter protocol.
from jupyterlab-lsp.
Thanks for your response.
To clarify, I used the latex_symbols
examples just for conciseness. This appears to affect all custom completions. I will have to double check if those that are just completion and not replacement still work.
I would like to help, and I could use some information:
- Is there something implemented that is specifically disabling or ignoring certain kinds of completions?
- I tried to debug the issue at the kernel level by print statements in my custom completers. I don't see anything on the terminal. It appears that the custom completer's callback is never called. Or are kernel prints to stdout suppressed?
- Why would it be a foundational change to the protocol? I seems that this would just require additional fields in a message to indicate replacement/completion, position, etc.
Basically, I would like to understand the problem better.
Also, what is the alternative these days? Should one write their own LSP, add features to an existing one, write a Jupyter completer plugin?
from jupyterlab-lsp.
This specific problem is introduced by preFilterMatches
in setCompletionItems
logic. If you disable pre-filtering:
you should be able to use latex_symbols
the way. There is no change at the kernel level.
seems that this would just require additional fields in a message to indicate replacement/completion, position, etc.
Yes. More precisely, there are already fields for start and end position. The problem is that they are not always used and that there is no distinction between insert text and label which means that frontends have to guess what fragment should be inserted.
from jupyterlab-lsp.
Disabling "Pre-filter matches" solves the problem in my case. This may be an edge case though (Ipython kernel, Jupyter lab, Jupyter LSP support).
I still don't fully understand why this is a big issue from the perspective of Jupyter (server, lab, lsp). Things seem to work just fine with the IPython kernel. If the issue is for other kernels, it's an issue with their implementation, not Jupyter's. In my opinion, the option on the lsp client should be disabled by default. Otherwise, it will hide the problem for ever, and kernel developers won't address their problem.
Please correct me if I'm wrong on my assumptions.
from jupyterlab-lsp.
Related Issues (20)
- 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
- Whether to support monaco-editor using jupyterlab-lsp to implement multiple cells HOT 2
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.