From 3d4664a8a47a5268ea4e860cb12a2b914e4316df Mon Sep 17 00:00:00 2001 From: Lukasz Samson Date: Sat, 10 Aug 2024 10:07:17 +0200 Subject: [PATCH] wip env --- lib/elixir_sense/core/metadata.ex | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/elixir_sense/core/metadata.ex b/lib/elixir_sense/core/metadata.ex index b3f44b6b..9cdfaf3a 100644 --- a/lib/elixir_sense/core/metadata.ex +++ b/lib/elixir_sense/core/metadata.ex @@ -61,6 +61,7 @@ defmodule ElixirSense.Core.Metadata do def get_cursor_env( %__MODULE__{} = metadata, + {line, column}, {{begin_line, begin_column}, {end_line, end_column}} ) do prefix = ElixirSense.Core.Source.text_before(metadata.source, begin_line, begin_column) @@ -70,8 +71,8 @@ defmodule ElixirSense.Core.Metadata do {meta, cursor_env} = case Code.string_to_quoted(source_with_cursor, columns: true, token_metadata: true) do - {:ok, ast} -> - ElixirSense.Core.MetadataBuilder.build(ast).cursor_env || {[], nil} + # {:ok, ast} -> + # ElixirSense.Core.MetadataBuilder.build(ast).cursor_env || {[], nil} _ -> {[], nil} @@ -85,8 +86,8 @@ defmodule ElixirSense.Core.Metadata do columns: true, token_metadata: true ) do - {:ok, ast} -> - ElixirSense.Core.MetadataBuilder.build(ast).cursor_env || {[], nil} + # {:ok, ast} -> + # ElixirSense.Core.MetadataBuilder.build(ast).cursor_env || {[], nil} _ -> {[], nil} @@ -96,7 +97,7 @@ defmodule ElixirSense.Core.Metadata do if cursor_env != nil do cursor_env else - get_env(metadata, {begin_line, begin_column}) + get_env(metadata, {line, column}) end end