[gnome-builder] libide/lsp: use IdeRunContext
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/lsp: use IdeRunContext
- Date: Tue, 6 Sep 2022 01:53:05 +0000 (UTC)
commit 1550fc4325533103e18f9f1cc16982342b60cb97
Author: Christian Hergert <chergert redhat com>
Date: Mon Sep 5 18:31:05 2022 -0700
libide/lsp: use IdeRunContext
This is less likely to get messed up compared to the create_launcher which
is meant for actually building items in the build pipeline.
src/libide/lsp/ide-lsp-service.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/lsp/ide-lsp-service.c b/src/libide/lsp/ide-lsp-service.c
index 4acaed6d3..62a083962 100644
--- a/src/libide/lsp/ide-lsp-service.c
+++ b/src/libide/lsp/ide-lsp-service.c
@@ -210,11 +210,16 @@ ide_lsp_service_real_create_launcher (IdeLspService *self,
/* First try in the build environment */
if (ide_pipeline_contains_program_in_path (pipeline, priv->program, NULL))
{
- if ((launcher = ide_pipeline_create_launcher (pipeline, NULL)))
+ g_autoptr(IdeRunContext) run_context = ide_run_context_new ();
+ IdeRuntime *runtime = ide_pipeline_get_runtime (pipeline);
+
+ ide_runtime_prepare_to_build (runtime, pipeline, run_context);
+ ide_run_context_append_argv (run_context, priv->program);
+ ide_run_context_set_cwd (run_context, srcdir);
+
+ if ((launcher = ide_run_context_end (run_context, NULL)))
{
ide_subprocess_launcher_set_flags (launcher, flags);
- ide_subprocess_launcher_push_argv (launcher, priv->program);
- ide_subprocess_launcher_set_cwd (launcher, srcdir);
IDE_RETURN (g_steal_pointer (&launcher));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]