-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concat notebook document causes editor highlights across notebook cells to be merged into current cell editor #5932
Comments
Are we sure this isn't a bug in the concat document logic for mapping locations? I'm not sure this breaks in a regular Python file. |
Ahh sorry, the problem went away when I switched the language server to Jedi, but I just tried switching it to JediLSP and I do repro the same issue with that, so it's not Pylance specific. Thanks for asking. Transferring this one to vscode-jupyter for us to deal with. |
Actually I don't have permissions to move issues in this repo. Would you mind transferring it please @jakebailey? |
Sure. Not sure why you don't, though... 🙂 |
Any updates or workarounds about this issue? I'm facing this issue now after the big UI update of the jupyter extention (v2021.6.999662501). |
(Coming in from #6461) @joyceerhl @jakebailey @greazer Would it please be possible, until you find time to investigate this bug, stop registering a document highlight provider? A document highlight provider that returns garbage ranges decreases from the value of vscode. It is better that the UI falls back to the word based highlighter if the language server always returns bad ranges. |
There's nothing wrong with the underlying language server, this is a bug with the concat doc layer used to give the language server a document that looks like the cells (then convert back to cell locations). It appears to be incorrectly converting the locations. Since the LSP is not cell aware, I believe all of the handlers are hooked up in one of the extensions directly, so could be disabled. (But, I'm not really sure how this fails but calls that do the same thing like diagnostics or references work fine.) |
This requires changes similar to #6799. On the to do list. |
@rchiodo Can you shed some light? My understanding is that for #6799 the logic for how providers are being handled needed to change. My understanding of this issue is the following:
My understanding is that something in step 4 fails and that all highlight ranges are returned. |
ok. thanks for clarifying |
The intent is to work on it for November. It may or not be closed by then. |
@rchiodo I have taken a stab at this: microsoft/vscode-jupyter-lsp-middleware#20 |
Thanks @jrieken . Your PR looks good to me. Once that goes through I can update the package.json in the jupyter repro |
Verification steps:
|
Environment data
Expected behaviour
Editor highlights in a notebook cell should appear only for occurrences in the current cell.
Actual behaviour
Editor highlights in a notebook cell appear for occurrences in the current cell plus any occurrences in the rest of the document applied to the current editor, i.e. same line and column start/end but different cell editors. This behavior occurs with both Pylance and JediLSP, so most likely is not a Pylance specific problem.
and
pd
in the first cell. A highlight corresponding to the column start and end ofpd
in the second cell is also applied to the first cell editor:Logs
Code Snippet / Additional information
XXX
The text was updated successfully, but these errors were encountered: