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

[SR-9205][SourceKit] Recognize operators declared as `static func` #20427

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@rockbruno
Contributor

rockbruno commented Nov 8, 2018

SourceKit was correctly attributing operator UIDs for global operators, but operators declared inside types as public static func were being given the regular static method's UID. This PR makes SourceKit attribute operator UIDs for them as well.

Resolves SR-9205.

if (sym.SubKind == SymbolSubKind::SwiftPrefixOperator)
return UID_FOR(FunctionPrefixOperator);
if (sym.SubKind == SymbolSubKind::SwiftPostfixOperator)
return UID_FOR(FunctionPostfixOperator);
if (sym.SubKind == SymbolSubKind::SwiftInfixOperator)
return UID_FOR(FunctionInfixOperator);
return UID_FOR(FunctionFree);
if (sym.Kind == SymbolKind::StaticMethod) {

This comment has been minimized.

@rockbruno

rockbruno Nov 8, 2018

Contributor

This feels a bit wonky to me - I had originally created different UIDs to prevent putting the cases together but ended up thinking it was unnecessary. I appreciate better ideas! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment