Skip to content

Commit 604a4ef

Browse files
committed
Remove custom DID_OPEN and DID_CHANGE features
These are already defined by pygls; turns out the bug I ran into before is more with the INCREMENTAL versus FULL than the need for me to implement my open/close options. Seems to improve performance as well.
1 parent 6cfb9ba commit 604a4ef

2 files changed

Lines changed: 3 additions & 36 deletions

File tree

jedi_language_server/server.py

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,11 @@
99
from typing import List, Optional
1010

1111
from pygls.server import LanguageServer
12-
from pygls.features import (
13-
COMPLETION,
14-
DEFINITION,
15-
HOVER,
16-
REFERENCES,
17-
RENAME,
18-
TEXT_DOCUMENT_DID_CHANGE,
19-
TEXT_DOCUMENT_DID_OPEN,
20-
)
12+
from pygls.features import COMPLETION, DEFINITION, HOVER, REFERENCES, RENAME
2113
from pygls.types import (
2214
CompletionItem,
2315
CompletionList,
2416
CompletionParams,
25-
DidChangeTextDocumentParams,
26-
DidOpenTextDocumentParams,
2717
Hover,
2818
Location,
2919
RenameParams,
@@ -40,8 +30,7 @@
4030

4131
SERVER = LanguageServer()
4232

43-
# NOTE: neovim LanguageClient doesn't support incremental completions. When it
44-
# does, I may consider relaxing this constraint
33+
# NOTE: Incremental completions appear to be broken for me. Currently debugging
4534
SERVER.sync_kind = TextDocumentSyncKind.FULL
4635

4736

@@ -121,25 +110,3 @@ def lsp_rename(
121110
else:
122111
changes[location.uri].append(text_edit)
123112
return WorkspaceEdit(changes=changes)
124-
125-
126-
@SERVER.feature(TEXT_DOCUMENT_DID_CHANGE)
127-
def lsp_did_change(
128-
server: LanguageServer, params: DidChangeTextDocumentParams
129-
) -> None:
130-
"""Updates file when the file changes on server"""
131-
workspace = server.workspace
132-
if params.contentChanges:
133-
for change in params.contentChanges:
134-
workspace.update_document(
135-
text_doc=params.textDocument, change=change
136-
)
137-
138-
139-
@SERVER.feature(TEXT_DOCUMENT_DID_OPEN)
140-
def lsp_did_open(
141-
server: LanguageServer, params: DidOpenTextDocumentParams
142-
) -> None:
143-
"""Text document did, in fact, open"""
144-
workspace = server.workspace
145-
workspace.put_document(params.textDocument)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ line-length = 79
77

88
[tool.poetry]
99
name = "jedi-language-server"
10-
version = "0.1.1"
10+
version = "0.1.2"
1111
description = "A language server for Jedi!"
1212
authors = ["Sam Roeca <samuel.roeca@gmail.com>"]
1313
readme = "README.md"

0 commit comments

Comments
 (0)