diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-10-05 00:23:22 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2025-10-05 00:23:22 +0200 |
| commit | 3771a25f9ea4de11b1eb4a1545a314c04df99ad0 (patch) | |
| tree | 6a71c2086ca6d71b48b74870dab7c857819075b6 | |
| parent | 777e0e703c0560e52988669453a035105f16bf66 (diff) | |
Use defer to handle the case when document_open fails.remove-unused-imports
| -rw-r--r-- | src/server/requests.odin | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin index c84bd65..afee807 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -1036,6 +1036,8 @@ notification_did_open :: proc( return .ParseError } + defer delete(open_params.textDocument.uri) + if n := document_open(open_params.textDocument.uri, open_params.textDocument.text, config, writer); n != .None { return .InternalError } @@ -1046,8 +1048,6 @@ notification_did_open :: proc( push_diagnostics(writer) - delete(open_params.textDocument.uri) - return .None } |