Skip to content

Commit 5322e57

Browse files
committed
fixed error validation only working at startup
1 parent 13be370 commit 5322e57

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

client/commands/v2/persistent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@ async def try_initialize(
187187
async def _read_lsp_request(
188188
input_channel: connection.TextReader, output_channel: connection.TextWriter
189189
) -> AsyncIterator[json_rpc.Request]:
190-
LOG.info("** Inside the read lsp function ** ")
190+
# LOG.info("** Inside the read lsp function ** ")
191191
try:
192-
LOG.info("** Inside the try and except ** ")
192+
# LOG.info("** Inside the try and except ** ")
193193
message = await lsp.read_json_rpc(input_channel)
194-
LOG.info(f"** {message} **")
194+
# LOG.info(f"** {message} **")
195195
yield message
196196
except json_rpc.JSONRPCException as json_rpc_error:
197-
LOG.info("** Inside the except ** ")
197+
# LOG.info("** Inside the except ** ")
198198
await lsp.write_json_rpc(
199199
output_channel,
200200
json_rpc.ErrorResponse(

client/commands/v2/pysa_server.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
LOG: logging.Logger = logging.getLogger(__name__)
3737

38+
PYSA_HANDLER_OBJ = None
39+
3840

3941
class PysaServer:
4042
# I/O Channels
@@ -101,7 +103,7 @@ async def wait_for_exit(self) -> int:
101103
async def process_open_request(
102104
self, parameters: lsp.DidOpenTextDocumentParameters
103105
) -> None:
104-
LOG.info("** Inside process_open_request() **")
106+
# LOG.info("** Inside process_open_request() **")
105107
document_path = parameters.text_document.document_uri().to_file_path()
106108
if document_path is None:
107109
raise json_rpc.InvalidRequestError(
@@ -111,7 +113,7 @@ async def process_open_request(
111113
async def process_close_request(
112114
self, parameters: lsp.DidCloseTextDocumentParameters
113115
) -> None:
114-
LOG.info("** Inside process_close_request() **")
116+
# LOG.info("** Inside process_close_request() **")
115117
document_path = parameters.text_document.document_uri().to_file_path()
116118
if document_path is None:
117119
raise json_rpc.InvalidRequestError(
@@ -126,7 +128,7 @@ async def process_close_request(
126128
async def process_did_save_request(
127129
self, parameters: lsp.DidSaveTextDocumentParameters
128130
) -> None:
129-
LOG.info("** Inside process_did_save_request() **")
131+
# LOG.info("** Inside process_did_save_request() **")
130132
document_path = parameters.text_document.document_uri().to_file_path()
131133
if document_path is None:
132134
raise json_rpc.InvalidRequestError(
@@ -148,7 +150,7 @@ async def run(self) -> int:
148150
)
149151
return await self.wait_for_exit()
150152
elif request.method == "textDocument/didOpen":
151-
LOG.info("** A Document just opened! **")
153+
# LOG.info("** A Document just opened! **")
152154
parameters = request.parameters
153155
if parameters is None:
154156
raise json_rpc.InvalidRequestError(
@@ -160,7 +162,7 @@ async def run(self) -> int:
160162
)
161163
)
162164
elif request.method == "textDocument/didClose":
163-
LOG.info("** A Document just closed! **")
165+
# LOG.info("** A Document just closed! **")
164166
parameters = request.parameters
165167
if parameters is None:
166168
raise json_rpc.InvalidRequestError(
@@ -172,7 +174,7 @@ async def run(self) -> int:
172174
)
173175
)
174176
elif request.method == "textDocument/didSave":
175-
LOG.info("** A Document just saved! **")
177+
# LOG.info("** A Document just saved! **")
176178
parameters = request.parameters
177179
if parameters is None:
178180
raise json_rpc.InvalidRequestError(
@@ -185,13 +187,12 @@ async def run(self) -> int:
185187
)
186188
elif request.id is not None:
187189
raise lsp.RequestCancelledError("Request not supported yet")
188-
else:
189-
LOG.info("** Hmmm I guess nothing seems to be happening **")
190190

191191

192192
async def run_persistent(
193193
binary_location: str, server_identifier: str, pysa_arguments: start.Arguments
194194
) -> int:
195+
global PYSA_HANDLER_OBJ
195196
stdin, stdout = await connection.create_async_stdin_stdout()
196197
while True:
197198
initialize_result = await try_initialize(stdin, stdout)

client/commands/v2/start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def get_server_identifier(configuration: configuration_module.Configuration) ->
513513

514514

515515
def _write_argument_file(output_file: IO[str], arguments: Arguments) -> None:
516-
LOG.info(f"Writing server startup configurations into {output_file.name}...")
516+
# LOG.info(f"Writing server startup configurations into {output_file.name}...")
517517
serialized_arguments = arguments.serialize()
518518
LOG.debug(f"Arguments:\n{json.dumps(serialized_arguments, indent=2)}")
519519
output_file.write(json.dumps(serialized_arguments))

0 commit comments

Comments
 (0)