Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/matrix.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"include": [
{
"otp": "28",
"elixir": "1.19",
"project": "engine"
},
{
"otp": "28",
"elixir": "1.18.4",
Expand Down Expand Up @@ -30,6 +35,11 @@
"elixir": "1.16",
"project": "engine"
},
{
"otp": "28",
"elixir": "1.19",
"project": "expert_credo"
},
{
"otp": "28",
"elixir": "1.18.4",
Expand Down Expand Up @@ -60,6 +70,11 @@
"elixir": "1.16",
"project": "expert_credo"
},
{
"otp": "28",
"elixir": "1.19",
"project": "forge"
},
{
"otp": "28",
"elixir": "1.18.4",
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/lib/engine/build/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule Engine.Build.State do
compile_file(state, document)
end)

%__MODULE__{new_state | uri_to_document: %{}, project_compile: :none}
%{new_state | uri_to_document: %{}, project_compile: :none}
end

def on_file_compile(%__MODULE__{} = state, %Document{} = document) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ defmodule Engine.CodeAction.Handlers.RemoveUnusedAlias do

defp include_next_line(%Range{} = range) do
update_in(range.end, fn old_position ->
%Position{
%{
old_position
| line: old_position.line + 1,
character: 1
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/lib/engine/code_intelligence/symbols.ex
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ defmodule Engine.CodeIntelligence.Symbols do
children =
Enum.map(defs, fn child ->
[_, rest] = String.split(child.name, " ", parts: 2)
%Symbols.Document{child | name: rest}
%{child | name: rest}
end)

range = Range.new(first.range.start, last.range.end)
%Symbols.Document{first | name: name, range: range, children: children}
%{first | name: name, range: range, children: children}
end)

grouped_functions
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/lib/engine/code_mod/aliases.ex
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ defmodule Engine.CodeMod.Aliases do
%Position{position | character: character}

position.line > scope_range.end.line ->
%Position{scope_range.end | character: 1}
%{scope_range.end | character: 1}

true ->
position
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/test/engine/build/error_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ defmodule Engine.Build.ErrorTest do

# used a regex here because the error changed in elixir 1.18
assert diagnostic.message =~
~r[protocol Enumerable not implemented for( 1 of)? type Integer]
~r[protocol Enumerable not implemented for( 1 of)?( type)? Integer]

assert decorate(document_text, diagnostic.position) =~ "«for i <- 1, do: i\n»"
end
Expand All @@ -468,7 +468,7 @@ defmodule Engine.Build.ErrorTest do

# used a regex here because the error changed in elixir 1.18
assert diagnostic.message =~
~r[protocol Enumerable not implemented for( 1 of)? type Integer]
~r[protocol Enumerable not implemented for( 1 of)?( type)? Integer]

assert decorate(document_text, diagnostic.position) =~ "«for i <- 1, do: i\n»"
end
Expand Down
4 changes: 2 additions & 2 deletions apps/expert/lib/expert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ defmodule Expert do
def handle_info(:engine_initialized, lsp) do
state = assigns(lsp).state

new_state = %State{state | engine_initialized?: true}
new_state = %{state | engine_initialized?: true}

lsp = assign(lsp, state: new_state)

Expand All @@ -195,7 +195,7 @@ defmodule Expert do
)

{:ok, config} = State.default_configuration(state)
{:noreply, assign(lsp, state: %State{state | configuration: config})}
{:noreply, assign(lsp, state: %{state | configuration: config})}
else
{:noreply, lsp}
end
Expand Down
2 changes: 1 addition & 1 deletion apps/expert/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ defmodule Expert.MixProject do

defp deps do
[
{:burrito, "~> 1.5", only: [:dev, :prod]},
{:burrito, "~> 1.5"},
{:deps_nix, "~> 2.4", only: :dev},
Mix.Credo.dependency(),
Mix.Dialyzer.dependency(),
Expand Down
2 changes: 0 additions & 2 deletions apps/forge/lib/forge/document/position.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ end
defimpl Inspect, for: Forge.Document.Position do
import Inspect.Algebra

def inspect(nil, _), do: "nil"

def inspect(pos, _) do
concat(["XpPos", to_string(pos)])
end
Expand Down
12 changes: 11 additions & 1 deletion apps/forge/lib/future/code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ defmodule Future.Code do
case :code.ensure_loaded(module) do
{:error, :nofile} = error ->
if can_await_module_compilation?() do
case Kernel.ErrorHandler.ensure_compiled(module, :module, mode) do
case do_ensure_compiled(module, :module, mode, nil) do
:found -> {:module, module}
:deadlock -> {:error, :unavailable}
:not_found -> {:error, :nofile}
Expand All @@ -1908,6 +1908,16 @@ defmodule Future.Code do
end
end

if Version.match?(System.version(), ">= 1.19.0") do
defp do_ensure_compiled(module, kind, deadlock, position) do
Kernel.ErrorHandler.ensure_compiled(module, kind, deadlock, position)
end
else
defp do_ensure_compiled(module, kind, deadlock, _position) do
Kernel.ErrorHandler.ensure_compiled(module, kind, deadlock)
end
end

@doc """
Returns `true` if the module is loaded.

Expand Down
2 changes: 1 addition & 1 deletion apps/forge/test/forge/ast_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ defmodule Forge.AstTest do
end

test "within the node", %{ast: ast, range: range} do
position = %Position{range.start | character: range.start.character + 1}
position = %{range.start | character: range.start.character + 1}
assert Ast.contains_position?(ast, position)
end

Expand Down
1 change: 1 addition & 0 deletions matrix.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Mix.install([:jason])

versions = [
%{elixir: "1.19", otp: "28"},
%{elixir: "1.18.4", otp: "28"},
%{elixir: "1.18", otp: "27"},
%{elixir: "1.18", otp: "26"},
Expand Down
Loading