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(completions): correctly insert cursor position #408

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

mhanberg
Copy link
Collaborator

@mhanberg mhanberg commented 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

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

It would insert the cursor like so

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

Fixes #406

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
Copy link
Collaborator Author

mhanberg commented Apr 4, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @mhanberg and the rest of your teammates on Graphite Graphite

@mhanberg mhanberg enabled auto-merge (squash) April 4, 2024 01:53
@mhanberg mhanberg merged commit 5509b4e into main Apr 4, 2024
15 checks passed
@mhanberg mhanberg deleted the 2024-04-03-fix-cursor-insertion branch April 4, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completions error when triggered outside of a module
1 participant