Skip to content
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

notebook cell doesn't get document highlight request #1406

Closed
heejaechang opened this issue Jan 11, 2024 · 4 comments
Closed

notebook cell doesn't get document highlight request #1406

heejaechang opened this issue Jan 11, 2024 · 4 comments
Milestone

Comments

@heejaechang
Copy link
Contributor

repro steps

  1. install latest python extension
  2. create notebook
  3. put this python code in the python cell
a = 1
print(a)
  1. place cursor at a

see whether onDocumentHighlight is called.

Expected: it gets called like other APIs such as onHover
Actual: it never gets called.

if I do same for regular python file such as test.py with the same content, the API gets called as expected.

@heejaechang
Copy link
Contributor Author

this might be a bug in vscode - microsoft/vscode#202293

@heejaechang
Copy link
Contributor Author

heejaechang commented Jan 11, 2024

another issue found was in Server Capability that is returned from initialize,

it has documentHighlightProvider?: boolean | DocumentHighlightOptions; instead of documentHighlightProvider?: boolean | DocumentHighlightOptions | **DocumentHighlightRegistrationOptions**; unlike typeHierarchyProvider?: boolean | TypeHierarchyOptions | TypeHierarchyRegistrationOptions

also, I am not sure why
documentFormattingProvider has this signature export class DocumentFormattingFeature extends TextDocumentLanguageFeature<boolean | DocumentFormattingOptions, **DocumentHighlightRegistrationOptions** instead of DocumentFormattingRegistrationOptions

@dbaeumer
Copy link
Member

it has documentHighlightProvider?: boolean | DocumentHighlightOptions; instead of documentHighlightProvider?: boolean | DocumentHighlightOptions | DocumentHighlightRegistrationOptions; unlike typeHierarchyProvider?: boolean | TypeHierarchyOptions | TypeHierarchyRegistrationOptions

Reason is Backwards compatibility. We had document highlight before a server could provide a selector on initialize. If we want to support this we need to make this a client capability since forcing clients to support this would be a breaking chance.

also, I am not sure why
documentFormattingProvider has this signature export class DocumentFormattingFeature extends TextDocumentLanguageFeature<boolean | DocumentFormattingOptions, DocumentHighlightRegistrationOptions instead of DocumentFormattingRegistrationOptions

Very likely a copy / paste mistake. Fixed it.

@dbaeumer
Copy link
Member

Closing the issue since the problem mentioned in the description is tracked in microsoft/vscode#202293

@dbaeumer dbaeumer added this to the Next milestone Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants