Bug 515351 - Completion proposal for templated conversion operator
Summary: Completion proposal for templated conversion operator
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 9.3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-17 16:22 EDT by Nathan Ridge CLA
Modified: 2020-09-04 15:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Ridge CLA 2017-04-17 16:22:34 EDT
struct Wrapper {
  template <typename T>
  operator T();
};

int main() {
  Wrapper w;
  w./* invoke completion here */
}

When content assist is invoked at the indicated location, the completion proposal for the conversion operator looks like this:

  operator #0(void): T

and if selected, the inserted text is this:

  w.operator #0()

Unlike bug 515350, the desired behaviour here is less clear. Options I can think of are:

  1) Simple: just don't provide a completion for a templated conversion 
     operator.

  2) Fancier: when the completion proposal is selected, create a 
     placeholder box in the place of the type, where the user can enter 
     a concrete type.

  3) Even fancier: try to deduce the desired type from the surrounding
     context, falling back to (2) if a type can't be deduced.