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
2 changes: 1 addition & 1 deletion apps/engine/lib/engine/analyzer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/lib/engine/api/proxy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion apps/engine/lib/engine/bootstrap.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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 _ ->
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/lib/engine/build/project.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/lib/engine/search/fuzzy/scorer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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, _} =
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/lib/engine/search/indexer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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, []}
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions apps/engine/lib/engine/search/indexer/extractors/module.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/lib/engine/search/store/backends/ets/wal.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/test/engine/analyzer/imports_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/test/engine/analyzer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/test/engine/api/proxy_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
6 changes: 3 additions & 3 deletions apps/engine/test/engine/build/document/compilers/eex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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") %>
])
Expand All @@ -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 %>
])
Expand All @@ -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 %>
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ 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[
<div><%= @thing %></div>
])

assert {:error, []} = compile(document)
end

test "handles undefinied variables" do
test "handles undefined variables" do
document = document_with_content(~q[
<div><%= thing %></div>
])
Expand Down
8 changes: 4 additions & 4 deletions apps/engine/test/engine/build/error_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/test/engine/code_intelligence/entity_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)}),
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/expert/lib/expert/project/intelligence.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion apps/expert/lib/expert/project/node.ex
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading
Loading