Vscode-cpptools: Intellisense: missing suggestion of inherited virtual function name after primitive types

Created on 10 Dec 2019  路  2Comments  路  Source: microsoft/vscode-cpptools

Type: LanguageService

Describe the bug

  • OS and Version: Linux x64 5.4.2-arch1-1
  • VS Code Version: 1.40.2
  • C/C++ Extension Version: 0.26.2

In class definition, Intellisense suggest inherited virtual function's name after a non-primitive return type name like std::string or float_type with using float_type = double;, which is handy when writing an overriding function. But the same suggestion is missing if the return type name inputted is an primitive type like int or double.

To Reproduce

struct A {
  using int_type = int;
  virtual int_type get_an_int() { return 42; };
  virtual double get_a_double() { return 42.; };
};

struct B : A {
  // won't suggest after `int `
  // int get_an_int() override { return 42; }

  // suggest `get_an_int` & `get_a_double` after `int_type `
  int_type get_an_int() override { return 42; }
};
Auto-complete Language Service Works in VS bug quick fix verified

Most helpful comment

I believe this will be addressed with #4737. I will close this as a duplicate.

All 2 comments

Our code is disabling completion when the previous token is a built-in type keyword -- I'm not sure what the original reasoning behind that was. VS enables completion in this case, but only when it's manually invoked.

I believe this will be addressed with #4737. I will close this as a duplicate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wdc596933938 picture wdc596933938  路  3Comments

montery8 picture montery8  路  3Comments

DemoCrazer picture DemoCrazer  路  3Comments

narutse picture narutse  路  3Comments

SkyRiderMike picture SkyRiderMike  路  3Comments