-
Notifications
You must be signed in to change notification settings - Fork 186
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
Handle Code Lens Refresh Request #1918
Conversation
plugin/core/sessions.py
Outdated
def m_workspace_codeLens_refresh(self, _: Any, request_id: Any) -> None: | ||
"""handles the workspace/codeLens/refresh request""" | ||
for sv in self.session_views_async(): | ||
sv.start_code_lenses_async() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwols is it safe to call start_code_lenses_async
each time ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also any idea how to fix error: "SessionViewProtocol" has no attribute "start_code_lenses_async"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine to call it each time. This already happens on editing the document.
Though you should guard the calls with session.uses_plugin()
like the existing places do:
Line 547 in 02d0f32
if session and session.uses_plugin(): |
The type issue can be fixed by declaring start_code_lenses_async
method on the SessionViewProtocol
interface.
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#codeLens_refresh