Skip to content

Commit

Permalink
feat: suggest tuple fields in LSP completion (#5730)
Browse files Browse the repository at this point in the history
# Description

## Problem

Part of #1577

(there are many more completions we could support and it's hard to list
all of them upfront, so I'll just link to that issue from now on)

## Summary

Suggest tuple fields (0, 1) in autocompletion, which is useful if you
don't know the type you are handling with (maybe it's a result of
another expression that's not in a variable).

Also I noticed tuple methods showed up duplicate, so that's fixed too.

Before:


![lsp-complete-tuple-before](https://github.com/user-attachments/assets/9dc36a32-9017-4b3d-a16c-091ea6ab5a42)

After:


![lsp-complete-tuple-after](https://github.com/user-attachments/assets/70b6d9fd-4f4f-4d57-ab45-55a270fa64cb)

## Additional Context

The two first commits are just refactors, so I'd suggest going commit by
commit.

## Documentation

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
asterite authored Aug 15, 2024
1 parent ca75cc2 commit 64d7d78
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 224 deletions.
Loading

0 comments on commit 64d7d78

Please sign in to comment.