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

Handle Code Lens Refresh Request #1918

Merged
merged 4 commits into from
Dec 13, 2021
Merged

Conversation

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()
Copy link
Contributor Author

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 ?

Copy link
Contributor Author

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" ?

Copy link
Member

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:

if session and session.uses_plugin():

The type issue can be fixed by declaring start_code_lenses_async method on the SessionViewProtocol interface.

@rwols rwols merged commit df55aed into sublimelsp:main Dec 13, 2021
rchl added a commit that referenced this pull request Dec 13, 2021
* main:
  Don't call the callback if the transport was closed
  Handle Code Lens Refresh Request (#1918)
  fix types for protocols to add type safety (#1903)
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

Successfully merging this pull request may close these issues.

3 participants