-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Language ServiceVisual StudioInherited from Visual StudioInherited from Visual Studiobugmore votes neededIssues that have been postponed until more community members upvote itIssues that have been postponed until more community members upvote itverifiedBug has been reproducedBug has been reproduced
Milestone
Description
Environment
- OS and Version: Windows 10 22H2 19045.3693
- VS Code Version: 1.84.2 (commit 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e)
- C/C++ Extension Version: v1.18.5
- If using SSH remote, specify OS of remote machine: WSL Ubuntu 20.04 (5.10.16.3-microsoft-standard-WSL2)
Bug Summary and Steps to Reproduce
Bug Summary:
- Some variables defined in the code body of a
C Macros
are not colorized but others are. - When clicking 'Go to Definition' on variables defined within the
C Macros
, it showsNo definition found
.
Steps to reproduce:
- Start up WSL in Windows Terminal, create a directory named
issue
; - Open this directory in VSCode by switching to it and typing
code .
; - Create a new file name
poc.c
, and copy following content:
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#define NOP(block) \
do { \
{block} \
} while (0);
typedef struct {
int a;
double b;
} test;
int main(void) {
NOP({
test v1;
v1.a = 10;
for (int i = 0; i < 10; i++) {
if (rand() % 2) {
test v2;
}
}
})
}
Expected behavior:
- At least all the type keywords of variables are colorized;
- 'Go to Definition' points to the correct variable definition location;
Configuration and Logs
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/local/bin/clang",
"cStandard": "c17",
"cppStandard": "c++14",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}
-------- Diagnostics - 11/22/2023, 9:04:19 PM
Version: 1.18.5
Current Configuration:
{
"name": "Linux",
"includePath": [
"/home/lain/issue/**"
],
"defines": [],
"compilerPath": "/usr/local/bin/clang",
"cStandard": "c17",
"cppStandard": "c++14",
"intelliSenseMode": "linux-clang-x64",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"compilerPathInCppPropertiesJson": "/usr/local/bin/clang",
"mergeConfigurations": false,
"browse": {
"path": [
"/home/lain/issue/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
cpptools version (native): 1.18.3.0
Translation Unit Mappings:
[ /home/lain/issue/poc.c ]:
/home/lain/issue/poc.c
Translation Unit Configurations:
[ /home/lain/issue/poc.c ]:
Process ID: 13842
Memory Usage: 11 MB
Compiler Path: /usr/local/bin/clang
Includes:
/home/lain/.wasmedge/include
/usr/local/lib/clang/13.0.0/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
Standard Version: c17
IntelliSense Mode: linux-clang-x64
Other Flags:
--clang
--clang_version=130000
Total Memory Usage: 11 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 23534
Other Extensions
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
Language ServiceVisual StudioInherited from Visual StudioInherited from Visual Studiobugmore votes neededIssues that have been postponed until more community members upvote itIssues that have been postponed until more community members upvote itverifiedBug has been reproducedBug has been reproduced
Type
Projects
Status
No status