mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CodeCompletion] Don't mark #keyPath as "expression specific" without #
We suggest #keyPath in every String context, so having it be expression-specific is artificially increasing its priority. rdar://problem/26544672
This commit is contained in:
@@ -2196,11 +2196,15 @@ public:
|
||||
// #keyPath is only available when the Objective-C runtime is.
|
||||
if (!Ctx.LangOpts.EnableObjCInterop) return;
|
||||
|
||||
// After #, this is a very likely result. When just in a String context,
|
||||
// it's not.
|
||||
auto semanticContext = needPound ? SemanticContextKind::None
|
||||
: SemanticContextKind::ExpressionSpecific;
|
||||
|
||||
CodeCompletionResultBuilder Builder(
|
||||
Sink,
|
||||
CodeCompletionResult::ResultKind::Keyword,
|
||||
SemanticContextKind::ExpressionSpecific,
|
||||
ExpectedTypes);
|
||||
semanticContext, ExpectedTypes);
|
||||
if (needPound)
|
||||
Builder.addTextChunk("#keyPath");
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user