From 15471894d40d41f3af01e5f066dd5c73cb9bffc5 Mon Sep 17 00:00:00 2001 From: Myzel394 Date: Sun, 16 Mar 2025 00:25:05 +0100 Subject: [PATCH] fix: Fix --- server/common/diagnostics.go | 5 +- server/fetch_tags.js | 27 +++++++ .../gitconfig/fields/nested-option.go | 78 +++++++++++++++++++ .../lsp/text-document-did-change.go | 63 +++++++-------- 4 files changed, 137 insertions(+), 36 deletions(-) create mode 100644 server/fetch_tags.js create mode 100644 server/handlers/gitconfig/fields/nested-option.go diff --git a/server/common/diagnostics.go b/server/common/diagnostics.go index fbd5fdb..5ebd92d 100644 --- a/server/common/diagnostics.go +++ b/server/common/diagnostics.go @@ -6,7 +6,10 @@ import ( ) func ClearDiagnostics(context *glsp.Context, uri protocol.DocumentUri) { - go context.Notify( + // Diagnostics are sent synchronously, as sending them async + // could result in a race condition when we send diagnostics + // to the client. + context.Notify( protocol.ServerTextDocumentPublishDiagnostics, protocol.PublishDiagnosticsParams{ URI: uri, diff --git a/server/fetch_tags.js b/server/fetch_tags.js new file mode 100644 index 0000000..fa11764 --- /dev/null +++ b/server/fetch_tags.js @@ -0,0 +1,27 @@ +// Creates a JSON object in the form of: +// { +// [