Skip to content

Commit

Permalink
check against dev version
Browse files Browse the repository at this point in the history
quite a lot of people run on unreleased versions
  • Loading branch information
lukaszsamson committed Nov 2, 2023
1 parent 28f0ca5 commit c299b5d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/elixir_sense/core/introspection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ defmodule ElixirSense.Core.Introspection do
true

{:behaviour_info, {1, :function}} ->
if Version.match?(System.version(), ">= 1.15.0") do
if Version.match?(System.version(), ">= 1.15.0-dev") do
true
else
# elixir < 1.15 imports behaviour_info from erlang behaviours
Expand Down
2 changes: 1 addition & 1 deletion lib/elixir_sense/core/metadata_builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ defmodule ElixirSense.Core.MetadataBuilder do
# it's only legal inside typespecs
# credo:disable-for-next-line
if not Keyword.get(meta, :no_call, false) and
(Version.match?(System.version(), "< 1.15.0") or
(Version.match?(System.version(), "< 1.15.0-dev") or
match?([[{:typespec, _, _} | _] | _], state.scopes)) do
add_call_to_line(state, {nil, var_or_call, 0}, {line, column})
else
Expand Down
2 changes: 1 addition & 1 deletion lib/elixir_sense/core/normalized/code/cursor_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule ElixirSense.Core.Normalized.Code.CursorContext do
# credo:disable-for-lines:10
def cursor_context(binary, opts) do
cond do
Version.match?(System.version(), ">= 1.13.0") ->
Version.match?(System.version(), ">= 1.13.0-dev") ->
apply(Code.Fragment, :cursor_context, [binary, opts])

true ->
Expand Down
24 changes: 21 additions & 3 deletions lib/elixir_sense/providers/suggestion/complete.ex
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,28 @@ defmodule ElixirSense.Providers.Suggestion.Complete do
expand_erlang_modules(List.to_string(unquoted_atom), env, metadata)

{:dot, path, hint} ->
expand_dot(path, List.to_string(hint), false, env, metadata, cursor_position, only_structs, opts)
expand_dot(
path,
List.to_string(hint),
false,
env,
metadata,
cursor_position,
only_structs,
opts
)

{:dot_arity, path, hint} ->
expand_dot(path, List.to_string(hint), true, env, metadata, cursor_position, only_structs, opts)
expand_dot(
path,
List.to_string(hint),
true,
env,
metadata,
cursor_position,
only_structs,
opts
)

{:dot_call, _path, _hint} ->
# no need to expand signatures here, we have signatures provider
Expand Down Expand Up @@ -730,7 +748,7 @@ defmodule ElixirSense.Providers.Suggestion.Complete do
# Conversion to atom is not a problem because
# it is only called with existing modules names.
# credo:disable-for-lines:7
if Version.match?(System.version(), ">= 1.14.0") do
if Version.match?(System.version(), ">= 1.14.0-dev") do
apply(Macro, :classify_atom, [String.to_atom(name)]) in [:identifier, :unquoted] and
not String.starts_with?(name, "Elixir.")
else
Expand Down

0 comments on commit c299b5d

Please sign in to comment.