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

Completions error when triggered outside of a module #406

Closed
mhanberg opened this issue Apr 1, 2024 · 4 comments · Fixed by #408
Closed

Completions error when triggered outside of a module #406

mhanberg opened this issue Apr 1, 2024 · 4 comments · Fixed by #408

Comments

@mhanberg
Copy link
Collaborator

mhanberg commented Apr 1, 2024

Description

When typing outside of a module, completions are not showing up.

I believe that this is due to calculating the module name to include in the defmodule snippet.

@mhanberg
Copy link
Collaborator Author

mhanberg commented Apr 1, 2024

cc @lucacervello

@lucacervello
Copy link
Contributor

I can't reproduce, It works just fine for me.

@mhanberg
Copy link
Collaborator Author

mhanberg commented Apr 3, 2024

Weird, I'll try again

@mhanberg
Copy link
Collaborator Author

mhanberg commented Apr 4, 2024

CleanShot.2024-04-03.at.21.04.35.mp4

ahh, so its unrelated to the snippet, and I think I introduced it in the last commit that is on main.

It seems to get mad if you cursor is in the column 1 or 2 (1 based column)

i'll fix it

mhanberg added a commit that referenced this issue Apr 4, 2024
The cursor was being inserted in a strange matter, which made the
modified ast not have a `__cursor__()` function, so we couldn't find the
cursor.

Really, all we need to do is insert the cursor on its own line between
the line.

For example, if you were to put the cursor into the middle of this line
of code

```elixir
Enum.map(some_list, fn row ->   end)
```

It would insert the cursor like so

```elixir
Enum.map(some_list, fn row ->
__cursor__()
end)
```

Fixes #406
mhanberg added a commit that referenced this issue Apr 4, 2024
The cursor was being inserted in a strange matter, which made the
modified ast not have a `__cursor__()` function, so we couldn't find the
cursor.

Really, all we need to do is insert the cursor on its own line between
the line.

For example, if you were to put the cursor into the middle of this line
of code

```elixir
Enum.map(some_list, fn row ->   end)
```

It would insert the cursor like so

```elixir
Enum.map(some_list, fn row ->
__cursor__()
end)
```

Fixes #406
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants