Skip to content

Commit

Permalink
fix: add .gitignore file to .elixir-tools directory (#113)
Browse files Browse the repository at this point in the history
Co-authored-by: Mitchell Hanberg <[email protected]>
  • Loading branch information
lud-wj and mhanberg committed Jul 20, 2023
1 parent 43177f4 commit 24d9915
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ Using eglot:

## Installation

The preferred way to use NextLS is through one of the supported editor extensions.
The preferred way to use Next LS is through one of the supported editor extensions.

If you need to install NextLS on it's own, you can download the executable hosted by the GitHub release. The executable is an Elixir script that utilizes `Mix.install/2`.
If you need to install Next LS on it's own, you can download the executable hosted by the GitHub release. The executable is an Elixir script that utilizes `Mix.install/2`.

### Note

NextLS creates an `.elixir-tools` hidden directory in your project.

This should be added to your project's `.gitignore`.
Next LS creates an `.elixir-tools` hidden directory in your project, but it will be automatically ignored by `git`.
9 changes: 8 additions & 1 deletion lib/next_ls/lsp_supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,20 @@ defmodule NextLS.LSPSupervisor do
raise OptionsError, invalid
end

# FIXME: this directory should be inside the workspace, which will is not determined until
# the LSP has begun initialization
# The symbol table may need to started dynamically, like the extensions and the runtimes
hidden_folder = Path.expand(".elixir-tools")
File.mkdir_p!(hidden_folder)
File.write!(Path.join(hidden_folder, ".gitignore"), "*\n")

children = [
{DynamicSupervisor, name: NextLS.DynamicSupervisor},
{Task.Supervisor, name: NextLS.TaskSupervisor},
{Task.Supervisor, name: :runtime_task_supervisor},
{GenLSP.Buffer, buffer_opts},
{NextLS.DiagnosticCache, name: :diagnostic_cache},
{NextLS.SymbolTable, name: :symbol_table, path: Path.expand(".elixir-tools")},
{NextLS.SymbolTable, name: :symbol_table, path: hidden_folder},
{Registry, name: NextLS.ExtensionRegistry, keys: :duplicate},
{NextLS,
cache: :diagnostic_cache,
Expand Down
2 changes: 0 additions & 2 deletions lib/next_ls/symbol_table.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ defmodule NextLS.SymbolTable do
symbol_table_name = Keyword.get(args, :symbol_table_name, :symbol_table)
reference_table_name = Keyword.get(args, :reference_table_name, :reference_table)

File.mkdir_p!(path)

{:ok, name} =
:dets.open_file(symbol_table_name,
file: Path.join(path, "symbol_table.dets") |> String.to_charlist(),
Expand Down

0 comments on commit 24d9915

Please sign in to comment.