elixir-lsp / elixir-lsp/elixir_sense

Possible regression for bitstring completion

Open
#342 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
340
Forks
43
PR merge metrics
No merged PRs in 30d

Description

When I checkout to da065ae9 and run suggestion on bitstring, I get:

```
iex(1) > ElixirSense.suggestions("< Enum.filter(& &1.type == :bitstring_option)
[%{name: "integer", type: :bitstring_option}]
```

However, the same on later commit from master does not return it:

```
iex(1) > ElixirSense.suggestions("< Enum.filter(& &1.type == :bitstring_option)
[]
```

Possibly related, but not sure if bug or just change in behaviour:

Old:

```
iex(2) > ElixirSense.suggestions("< Enum.filter(& &1.type == :bitstring_option)
[
%{name: "utf8", type: :bitstring_option},
%{name: "utf16", type: :bitstring_option},
%{name: "utf32", type: :bitstring_option}
]
```

New:

```
iex(2) > ElixirSense.suggestions("< Enum.filter(& &1.type == :bitstring_option)
[
%{arity: 1, name: "unit", type: :bitstring_option},
%{name: "utf8", type: :bitstring_option},
%{name: "utf16", type: :bitstring_option},
%{name: "utf32", type: :bitstring_option}
]
```

(additional entry for "unit")

This was found while updating ElixirSense in Expert.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the regression through ElixirSense.suggestions/3 with the bitstring inputs shown in the issue, comparing the older commit with current master. Trace how :bitstring_option suggestions are assembled and verify whether integer is missing and whether the additional unit entry is intentional; done means the behavior is explained and the expected suggestions are covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.