Skip to content

Commit

Permalink
fix: deprecated document getting usage (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal authored May 6, 2024
1 parent a773e54 commit 3658396
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bundled/tool/lsp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,21 @@ def _run_unidentified_tool(
@LSP_SERVER.feature(lsp.TEXT_DOCUMENT_DID_OPEN)
def did_open(params: lsp.DidOpenTextDocumentParams) -> None:
"""LSP handler for textDocument/didOpen request."""
document = LSP_SERVER.workspace.get_document(params.text_document.uri)
document = LSP_SERVER.workspace.get_text_document(params.text_document.uri)
_linting_helper(document)


@LSP_SERVER.feature(lsp.TEXT_DOCUMENT_DID_SAVE)
def did_save(params: lsp.DidSaveTextDocumentParams) -> None:
"""LSP handler for textDocument/didSave request."""
document = LSP_SERVER.workspace.get_document(params.text_document.uri)
document = LSP_SERVER.workspace.get_text_document(params.text_document.uri)
_linting_helper(document)


@LSP_SERVER.feature(lsp.TEXT_DOCUMENT_DID_CLOSE)
def did_close(params: lsp.DidCloseTextDocumentParams) -> None:
"""LSP handler for textDocument/didClose request."""
document = LSP_SERVER.workspace.get_document(params.text_document.uri)
document = LSP_SERVER.workspace.get_text_document(params.text_document.uri)
settings = _get_settings_by_document(document)
if settings["reportingScope"] == "file":
# Publishing empty diagnostics to clear the entries for this file.
Expand Down

0 comments on commit 3658396

Please sign in to comment.