This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Commit a7e9bc6
authored
feat: completions (#289)
## Description
Implements basic autocompletion.
Current completion candidates supported
- Global modules
- Global Structs
- Struct fields
- Remote functions (w/ documentation)
- Special Forms
- Bitstring modifiers
- filesystem paths in strings
More features, particularly features that rely on contextual information about the code itself (meaning, which identifiers, aliases, imports are available) will come in subsequent patches.
Partially addresses #45
## Experimental
This patch also introduces a new initialization option, `experimental`.
This feature will be gated as an experimental feature as it's built out. The purpose of this is so that early-early adopters can try it out and report bugs, but folks who would rather wait for something more stable won't have it affect their workflows.
To enable this feature, toggle the completions experiment in your editor.
### Nvim (elixir-tools.nvim)
```lua
require("elixir").setup({
nextls = {
enable = true,
init_options = {
experimental = {
completions = {
enable = true
}
}
}
},
elixirls = {enable = false}
})
```
### Visual Studio Code (elixir-tools.vscode)
```json
{
"elixir-tools.nextLS.experimental.completions.enable": true
}
```
### Other editors
Not sure 😅
## Demos
TODO: record them my guy
## TODO
- [x] integration tests
- [ ] update elixir-tools.dev with instructions
- [x] update README with instructions
## Acknowedgements
This feature is initially based on `IEx.Autocomplete`. Huge thanks to the Elixir core team's efforts to help kickstart this feature. More deviations will likely occur as we gain more contextual parsing for things like imports, aliases and variables.1 parent dace852 commit a7e9bc6
File tree
9 files changed
+2226
-4
lines changed- lib
- next_ls
- helpers/ast_helpers
- test/next_ls
- helpers/ast_helpers
9 files changed
+2226
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
| |||
504 | 513 | | |
505 | 514 | | |
506 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
507 | 570 | | |
508 | 571 | | |
509 | 572 | | |
| |||
1019 | 1082 | | |
1020 | 1083 | | |
1021 | 1084 | | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1022 | 1090 | | |
1023 | 1091 | | |
1024 | 1092 | | |
1025 | 1093 | | |
1026 | | - | |
| 1094 | + | |
1027 | 1095 | | |
1028 | 1096 | | |
1029 | 1097 | | |
1030 | 1098 | | |
1031 | 1099 | | |
1032 | 1100 | | |
1033 | | - | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1034 | 1109 | | |
1035 | 1110 | | |
1036 | 1111 | | |
| |||
0 commit comments