Commit 80a36415 authored by Christian Hergert's avatar Christian Hergert
Browse files

file: use ide_file_new instead of g_object_new

This gives us the opportunity to use a cached file instance instead of
always creating a new one.
parent 3022d497
......@@ -437,10 +437,7 @@ ide_diagnostics_group_diagnose_foreach (IdeExtensionSetAdapter *adapter,
context = ide_object_get_context (IDE_OBJECT (self));
file = g_object_new (IDE_TYPE_FILE,
"context", context,
"file", group->file,
file = ide_file_new (context, group->file);
......@@ -416,10 +416,7 @@ ide_editor_workbench_addin_open_async (IdeWorkbenchAddin *addin,
ifile = g_object_new (IDE_TYPE_FILE,
"context", context,
"file", gfile,
ifile = ide_file_new (context, gfile);
ide_buffer_manager_load_file_async (buffer_manager,
......@@ -587,12 +587,12 @@ ide_langserv_client_text_document_publish_diagnostics (IdeLangservClient *self,
g_autoptr(IdeFile) ifile = NULL;
g_autoptr(GFile) file = NULL;
g_autoptr(IdeDiagnostics) diagnostics = NULL;
IdeContext *context;
context = ide_object_get_context (IDE_OBJECT (self));
file = g_file_new_for_uri (uri);
ifile = g_object_new (IDE_TYPE_FILE,
"file", file,
"context", ide_object_get_context (IDE_OBJECT (self)),
ifile = ide_file_new (context, file);
diagnostics = ide_langserv_client_translate_diagnostics (self, ifile, json_diagnostics);
IDE_TRACE_MSG ("%"G_GSIZE_FORMAT" diagnostics received for %s",
Markdown is supported
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