From f258034d5b248df97c0799616777e22113310868 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Wed, 3 Sep 2025 00:06:26 +0800 Subject: [PATCH] docs: fix typos Found via `typos --hidden --format brief` --- apps/engine/lib/engine/analyzer.ex | 2 +- apps/engine/lib/engine/api/proxy.ex | 4 +-- apps/engine/lib/engine/bootstrap.ex | 2 +- apps/engine/lib/engine/build/project.ex | 2 +- apps/engine/lib/engine/search/fuzzy/scorer.ex | 4 +-- apps/engine/lib/engine/search/indexer.ex | 4 +-- .../search/indexer/extractors/module.ex | 6 ++-- .../engine/search/store/backends/ets/wal.ex | 4 +-- .../test/engine/analyzer/imports_test.exs | 2 +- apps/engine/test/engine/analyzer_test.exs | 2 +- apps/engine/test/engine/api/proxy_test.exs | 2 +- .../build/document/compilers/eex_test.exs | 6 ++-- .../build/document/compilers/elixir_test.exs | 2 +- .../build/document/compilers/heex_test.exs | 4 +-- apps/engine/test/engine/build/error_test.exs | 8 +++--- .../handlers/organize_aliases_test.exs | 2 +- .../engine/code_intelligence/entity_test.exs | 2 +- .../indexer/extractors/ecto_schema_test.exs | 28 +++++++++---------- .../extractors/function_definition_test.exs | 6 ++-- .../indexer/extractors/variable_test.exs | 2 +- .../completion/sort_scope.ex | 2 +- .../expert/lib/expert/project/intelligence.ex | 2 +- apps/expert/lib/expert/project/node.ex | 2 +- .../completion/translations/macro_test.exs | 8 +++--- .../test/expert/project/diagnostics_test.exs | 4 +-- apps/expert/test/forge/document_test.exs | 2 +- apps/forge/lib/forge/ast.ex | 2 +- apps/forge/lib/forge/document.ex | 4 +-- apps/forge/lib/forge/project.ex | 6 ++-- .../code/{indentifier.ex => identifier.ex} | 0 apps/forge/lib/mix/tasks/namespace.ex | 2 +- apps/forge/src/future_elixir_tokenizer.erl | 2 +- 32 files changed, 65 insertions(+), 65 deletions(-) rename apps/forge/lib/future/code/{indentifier.ex => identifier.ex} (100%) diff --git a/apps/engine/lib/engine/analyzer.ex b/apps/engine/lib/engine/analyzer.ex index 2f678bac..3097e5fa 100644 --- a/apps/engine/lib/engine/analyzer.ex +++ b/apps/engine/lib/engine/analyzer.ex @@ -205,7 +205,7 @@ defmodule Engine.Analyzer do # Trailing aliases happen when you use the curly syntax to define multiple aliases # in one go, like Foo.{First, Second.Third, Fourth} # Our alias mapping will have Third mapped to Foo.Second.Third, so we need to look - # for Third, wheras the leading alias will look for Second in the mappings. + # for Third, whereas the leading alias will look for Second in the mappings. with {:ok, resolved} <- Map.fetch(aliases_mapping, List.last(segments)) do {:ok, List.wrap(resolved)} end diff --git a/apps/engine/lib/engine/api/proxy.ex b/apps/engine/lib/engine/api/proxy.ex index ebd6c791..61dba9c1 100644 --- a/apps/engine/lib/engine/api/proxy.ex +++ b/apps/engine/lib/engine/api/proxy.ex @@ -23,8 +23,8 @@ defmodule Engine.Api.Proxy do Internally, there are three states: proxying, draining and buffering. The proxy starts in proxying mode. Then, when start_buffering is called, it changes to draining mode. This - mode checks if there are any in-flight calls. If there aren't any, it changes immediately to buffring mode. - If there are in-flight reqeusts, it waits for them to finish, and then switches to buffer mode. Once in buffer + mode checks if there are any in-flight calls. If there aren't any, it changes immediately to buffering mode. + If there are in-flight requests, it waits for them to finish, and then switches to buffer mode. Once in buffer mode, requests are buffered until the process that called `start_buffering` exits. When that happens, then the requests are de-duplicated and run, and then the proxy returns to proxying mode. diff --git a/apps/engine/lib/engine/bootstrap.ex b/apps/engine/lib/engine/bootstrap.ex index 06a685a8..89dbe3c4 100644 --- a/apps/engine/lib/engine/bootstrap.ex +++ b/apps/engine/lib/engine/bootstrap.ex @@ -75,7 +75,7 @@ defmodule Engine.Bootstrap do # Note about the following code: # I tried a bunch of stuff to get it to work, like checking if the - # app is an umbrella (umbrealla? returns false when started in a subapp) + # app is an umbrella (umbrella? returns false when started in a subapp) # to no avail. This was the only thing that consistently worked {:ok, configured_root} = Engine.Mix.in_project(project, fn _ -> diff --git a/apps/engine/lib/engine/build/project.ex b/apps/engine/lib/engine/build/project.ex index 3480b9f9..bf8d8eae 100644 --- a/apps/engine/lib/engine/build/project.ex +++ b/apps/engine/lib/engine/build/project.ex @@ -104,7 +104,7 @@ defmodule Engine.Build.Project do defp connected_to_internet? do # While there's no perfect way to check if a computer is connected to the internet, - # it seems reasonable to gate pulling dependenices on a resolution check for hex.pm. + # it seems reasonable to gate pulling dependencies on a resolution check for hex.pm. # Yes, it's entirely possible that the DNS server is local, and that the entry is in cache, # but that's an edge case, and the build will just time out anyways. case :inet_res.getbyname(~c"hex.pm", :a, 250) do diff --git a/apps/engine/lib/engine/search/fuzzy/scorer.ex b/apps/engine/lib/engine/search/fuzzy/scorer.ex index f5e31486..9dc3f47d 100644 --- a/apps/engine/lib/engine/search/fuzzy/scorer.ex +++ b/apps/engine/lib/engine/search/fuzzy/scorer.ex @@ -230,7 +230,7 @@ defmodule Engine.Search.Fuzzy.Scorer do {streak_length, @consecutive_character_bonus * streak_length} end - @mismatched_chracter_penalty 5 + @mismatched_character_penalty 5 def mismatched_penalty(matched_positions) do {penalty, _} = @@ -244,7 +244,7 @@ defmodule Engine.Search.Fuzzy.Scorer do matched_position, {penalty, last_match} -> distance = matched_position - last_match - {penalty + distance * @mismatched_chracter_penalty, matched_position} + {penalty + distance * @mismatched_character_penalty, matched_position} end) penalty diff --git a/apps/engine/lib/engine/search/indexer.ex b/apps/engine/lib/engine/search/indexer.ex index 783220ce..740b1e75 100644 --- a/apps/engine/lib/engine/search/indexer.ex +++ b/apps/engine/lib/engine/search/indexer.ex @@ -101,7 +101,7 @@ defmodule Engine.Search.Indexer do total_bytes = paths_to_sizes |> Enum.map(&elem(&1, 1)) |> Enum.sum() if total_bytes > 0 do - {on_update_progess, on_complete} = + {on_update_progress, on_complete} = Progress.begin_percent("Indexing source code", total_bytes) initial_state = {0, []} @@ -131,7 +131,7 @@ defmodule Engine.Search.Indexer do fn chunk -> block_bytes = chunk |> Enum.map(&Map.get(path_to_size_map, &1)) |> Enum.sum() result = Enum.map(chunk, processor) - on_update_progess.(block_bytes, "Indexing") + on_update_progress.(block_bytes, "Indexing") result end, timeout: timeout diff --git a/apps/engine/lib/engine/search/indexer/extractors/module.ex b/apps/engine/lib/engine/search/indexer/extractors/module.ex index 32878336..9849fa6a 100644 --- a/apps/engine/lib/engine/search/indexer/extractors/module.ex +++ b/apps/engine/lib/engine/search/indexer/extractors/module.ex @@ -278,14 +278,14 @@ defmodule Engine.Search.Indexer.Extractors.Module do defp module(_, _), do: :error - @protocol_module_attribue_names [:protocol, :for] + @protocol_module_attribute_names [:protocol, :for] @starts_with_capital ~r/[A-Z]+/ defp module_part?(part) when is_atom(part) do Regex.match?(@starts_with_capital, Atom.to_string(part)) end - defp module_part?({:@, _, [{type, _, _} | _]}) when type in @protocol_module_attribue_names, + defp module_part?({:@, _, [{type, _, _} | _]}) when type in @protocol_module_attribute_names, do: true defp module_part?({:__MODULE__, _, context}) when is_atom(context), do: true @@ -306,7 +306,7 @@ defmodule Engine.Search.Indexer.Extractors.Module do # handles @protocol and @for in defimpl blocks defp to_range(%Reducer{} = reducer, [{:@, _, [{type, _, _} | _]} = attribute | segments], _) - when type in @protocol_module_attribue_names do + when type in @protocol_module_attribute_names do range = Sourceror.get_range(attribute) document = reducer.analysis.document diff --git a/apps/engine/lib/engine/search/store/backends/ets/wal.ex b/apps/engine/lib/engine/search/store/backends/ets/wal.ex index 401e6f5a..6003a3a8 100644 --- a/apps/engine/lib/engine/search/store/backends/ets/wal.ex +++ b/apps/engine/lib/engine/search/store/backends/ets/wal.ex @@ -84,8 +84,8 @@ defmodule Engine.Search.Store.Backends.Ets.Wal do exists?(wal.project, wal.schema_version) end - def exists?(%Project{} = project, schema_vesion) do - case File.ls(wal_directory(project, schema_vesion)) do + def exists?(%Project{} = project, schema_version) do + case File.ls(wal_directory(project, schema_version)) do {:ok, [_]} -> true {:ok, [_ | _]} -> true _ -> false diff --git a/apps/engine/test/engine/analyzer/imports_test.exs b/apps/engine/test/engine/analyzer/imports_test.exs index e61548ed..65ef3424 100644 --- a/apps/engine/test/engine/analyzer/imports_test.exs +++ b/apps/engine/test/engine/analyzer/imports_test.exs @@ -98,7 +98,7 @@ defmodule Engine.Ast.Analysis.ImportsTest do assert_imported(imports, ImportedModule) end - test "single underscore functions aren't imported by defualt" do + test "single underscore functions aren't imported by default" do imports = ~q[ import Parent.Child.ImportedModule diff --git a/apps/engine/test/engine/analyzer_test.exs b/apps/engine/test/engine/analyzer_test.exs index aea7decf..5fca7115 100644 --- a/apps/engine/test/engine/analyzer_test.exs +++ b/apps/engine/test/engine/analyzer_test.exs @@ -33,7 +33,7 @@ defmodule Engine.AnalyzerTest do assert :error = Analyzer.current_module(analysis, position) end - test "reutrns the current module right after the do" do + test "returns the current module right after the do" do {position, document} = ~q[ defmodule Outer do| diff --git a/apps/engine/test/engine/api/proxy_test.exs b/apps/engine/test/engine/api/proxy_test.exs index a1e9b548..fcf92d04 100644 --- a/apps/engine/test/engine/api/proxy_test.exs +++ b/apps/engine/test/engine/api/proxy_test.exs @@ -150,7 +150,7 @@ defmodule Engine.Api.ProxyTest do assert {:error, {:already_buffering, _}} = Proxy.start_buffering() end - test "proxies boradcasts of progress messages" do + test "proxies broadcasts of progress messages" do patch(Dispatch, :broadcast, :ok) assert :ok = Proxy.broadcast(percent_progress()) diff --git a/apps/engine/test/engine/build/document/compilers/eex_test.exs b/apps/engine/test/engine/build/document/compilers/eex_test.exs index cc8b6dfa..0606da90 100644 --- a/apps/engine/test/engine/build/document/compilers/eex_test.exs +++ b/apps/engine/test/engine/build/document/compilers/eex_test.exs @@ -124,7 +124,7 @@ defmodule Engine.Build.Document.Compilers.EExTest do end describe "eval_quoted/2" do - test "handles undefinied function" do + test "handles undefined function" do document = document_with_content(~q[ <%= IO.uts("thing") %> ]) @@ -139,7 +139,7 @@ defmodule Engine.Build.Document.Compilers.EExTest do @feature_condition span_in_diagnostic?: false @tag execute_if(@feature_condition) - test "handles undefinied variable" do + test "handles undefined variable" do document = document_with_content(~q[ <%= thing %> ]) @@ -160,7 +160,7 @@ defmodule Engine.Build.Document.Compilers.EExTest do @feature_condition span_in_diagnostic?: true @tag execute_if(@feature_condition) - test "handles undefinied variable when #{inspect(@feature_condition)}" do + test "handles undefined variable when #{inspect(@feature_condition)}" do document = document_with_content(~q[ <%= thing %> ]) diff --git a/apps/engine/test/engine/build/document/compilers/elixir_test.exs b/apps/engine/test/engine/build/document/compilers/elixir_test.exs index 2192ad5c..7ee6b03d 100644 --- a/apps/engine/test/engine/build/document/compilers/elixir_test.exs +++ b/apps/engine/test/engine/build/document/compilers/elixir_test.exs @@ -26,7 +26,7 @@ defmodule Engine.Build.Document.Compilers.ElixirTest do refute recognizes?(document_with_extension(".js")) end - test "it doen't recognize .eex documents" do + test "it doesn't recognize .eex documents" do refute recognizes?(document_with_extension(".eex")) refute recognizes?(document_with_extension(".html.eex")) end diff --git a/apps/engine/test/engine/build/document/compilers/heex_test.exs b/apps/engine/test/engine/build/document/compilers/heex_test.exs index d5f3907b..19a5f76b 100644 --- a/apps/engine/test/engine/build/document/compilers/heex_test.exs +++ b/apps/engine/test/engine/build/document/compilers/heex_test.exs @@ -47,7 +47,7 @@ defmodule Engine.Build.Document.Compilers.HeexTest do assert {:ok, _} = compile(document) end - test "ignore undefinied assigns" do + test "ignore undefined assigns" do document = document_with_content(~q[
<%= @thing %>
]) @@ -55,7 +55,7 @@ defmodule Engine.Build.Document.Compilers.HeexTest do assert {:error, []} = compile(document) end - test "handles undefinied variables" do + test "handles undefined variables" do document = document_with_content(~q[
<%= thing %>
]) diff --git a/apps/engine/test/engine/build/error_test.exs b/apps/engine/test/engine/build/error_test.exs index 78fd77a2..5dfad106 100644 --- a/apps/engine/test/engine/build/error_test.exs +++ b/apps/engine/test/engine/build/error_test.exs @@ -106,7 +106,7 @@ defmodule Engine.Build.ErrorTest do @feature_condition span_in_diagnostic?: false @tag execute_if(@feature_condition) - test "handles unsued variable warning" do + test "handles unused variable warning" do document_text = ~S[ defmodule Foo do def bar do @@ -126,7 +126,7 @@ defmodule Engine.Build.ErrorTest do @feature_condition span_in_diagnostic?: true @tag execute_if(@feature_condition) - test "handles unsued variable warning when #{inspect(@feature_condition)}" do + test "handles unused variable warning when #{inspect(@feature_condition)}" do document_text = ~S[ defmodule Foo do def bar do @@ -208,7 +208,7 @@ defmodule Engine.Build.ErrorTest do "«def add(a, b) when is_integer(a) and is_integer(b) do\n»" end - test "handles UndefinedError for erlang moudle" do + test "handles UndefinedError for erlang module" do document_text = ~S[ defmodule Foo do :slave.stop @@ -341,7 +341,7 @@ defmodule Engine.Build.ErrorTest do end end - test "handles UndefinedError without moudle" do + test "handles UndefinedError without module" do document_text = ~S[ IO.ins diff --git a/apps/engine/test/engine/code_action/handlers/organize_aliases_test.exs b/apps/engine/test/engine/code_action/handlers/organize_aliases_test.exs index 3ad96f7c..a918e21a 100644 --- a/apps/engine/test/engine/code_action/handlers/organize_aliases_test.exs +++ b/apps/engine/test/engine/code_action/handlers/organize_aliases_test.exs @@ -152,7 +152,7 @@ defmodule Engine.CodeAction.Handlers.OrganizeAliasesTest do assert expected == organized end - test "dependent aliase are honored" do + test "dependent aliases are honored" do {:ok, organized} = ~q[ defmodule Deps do diff --git a/apps/engine/test/engine/code_intelligence/entity_test.exs b/apps/engine/test/engine/code_intelligence/entity_test.exs index ea216b66..5a71183c 100644 --- a/apps/engine/test/engine/code_intelligence/entity_test.exs +++ b/apps/engine/test/engine/code_intelligence/entity_test.exs @@ -38,7 +38,7 @@ defmodule Engine.CodeIntelligence.EntityTest do assert {:error, :not_found} = resolve(code) end - test "fails immediately preceeding the module" do + test "fails immediately preceding the module" do code = ~q[ | Before.The.Beginning ] diff --git a/apps/engine/test/engine/search/indexer/extractors/ecto_schema_test.exs b/apps/engine/test/engine/search/indexer/extractors/ecto_schema_test.exs index f2b1f02f..f6b1ea23 100644 --- a/apps/engine/test/engine/search/indexer/extractors/ecto_schema_test.exs +++ b/apps/engine/test/engine/search/indexer/extractors/ecto_schema_test.exs @@ -64,7 +64,7 @@ defmodule Engine.Search.Indexer.Extractors.EctoSchemaTest do assert extract(doc, struct.block_range) =~ expected end - test "consisting of multiple fileds" do + test "consisting of multiple fields" do {:ok, [struct], doc} = ~q[ defmodule MySchema do @@ -138,7 +138,7 @@ defmodule Engine.Search.Indexer.Extractors.EctoSchemaTest do assert extract(doc, struct.block_range) =~ expected end - test "consisting of multiple fileds" do + test "consisting of multiple fields" do {:ok, [struct], doc} = ~q[ defmodule MySchema do @@ -185,7 +185,7 @@ defmodule Engine.Search.Indexer.Extractors.EctoSchemaTest do end test "when defined inline" do - {:ok, [_struct_def, schema_definiton], doc} = + {:ok, [_struct_def, schema_definition], doc} = ~q[ defmodule MySchema do use Ecto.Schema @@ -198,17 +198,17 @@ defmodule Engine.Search.Indexer.Extractors.EctoSchemaTest do ] |> index() - assert schema_definiton.type == :struct - assert schema_definiton.subtype == :definition - assert schema_definiton.subject == MySchema.Child + assert schema_definition.type == :struct + assert schema_definition.subtype == :definition + assert schema_definition.subject == MySchema.Child expected = ~q[ embeds_one :child, Child do field :first_name, :string end ]t - assert decorate(doc, schema_definiton.range) =~ ~q[embeds_one :child, «Child» do] - assert extract(doc, schema_definiton.block_range) =~ expected + assert decorate(doc, schema_definition.range) =~ ~q[embeds_one :child, «Child» do] + assert extract(doc, schema_definition.block_range) =~ expected end end @@ -229,7 +229,7 @@ defmodule Engine.Search.Indexer.Extractors.EctoSchemaTest do end test "when defined inline" do - {:ok, [_struct_def, schema_definiton], doc} = + {:ok, [_struct_def, schema_definition], doc} = ~q[ defmodule MySchema do use Ecto.Schema @@ -242,17 +242,17 @@ defmodule Engine.Search.Indexer.Extractors.EctoSchemaTest do ] |> index() - assert schema_definiton.type == :struct - assert schema_definiton.subtype == :definition - assert schema_definiton.subject == MySchema.Child + assert schema_definition.type == :struct + assert schema_definition.subtype == :definition + assert schema_definition.subject == MySchema.Child expected = ~q[ embeds_many :child, Child do field :first_name, :string end ]t - assert decorate(doc, schema_definiton.range) =~ ~q[embeds_many :child, «Child» do] - assert extract(doc, schema_definiton.block_range) =~ expected + assert decorate(doc, schema_definition.range) =~ ~q[embeds_many :child, «Child» do] + assert extract(doc, schema_definition.block_range) =~ expected end end end diff --git a/apps/engine/test/engine/search/indexer/extractors/function_definition_test.exs b/apps/engine/test/engine/search/indexer/extractors/function_definition_test.exs index 2902face..6981e5fc 100644 --- a/apps/engine/test/engine/search/indexer/extractors/function_definition_test.exs +++ b/apps/engine/test/engine/search/indexer/extractors/function_definition_test.exs @@ -408,7 +408,7 @@ defmodule Engine.Search.Indexer.Extractors.FunctionDefinitionTest do end test "handles macro calls that define functions" do - {:ok, [definiton], doc} = + {:ok, [definition], doc} = ~q[ quote do def rpc_call(pid, call = %Call{method: unquote(method_name)}), @@ -418,9 +418,9 @@ defmodule Engine.Search.Indexer.Extractors.FunctionDefinitionTest do |> in_a_module() |> index() - assert definiton.type == {:function, :public} + assert definition.type == {:function, :public} - assert decorate(doc, definiton.range) =~ + assert decorate(doc, definition.range) =~ "def «rpc_call(pid, call = %Call{method: unquote(method_name)})»" end diff --git a/apps/engine/test/engine/search/indexer/extractors/variable_test.exs b/apps/engine/test/engine/search/indexer/extractors/variable_test.exs index d30e5574..f24f178e 100644 --- a/apps/engine/test/engine/search/indexer/extractors/variable_test.exs +++ b/apps/engine/test/engine/search/indexer/extractors/variable_test.exs @@ -878,7 +878,7 @@ defmodule Engine.Search.Indexer.Extractors.VariableTest do assert decorate(doc, other_ref.range) =~ "foo = param = bar = «other»" end - test "in an anoymous function" do + test "in an anonymous function" do {:ok, [pin_param, var_param, first_def, pin_pin, var_ref, first_ref], doc} = ~q{ fn pin, var -> diff --git a/apps/expert/lib/expert/code_intelligence/completion/sort_scope.ex b/apps/expert/lib/expert/code_intelligence/completion/sort_scope.ex index 38dd439b..5ad1bf03 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/sort_scope.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/sort_scope.ex @@ -34,7 +34,7 @@ defmodule Expert.CodeIntelligence.Completion.SortScope do end @doc """ - Intended for delcarations defined in other modules than the immediate scope, + Intended for declarations defined in other modules than the immediate scope, either from one's project, dependencies, or the standard library. """ def remote(deprecated? \\ false, local_priority \\ 1) do diff --git a/apps/expert/lib/expert/project/intelligence.ex b/apps/expert/lib/expert/project/intelligence.ex index c5c16a64..a119f4c9 100644 --- a/apps/expert/lib/expert/project/intelligence.ex +++ b/apps/expert/lib/expert/project/intelligence.ex @@ -106,7 +106,7 @@ defmodule Expert.Project.Intelligence do a number representing the degree of the descendent generation (o for self, 1 for child, etc) or named generations (`:self`, `:child`, `:grandchild`, etc). For example, the collectionn range: `from: :child, to: :great_grandchild` will collect all struct - modules where the root module is thier parent up to and including all modules where the + modules where the root module is their parent up to and including all modules where the root module is their great grandparent, and is equivalent to the range `1..2`, Of course, if you want to return all the struct_modules, you can simply use `to: :infinity`. diff --git a/apps/expert/lib/expert/project/node.ex b/apps/expert/lib/expert/project/node.ex index 5f8b6b3b..b91e40c0 100644 --- a/apps/expert/lib/expert/project/node.ex +++ b/apps/expert/lib/expert/project/node.ex @@ -1,6 +1,6 @@ defmodule Expert.Project.Node do @moduledoc """ - A genserver responsibile for starting the remote node and cleaning up the build directory if it crashes + A genserver responsible for starting the remote node and cleaning up the build directory if it crashes """ defmodule State do diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/macro_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/macro_test.exs index 3d150d27..e5d50300 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/macro_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/macro_test.exs @@ -49,7 +49,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert apply_completion(completion) == "def ${1:name}($2) do\n $0\nend" end - test "def preceeded by a @spec with args", %{project: project} do + test "def preceded by a @spec with args", %{project: project} do source = ~q[ @spec my_function(term(), term()) :: term() def| @@ -68,7 +68,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do ] end - test "def preceeded by a @spec with named args", %{project: project} do + test "def preceded by a @spec with named args", %{project: project} do source = ~q[ @spec my_function(x :: term(), y :: term(), term()) :: term() def| @@ -87,7 +87,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do ] end - test "def preceeded by a @spec without args", %{project: project} do + test "def preceded by a @spec without args", %{project: project} do source = ~q[ @spec my_function :: term() def| @@ -106,7 +106,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do ] end - test "defp preceeded by a @spec with args", %{project: project} do + test "defp preceded by a @spec with args", %{project: project} do source = ~q[ @spec my_function(term(), term()) :: term() def| diff --git a/apps/expert/test/expert/project/diagnostics_test.exs b/apps/expert/test/expert/project/diagnostics_test.exs index ee0213a8..6115d656 100644 --- a/apps/expert/test/expert/project/diagnostics_test.exs +++ b/apps/expert/test/expert/project/diagnostics_test.exs @@ -37,7 +37,7 @@ defmodule Expert.Project.DiagnosticsTest do struct(Diagnostic.Result, values) end - def with_patched_tranport(_) do + def with_patched_transport(_) do test = self() patch(GenLSP, :notify_server, fn _, message -> @@ -63,7 +63,7 @@ defmodule Expert.Project.DiagnosticsTest do end describe "clearing diagnostics on compile" do - setup [:with_patched_tranport] + setup [:with_patched_transport] test "it clears a file's diagnostics if it's not dirty", %{ project: project diff --git a/apps/expert/test/forge/document_test.exs b/apps/expert/test/forge/document_test.exs index f7992dbd..dd9aacf7 100644 --- a/apps/expert/test/forge/document_test.exs +++ b/apps/expert/test/forge/document_test.exs @@ -100,7 +100,7 @@ defmodule Forge.DocumentTest do describe "apply_content_changes" do # tests and helper functions ported from https://github.com/microsoft/vscode-languageserver-node - # note thet those functions are not production quality e.g. they don't deal with utf8/utf16 encoding issues + # note that those functions are not production quality e.g. they don't deal with utf8/utf16 encoding issues defp index_of(string, substring) do case String.split(string, substring, parts: 2) do [left, _] -> left |> String.codepoints() |> length diff --git a/apps/forge/lib/forge/ast.ex b/apps/forge/lib/forge/ast.ex index bb02f61a..1a77ca5e 100644 --- a/apps/forge/lib/forge/ast.ex +++ b/apps/forge/lib/forge/ast.ex @@ -186,7 +186,7 @@ defmodule Forge.Ast do # https://github.com/elixir-lang/elixir/issues/12673#issuecomment-1592845875 # Note: because of the above issue: Using `cursor_context` + `container_cursor_to_quoted` # can't deal with some cases like: `alias Foo.Bar, as: AnotherBar`, - # so we need to add a new line to make sure we can get the parrent node of the cursor + # so we need to add a new line to make sure we can get the parent node of the cursor %{line: line} = normalize_position(position, document) added_new_line_position = Position.new(document, line + 1, 1) fragment = Document.fragment(document, added_new_line_position) diff --git a/apps/forge/lib/forge/document.ex b/apps/forge/lib/forge/document.ex index 4c1caa57..265ca24d 100644 --- a/apps/forge/lib/forge/document.ex +++ b/apps/forge/lib/forge/document.ex @@ -308,8 +308,8 @@ defmodule Forge.Document do apply_change(document, Edit.new(text, nil)) end - defp apply_change(%__MODULE__{} = document, convertable_edit) do - with {:ok, edit} <- Convertible.to_native(convertable_edit, document) do + defp apply_change(%__MODULE__{} = document, convertible_edit) do + with {:ok, edit} <- Convertible.to_native(convertible_edit, document) do apply_change(document, edit) end end diff --git a/apps/forge/lib/forge/project.ex b/apps/forge/lib/forge/project.ex index 536bee8a..6b9e097b 100644 --- a/apps/forge/lib/forge/project.ex +++ b/apps/forge/lib/forge/project.ex @@ -59,7 +59,7 @@ defmodule Forge.Project do |> folder_name() |> String.replace(~r/[^a-zA-Z0-9_]/, "_") - # This might be a litte verbose, but this code is hot. + # This might be a little verbose, but this code is hot. case sanitized do <> when c in ?a..?z -> sanitized @@ -98,7 +98,7 @@ defmodule Forge.Project do end @doc """ - Returns the the name definied in the `project/0` of mix.exs file + Returns the the name defined in the `project/0` of mix.exs file """ def display_name(%__MODULE__{} = project) do case config(project) do @@ -170,7 +170,7 @@ defmodule Forge.Project do @doc """ Returns the full path to the project's expert workspace directory - Expert maintains a workspace directory in project it konws about, and places various + Expert maintains a workspace directory in project it knows about, and places various artifacts there. This function returns the full path to that directory """ @spec workspace_path(t) :: String.t() diff --git a/apps/forge/lib/future/code/indentifier.ex b/apps/forge/lib/future/code/identifier.ex similarity index 100% rename from apps/forge/lib/future/code/indentifier.ex rename to apps/forge/lib/future/code/identifier.ex diff --git a/apps/forge/lib/mix/tasks/namespace.ex b/apps/forge/lib/mix/tasks/namespace.ex index 1c40ac6a..7f96c73d 100644 --- a/apps/forge/lib/mix/tasks/namespace.ex +++ b/apps/forge/lib/mix/tasks/namespace.ex @@ -5,7 +5,7 @@ defmodule Mix.Tasks.Namespace do app. Transformers take a path, find their relevant files and apply transforms to them. For example, - the Beams transformer will find any instances of modules in .beam files, and will apply namepaces + the Beams transformer will find any instances of modules in .beam files, and will apply namespaces to them if the module is one of the modules defined in a dependency. This task takes a single argument, which is the full path to the release. diff --git a/apps/forge/src/future_elixir_tokenizer.erl b/apps/forge/src/future_elixir_tokenizer.erl index 0ace9a69..62321609 100644 --- a/apps/forge/src/future_elixir_tokenizer.erl +++ b/apps/forge/src/future_elixir_tokenizer.erl @@ -1446,7 +1446,7 @@ check_terminator({End, {EndLine, EndColumn, _}}, [{Start, {StartLine, StartColum check_terminator({'end', {Line, Column, _}}, [], #elixir_tokenizer{mismatch_hints=Hints}) -> Suffix = case lists:keyfind('end', 1, Hints) of - {'end', HintLine, _Identation} -> + {'end', HintLine, _Indentation} -> io_lib:format("\n~ts the \"end\" on line ~B may not have a matching \"do\" " "defined before it (based on indentation)", [future_elixir_errors:prefix(hint), HintLine]); false ->