You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ide/visual-cpp-intellisense-configuration.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ When you open a file that isn't included in a project, Visual Studio provides so
19
19
20
20
If a file isn't open in single-file mode, and IntelliSense isn't working correctly, the first place to check is the **Error List** window. To see all the IntelliSense errors for the current source file together with all included header files, choose **Build + IntelliSense** in the dropdown:
21
21
22
-
:::image type="content" source="media/visual-cpp-intellisense-error-list.png" alt-text="Screenshot that shows the IntelliSense Error List window.":::
22
+
:::image type="content" source="media/visual-cpp-intellisense-error-list.png" alt-text="Screenshot of the Error List window. Build + IntelliSense is selected in the filter dropdown.":::
23
23
24
24
IntelliSense produces a maximum of 1,000 errors. If there are more than 1,000 errors in the header files included by a source file, then the source file shows only a single error squiggle at the very start of the source file.
25
25
@@ -37,7 +37,7 @@ To see the current values for build macros such as **VC_IncludePath**, select th
37
37
38
38
For Makefile projects that are based on the NMake project template, choose **NMake** under **Configuration Properties**, and then choose **Include search path** in the **IntelliSense** category:
39
39
40
-
:::image type="content" source="media/vcpp-intellisense-makefile-include-paths.png" alt-text="Screenshot that shows the Include Search Path setting under Intellisense.":::
40
+
:::image type="content" source="media/vcpp-intellisense-makefile-include-paths.png" alt-text="Screenshot that shows the Configuration Properties > N Make > Include Search Path setting.":::
41
41
42
42
### CMake projects
43
43
@@ -53,13 +53,12 @@ For example, it doesn't evaluate preprocessor macros, and therefore it might inc
53
53
54
54
There are two common ways in which this problem manifests in Visual Studio:
55
55
56
+
1. The IDE offers to create a function definition for a function that is already defined.
56
57
1. If the navigation bar shows an innermost macro, then the current function definition was skipped:
57
58
58
-
:::image type="content" source="media/vcpp-intellisense-tag-parser-macro.png" alt-text="Screenshot that shows the tag parser skipping the function definition.":::
59
-
60
-
1. The IDE offers to create a function definition for a function that is already defined:
61
-
62
-
:::image type="content" source="media/vcpp-intellisense-tag-parser-function.png" alt-text="Screenshot that shows the tag parser offering to define an existing function.":::
59
+
:::image type="complex" source="media/vcpp-intellisense-tag-parser-macro.png" alt-text="Screenshot that shows the tag parser skipping the function definition.":::
60
+
The code snippet shows a macro definition for do_if that is used inside of the function main. The tag parser doesn't understand the macro, so instead of the navigation dropdown showing that the name of the current function is main, it shows the name of the macro: do_if.
61
+
:::image-end:::
63
62
64
63
To fix these kinds of problems, add a file named *`cpp.hint`* to the root of your solution directory. For more information, see [Hint Files](/cpp/build/reference/hint-files).
65
64
@@ -98,7 +97,7 @@ However, in some cases Visual Studio might not update the IntelliSense database
98
97
99
98
An IntelliSense build doesn't produce binaries, but it can still fail. One possible cause for failure is custom *`.props`* or *`.targets`* files. In Visual Studio 2017 version 15.6 and later, IntelliSense-only build errors are logged to the Output window. To see them, set **Show output from** to **Solution**:
100
99
101
-
:::image type="content" source="media/visual-cpp-intellisense-output-window.png" alt-text="Screenshot that shows the Output window for solution errors.":::
100
+
:::image type="content" source="media/visual-cpp-intellisense-output-window.png" alt-text="Screenshot that shows the Output window. The Show output from dropdown is set to Solution.":::
102
101
103
102
The error message might instruct you to enable design-time tracing:
0 commit comments