Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion 4 pyls/python_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,12 @@ def hover(self, doc_uri, position):
def lint(self, doc_uri, is_saved):
# Since we're debounced, the document may no longer be open
workspace = self._match_uri_to_workspace(doc_uri)
textDocument = workspace.get_maybe_document(doc_uri)
if doc_uri in workspace.documents:
workspace.publish_diagnostics(
doc_uri,
flatten(self._hook('pyls_lint', doc_uri, is_saved=is_saved))
flatten(self._hook('pyls_lint', doc_uri, is_saved=is_saved)),
textDocument.version if textDocument else None
)

def references(self, doc_uri, position, exclude_declaration):
Expand Down
8 changes: 6 additions & 2 deletions 8 pyls/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ def update_config(self, settings):
def apply_edit(self, edit):
return self._endpoint.request(self.M_APPLY_EDIT, {'edit': edit})

def publish_diagnostics(self, doc_uri, diagnostics):
self._endpoint.notify(self.M_PUBLISH_DIAGNOSTICS, params={'uri': doc_uri, 'diagnostics': diagnostics})
def publish_diagnostics(self, doc_uri, diagnostics, version):
self._endpoint.notify(self.M_PUBLISH_DIAGNOSTICS, params={
'uri': doc_uri,
'diagnostics': diagnostics,
'version': version
})

def show_message(self, message, msg_type=lsp.MessageType.Info):
self._endpoint.notify(self.M_SHOW_MESSAGE, params={'type': msg_type, 'message': message})
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.