Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add .gitignore file to .elixir-tools directory #113

Merged
merged 3 commits into from
Jul 20, 2023
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
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