Vscode-cpptools: Add UI to provide args for templates, to enable template IntelliSense

Created on 7 May 2018  路  7Comments  路  Source: microsoft/vscode-cpptools

* Operating System and version

MacOS 10.13.4

* VS Code version and if you are using the Insiders build

VSCode 1.24.0-Insiders #2404210629c744e6237a14d7b5fa852e24c6e898

* C/C++ extension version

0.16.1

* step-by-step instructions to reproduce the issue

Create at least one class declaration in a header file.
Use a template on this class
Intentionally create a syntax error
Note that no error squiggles are generated and no error or warning given in the Problems pane.
In the example below, I am showing quite a few compiler errors (there are plenty in this file). One in particular is the errant use of override. This shows up in the compiler output, but not in the error squiggles or in the Problems pane:
screen shot 2018-05-06 at 10 56 09 pm

* A small code sample, zipped up project, or open source repo we can use to verify the bug

Errant header file attached
LinkedList.h.zip

* Any log messages present in the Output window (use "C_Cpp.loggingLevel": "Information" in settings.json)

The logs indicate that it thinks it is looking for syntax errors:
IntelliSense Engine = Default.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
Autocomplete is enabled.
Error squiggles are enabled.
File exclude: /.git
File exclude: */.svn
File exclude: *
/.hg
File exclude: */CVS
File exclude: *
/.DS_Store
File exclude: */.o
File exclude: */.d
File exclude: */.vscode
Search exclude: *
/node_modules
Search exclude: */bower_components
Search exclude: *
/.vscode
Code browsing service initialized
Folder: /usr/local/include/ will be indexed
Folder: /usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0/ will be indexed
Folder: /Users/dustinlane/Desktop/VSCode_Test/ will be indexed
Folder: /System/Library/Frameworks/ will be indexed
Folder: /Library/Frameworks/ will be indexed
Discovering files...
Checking for syntax errors: file:///Users/dustinlane/Desktop/VSCode_Test/C%2B%2B_Test/LinkedList.h
Processing folder (recursive): /usr/local/include/
Processing folder (recursive): /usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0/
Processing folder (recursive): /Users/dustinlane/Desktop/VSCode_Test/
Processing folder (recursive): /System/Library/Frameworks/
**Checking for syntax errors: file:///Users/dustinlane/Desktop/VSCode_Test/C%2B%2B_Test/LinkedList.h

Checking for syntax errors: file:///Users/dustinlane/Desktop/VSCode_Test/C%2B%2B_Test/LinkedList.h
Checking for syntax errors: file:///Users/dustinlane/Desktop/VSCode_Test/C%2B%2B_Test/LinkedList.cpp
Shutting down IntelliSense server: /Users/dustinlane/Desktop/VSCode_Test/C++_Test/main.cpp
Checking for syntax errors: file:///Users/dustinlane/Desktop/VSCode_Test/C%2B%2B_Test/LinkedList.h
Checking for syntax errors: file:///Users/dustinlane/Desktop/VSCode_Test/C%2B%2B_Test/LinkedList.h
Processing folder (recursive): /Library/Frameworks/
Discovering files: 301712 file(s) processed
0 file(s) removed from database
Done discovering files.
Parsing open files...
Parsing remaining files...
Parsing: 0 files(s) processed
Done parsing remaining files.
Done parsing open files.
Checking for syntax errors: file:///Users/dustinlane/Desktop/VSCode_Test/C%2B%2B_Test/main.cpp
Checking for syntax errors: file:///Users/dustinlane/Desktop/VSCode_Test/C%2B%2B_Test/LinkedList.h

Feature Request Find All References Language Service Works in VS

Most helpful comment

@sean-mcmanus I think you can bring this iteratively - even without a UI you can do this as a feasible solution. Setting the template argument manually (e.g. using default value, or by adding a comment with a predefined format) could at least help initial authoring and debugging tremendously.I for one would certainly be open to adding a default value temporarily, or adding a comment before/after the template declaration just to get autocompletion, error highlighting, etc.

Since concepts will be added in C++20, you can also use those.

Adding a UI is certainly the long-term solution (GitLens adds so much information I think there could be a potential solution in a similar component), but if that's the toughest part, let's workaround that :)

All 7 comments

I'm also able to repro this bug with VS 2017, so I'll look into filing a bug with them and update this issue when I get more info...

Thanks, @sean-mcmanus .

It turns out this is a "by design" limitation -- templates have errors turned off, because the type info is not known for the template args. We would have to add some UI that enables users to set the actual types of the template args.

@sean-mcmanus I think you can bring this iteratively - even without a UI you can do this as a feasible solution. Setting the template argument manually (e.g. using default value, or by adding a comment with a predefined format) could at least help initial authoring and debugging tremendously.I for one would certainly be open to adding a default value temporarily, or adding a comment before/after the template declaration just to get autocompletion, error highlighting, etc.

Since concepts will be added in C++20, you can also use those.

Adding a UI is certainly the long-term solution (GitLens adds so much information I think there could be a potential solution in a similar component), but if that's the toughest part, let's workaround that :)

Any schedule about that yet?

@DrunkenMastah Not yet...if it gets on our schedule, you'll see it added to a specific Milestone and/or Project instead of the "Backlog" milestone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jheinzel picture jheinzel  路  3Comments

montery8 picture montery8  路  3Comments

CDitzel picture CDitzel  路  3Comments

DemoCrazer picture DemoCrazer  路  3Comments

SkyRiderMike picture SkyRiderMike  路  3Comments