Skip to content

Commit

Permalink
Merge branch 'master' into useCurrentRootFolderAsProjectDir
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson authored Aug 3, 2024
2 parents d72cdee + 91a0602 commit 0613422
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 36 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
### Unreleased

#### Highlights

- Allow to restrict projectDir detection to the current workspace root folder only

#### Improvements

- It is possible to restrict `mix.exs` search (projectDir) to the current root folder only, so in multi-root workspace configurations ElixirLS won't start in the outermost containing the `mix.exs` folder

### v0.22.1: 10 July 2024

#### Improvements

- ElixirLS updated to [v0.22.1](https://github.com/elixir-lsp/elixir-ls/blob/master/CHANGELOG.md#v0221)
- Enabled ANSI colors in Debug Adapter

### v0.22.0: 11 June 2024

Expand Down
26 changes: 2 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,9 @@ If you get an error like the following immediately on startup:
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
```

and you installed Elixir and Erlang from the Erlang Solutions repository, you may not have a full installation of Erlang. This can be solved with `sudo apt-get install esl-erlang`. (This was originally reported in [#208](https://github.com/elixir-lsp/elixir-ls/issues/208).)
and you installed Elixir and Erlang from the Erlang Solutions repository, you may not have a full installation of Erlang. This can be solved with `sudo apt-get install esl-erlang`. (This was originally reported in [#208](https://github.com/elixir-lsp/elixir-ls/issues/208)).

On fedora if you only install the elixir package you will not have a full erlang installation, this can be fixed by running `sudo dnf install erlang` (This was reported in [#231](https://github.com/elixir-lsp/elixir-ls/issues/231).)

If you are seeing the message "Invalid beam file or no abstract code", you need to make sure that your Mix project is set to use the `elixirc` compiler option `--debug-info`, which can be done by adding the following line to your `mix.exs` `project` section:

```
elixirc_options: [debug_info: Mix.env() == :dev]
```

For example:

```
defmodule MyApp.MixProject do
use Mix.Project
def project do
[
app: :my_app,
version: "0.1.0",
elixir: "~> 1.11",
elixirc_paths: elixirc_paths(Mix.env()),
elixirc_options: [debug_info: Mix.env() == :dev],
...
```
On fedora if you only install the elixir package you will not have a full erlang installation, this can be fixed by running `sudo dnf install erlang` (This was reported in [#231](https://github.com/elixir-lsp/elixir-ls/issues/231)).

### Check ElixirLS Output

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 54 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "The Elixir community",
"license": "MIT",
"publisher": "JakeBecker",
"version": "0.23.0",
"version": "0.22.1",
"engines": {
"vscode": "^1.85.0"
},
Expand Down Expand Up @@ -404,6 +404,59 @@
"default": true
}
}
},
"attach": {
"required": [
"projectDir",
"remoteNode"
],
"properties": {
"remoteNode": {
"type": "string",
"description": "Remote OTP node to connect to"
},
"env": {
"type": "object",
"description": "Environment variables to set before debugging - You may want to set MIX_ENV in here."
},
"debugAutoInterpretAllModules": {
"type": "boolean",
"description": "When debugging, interpret all files. Note: Only interpreted files will be part of the debugging stack traces. However this has a performance impact on large repositories, so if debugging is too slow, disable debugAutoInterpretFiles and use debugInterpretModulesPatterns to specify which files to interpret.",
"default": true
},
"debugInterpretModulesPatterns": {
"type": "array",
"description": "The modules to interpret when debugging - For details of interpreting, see the :int module in Erlang. Only modules that are interpreted will show up in the debugger stacktrace. An example of a pattern is: \"MyApp.*\", which will interpret all modules that begin with \"MyApp.\"",
"items": {
"type": "string",
"minLength": 1
}
},
"projectDir": {
"type": "string",
"description": "Project root directory (usually the workspace root)",
"default": "${workspaceRoot}"
},
"excludeModules": {
"type": "array",
"description": "Names of modules not to interpret - If a module contains NIFs, you should exclude it. Examples: Some.Module, :erlang_module",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"stackTraceMode": {
"type": "string",
"description": "Option passed to :int.stack_trace/1. See https://www.erlang.org/doc/man/int#stack_trace-1 for details",
"enum": [
"all",
"no_tail",
"false"
],
"default": "no_tail"
}
}
}
},
"initialConfigurations": [
Expand Down
5 changes: 1 addition & 4 deletions src/commands/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,7 @@ export async function runTest(
});
}

const COMMON_ARGS = [
"--formatter",
"ElixirLS.DebugAdapter.ExUnitFormatter",
];
const COMMON_ARGS = ["--formatter", "ElixirLS.DebugAdapter.ExUnitFormatter"];

function buildTestCommandArgs(args: RunTestArgs, debug: boolean): string[] {
let line = "";
Expand Down
1 change: 1 addition & 0 deletions src/languageClientManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function startClient(
"language_server",
clientOptions.workspaceFolder
),
options: { shell: true },
};

// If the extension is launched in debug mode then the `debug` server options are used instead of `run`
Expand Down
6 changes: 6 additions & 0 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ const samplingConfigs: EventSamplingConfig[] = [
propertyValue: "textDocument_completion",
samplingFactor: 0.002,
},
{
eventName: "lsp_request",
propertyKey: "elixir_ls.lsp_command",
propertyValue: "textDocument_codeAction",
samplingFactor: 0.002,
},
{
eventName: "lsp_request",
propertyKey: "elixir_ls.lsp_command",
Expand Down

0 comments on commit 0613422

Please sign in to comment.