diff --git a/lsp/src/lsp-semtokens.c b/lsp/src/lsp-semtokens.c index a8b3b4ce9..c04f71603 100644 --- a/lsp/src/lsp-semtokens.c +++ b/lsp/src/lsp-semtokens.c @@ -65,6 +65,7 @@ static void cached_data_free(CachedData *data) g_array_free(data->tokens, TRUE); g_free(data->tokens_str); g_free(data->result_id); + g_free(data); } @@ -120,6 +121,7 @@ static SemanticTokensEdit *sem_tokens_edit_new(void) static void sem_tokens_edit_free(SemanticTokensEdit *edit) { g_array_free(edit->data, TRUE); + g_free(edit); } diff --git a/lsp/src/lsp-signature.c b/lsp/src/lsp-signature.c index 490d1ddc9..0146e573e 100644 --- a/lsp/src/lsp-signature.c +++ b/lsp/src/lsp-signature.c @@ -149,11 +149,11 @@ void lsp_signature_show_next(void) void lsp_signature_send_request(LspServer *server, GeanyDocument *doc, gboolean force) { GVariant *node; + gchar *doc_uri; LspSignatureData *data; ScintillaObject *sci = doc->editor->sci; gint pos = sci_get_current_position(sci); LspPosition lsp_pos = lsp_utils_scintilla_pos_to_lsp(sci, pos); - gchar *doc_uri = lsp_utils_get_doc_uri(doc); gchar c = pos > 0 ? sci_get_char_at(sci, SSM(sci, SCI_POSITIONBEFORE, pos, 0)) : '\0'; gint lexer = sci_get_lexer(sci); gint style = sci_get_style_at(sci, pos); @@ -169,6 +169,8 @@ void lsp_signature_send_request(LspServer *server, GeanyDocument *doc, gboolean return; } + doc_uri = lsp_utils_get_doc_uri(doc); + node = JSONRPC_MESSAGE_NEW ( "textDocument", "{", "uri", JSONRPC_MESSAGE_PUT_STRING(doc_uri),