admin管理员组

文章数量:1122846

I am working on Visual Studio Code in a codebase with custom classes and when variables are declared using auto, my autocomplete will not work. Here is an example for a function returning a smart pointer to a custom class.

When using auto, I get "No suggestions"

If I manually declare the type, it works fine.

Is this a known issue? something I can try? Thank you.

I am working on Visual Studio Code in a codebase with custom classes and when variables are declared using auto, my autocomplete will not work. Here is an example for a function returning a smart pointer to a custom class.

When using auto, I get "No suggestions"

If I manually declare the type, it works fine.

Is this a known issue? something I can try? Thank you.

Share Improve this question edited Nov 21, 2024 at 12:29 Mike mik asked Nov 21, 2024 at 12:25 Mike mikMike mik 919 bronze badges 3
  • visual studio code, sorry. edited. thank you. – Mike mik Commented Nov 21, 2024 at 12:28
  • how have you configured intellisense? are you using the c++ plugin intellisense or clang? – Alan Birtles Commented Nov 21, 2024 at 12:41
  • I use C/C++ Intellisense – Mike mik Commented Nov 21, 2024 at 12:53
Add a comment  | 

1 Answer 1

Reset to default -2

Yes, this is a known problem, unfortunately, when using the auto type, visual studio cannot determine the method fields and their types for a class, as far as I know, the only way to return tooltips is to explicitly indicate the type

本文标签: Visual Studio code C autocomplete does not work for variables created with auto declaratorStack Overflow