Commit afc033b5 authored by Christian Hergert's avatar Christian Hergert
Browse files

lsp: add deprecated flag for LSP symbol node

parent 9617cbbd
......@@ -31,12 +31,13 @@ struct _IdeLspSymbolNode
};
IdeLspSymbolNode *ide_lsp_symbol_node_new (GFile *file,
const gchar *name,
const gchar *parent_name,
gint kind,
guint begin_line,
guint begin_column,
guint end_line,
guint end_column);
const gchar *name,
const gchar *parent_name,
gint kind,
guint begin_line,
guint begin_column,
guint end_line,
guint end_column,
gboolean deprecated);
G_END_DECLS
......@@ -131,23 +131,28 @@ ide_lsp_symbol_node_init (IdeLspSymbolNode *self)
IdeLspSymbolNode *
ide_lsp_symbol_node_new (GFile *file,
const gchar *name,
const gchar *parent_name,
gint kind,
guint begin_line,
guint begin_column,
guint end_line,
guint end_column)
const gchar *name,
const gchar *parent_name,
gint kind,
guint begin_line,
guint begin_column,
guint end_line,
guint end_column,
gboolean deprecated)
{
IdeLspSymbolNode *self;
IdeLspSymbolNodePrivate *priv;
IdeSymbolFlags flags = 0;
g_return_val_if_fail (G_IS_FILE (file), NULL);
kind = ide_lsp_decode_symbol_kind (kind);
if (deprecated)
flags |= IDE_SYMBOL_FLAGS_IS_DEPRECATED;
self = g_object_new (IDE_TYPE_LSP_SYMBOL_NODE,
"flags", 0,
"flags", flags,
"kind", kind,
"name", name,
NULL);
......
......@@ -380,6 +380,7 @@ ide_lsp_symbol_resolver_document_symbol_cb (GObject *object,
g_autoptr(IdeLspSymbolNode) symbol = NULL;
const gchar *name = NULL;
const gchar *container_name = NULL;
gboolean deprecated = FALSE;
gboolean success;
gint64 kind = -1;
struct {
......@@ -411,10 +412,11 @@ ide_lsp_symbol_resolver_document_symbol_cb (GObject *object,
/* Optional fields */
JSONRPC_MESSAGE_PARSE (node, "containerName", JSONRPC_MESSAGE_GET_STRING (&container_name));
JSONRPC_MESSAGE_PARSE (node, "deprecated", JSONRPC_MESSAGE_GET_BOOLEAN (&deprecated));
symbol = ide_lsp_symbol_node_new (file, name, container_name, kind,
begin.line, begin.column,
end.line, end.column);
end.line, end.column, deprecated);
g_ptr_array_add (symbols, g_steal_pointer (&symbol));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment