From d2eb6f358544abe1df87c9355ba259c7db4bbd98 Mon Sep 17 00:00:00 2001 From: Lukasz Samson Date: Tue, 24 Oct 2023 22:41:00 +0200 Subject: [PATCH] fix false positives in feature reporting --- apps/elixir_ls_debugger/lib/debugger/server.ex | 9 +++++---- apps/language_server/lib/language_server/server.ex | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/elixir_ls_debugger/lib/debugger/server.ex b/apps/elixir_ls_debugger/lib/debugger/server.ex index a430a81c0..40023ac05 100644 --- a/apps/elixir_ls_debugger/lib/debugger/server.ex +++ b/apps/elixir_ls_debugger/lib/debugger/server.ex @@ -728,11 +728,12 @@ defmodule ElixirLS.Debugger.Server do to_string(Map.get(config, "exitAfterTaskReturns", true)), "elixir_ls.noDebug" => to_string(Map.get(config, "noDebug", false)), "elixir_ls.breakOnDbg" => to_string(Map.get(config, "breakOnDbg", true)), - "elixir_ls.env" => to_string(Map.has_key?(config, "env")), - "elixir_ls.requireFiles" => to_string(Map.has_key?(config, "requireFiles")), + "elixir_ls.env" => to_string(Map.get(config, "env", %{}) != %{}), + "elixir_ls.requireFiles" => to_string(Map.get(config, "requireFiles", []) != []), "elixir_ls.debugInterpretModulesPatterns" => - to_string(Map.has_key?(config, "debugInterpretModulesPatterns")), - "elixir_ls.excludeModules" => to_string(Map.has_key?(config, "excludeModules")), + to_string(Map.get(config, "debugInterpretModulesPatterns", []) != []), + "elixir_ls.excludeModules" => + to_string(Map.get(config, "excludeModules", []) != []), "elixir_ls.task" => to_string(Map.get(config, "task", ":default_task")) }, %{} diff --git a/apps/language_server/lib/language_server/server.ex b/apps/language_server/lib/language_server/server.ex index 6a4e4767c..a7be18a99 100644 --- a/apps/language_server/lib/language_server/server.ex +++ b/apps/language_server/lib/language_server/server.ex @@ -1470,7 +1470,7 @@ defmodule ElixirLS.LanguageServer.Server do JsonRpc.telemetry( "lsp_config", %{ - "elixir_ls.projectDir" => to_string(Map.has_key?(settings, "projectDir")), + "elixir_ls.projectDir" => to_string(Map.get(settings, "projectDir", "") != ""), "elixir_ls.autoBuild" => to_string(Map.get(settings, "autoBuild", true)), "elixir_ls.dialyzerEnabled" => to_string(Map.get(settings, "dialyzerEnabled", true)), "elixir_ls.fetchDeps" => to_string(Map.get(settings, "fetchDeps", false)), @@ -1481,8 +1481,8 @@ defmodule ElixirLS.LanguageServer.Server do to_string(Map.get(settings, "signatureAfterComplete", true)), "elixir_ls.enableTestLenses" => to_string(Map.get(settings, "enableTestLenses", false)), "elixir_ls.languageServerOverridePath" => - to_string(Map.has_key?(settings, "languageServerOverridePath")), - "elixir_ls.envVariables" => to_string(Map.has_key?(settings, "envVariables")), + to_string(Map.get(settings, "languageServerOverridePath", "") != ""), + "elixir_ls.envVariables" => to_string(Map.get(settings, "envVariables", %{}) != %{}), "elixir_ls.mixEnv" => to_string(Map.get(settings, "mixEnv", "test")), "elixir_ls.mixTarget" => to_string(Map.get(settings, "mixTarget", "host")), "elixir_ls.dialyzerFormat" =>