Skip to content

Adds attribute completions (#3941) #4105

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

Merged
merged 1 commit into from
Apr 24, 2020
Merged

Conversation

jrvidal
Copy link
Contributor

@jrvidal jrvidal commented Apr 23, 2020

I've hacked together some basic completions for a few builtin attributes.

  • I have no idea what CompletionItemKind we should set for them.
  • There's plenty of fancy stuff we could do by detecting the item the attribute is being added to. Nothing of that here.
  • Maybe we could complete as soon as you type # or #!?

I'm not sure what info exactly we can dump on CompletionContext and what we should query during the completion calculation itself. I've assumed adding an is_attribute field is OK, since it allows to discard the completion quickly if it doesn't apply. Later we inspect the AST to find out whether it is an inner attribute or not.

@matklad
Copy link
Member

matklad commented Apr 24, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 24, 2020

@bors bors bot merged commit 5d97667 into rust-lang:master Apr 24, 2020
@jrvidal jrvidal deleted the attributes branch April 24, 2020 16:35
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.

2 participants