This is an archive of the discontinued LLVM Phabricator instance.

Basic reform of chunks for overload completion results.
ClosedPublic

Authored by francisco.lopes on Jan 23 2015, 12:24 PM.

Details

Summary

The code building the code completion string for overloads was providing
less detail compared to the one building completion strings for function
declarations. There was no information about optionals and no information
about what's a parameter and what's a function identifier, everything
besides ResultType, CurrentParameter and special characters was classified
as Text.

This makes code completion strings for overload candidates to follow a
pattern very similar, but not identical, to the one in use for function
declarations:

  • return type chunk: ResultType
  • function identifier chunk: Text
  • parameter chunks: Placeholder
  • optional parameter chunks: Optional
  • current parameter chunk: CurrentParameter

Diff Detail

Event Timeline

francisco.lopes retitled this revision from to Basic reform of chunks for overload completion results..
francisco.lopes updated this object.
francisco.lopes edited the test plan for this revision. (Show Details)
francisco.lopes added a subscriber: Unknown Object (MLST).

This rebases over master and squashes an irrelevant commit.

klimek edited edge metadata.Jan 28 2015, 1:18 AM

Generally makes sense to me - how does the experience change in the actual code completion of overloads in an editor using this?

lib/Sema/SemaCodeComplete.cpp
2840–2841

So we're both recursing and looping? This seems like a strange pattern to me, that at least needs a comment.

@klimek The client code has opportunity to better highlight individual tokens and warn the user what parameters are required and what aren't. Although the Russian nesting doll approach to optionals may turn the treatment slightly more complex, but it's the approach already employed elsewhere in the codebase as in AddFunctionParameterChunks.

lib/Sema/SemaCodeComplete.cpp
2840–2841

OK.

francisco.lopes edited edge metadata.

Add comment about recursive approach that's being employed.

klimek accepted this revision.Jan 28 2015, 5:12 AM
klimek edited edge metadata.

lg

lib/Sema/SemaCodeComplete.cpp
2840

Perhaps simply "Optional section are nested." :)

This revision is now accepted and ready to land.Jan 28 2015, 5:12 AM
lib/Sema/SemaCodeComplete.cpp
2840

Sad OK :(

francisco.lopes edited edge metadata.

Reword comment.

Landed in SVN revision 227309.

Thanks for the review Manuel.