Skip to content

[CodeCompletion] Implement .Type completion in expression context #22539

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Feb 12, 2019

rdar://problem/22072865

@rintaro
Copy link
Member Author

rintaro commented Feb 12, 2019

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor

Foo.Type is not valid in expression context. Foo.Type.self is valid, but that creates a meta-metatype which is rare.

However if you're going to complete Foo.Type, please also add Foo.Protocol where foo is a protocol (but again, that's a type term not an expression term).

@rintaro rintaro force-pushed the ide-codecompletion-dottype-rdar22072865 branch from 53615d0 to f64f6b0 Compare February 12, 2019 18:15
@rintaro rintaro force-pushed the ide-codecompletion-dottype-rdar22072865 branch from f64f6b0 to ec85151 Compare February 12, 2019 18:59
@rintaro
Copy link
Member Author

rintaro commented Feb 12, 2019

Foo.Type is not valid in expression context. Foo.Type.self is valid, but that creates a meta-metatype which is rare.

Because .self is not the only possible suffix to Foo.Type in expression context (e.g. Foo.Type.Type.self), we should not complete .Type.self at once.

However if you're going to complete Foo.Type, please also add Foo.Protocol where foo is a protocol (but again, that's a type term not an expression term).

Fair enough. I've implemented .Protocol completion for both type and expression context.

@rintaro rintaro requested a review from benlangmuir February 12, 2019 19:00
@rintaro
Copy link
Member Author

rintaro commented Feb 12, 2019

@swift-ci Please smoke test

@rintaro rintaro merged commit 0bebba8 into swiftlang:master Feb 13, 2019
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.

3 participants