microsoft / microsoft/vscode-cpptools

Misreporting no field when defined after a macro (error 136)

Open
#10,732 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Language Service Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: Bug

If you look in CPython's source code (for example, Python/ceval.c), it reports that struct "_typeobject" has no field "tp_name", and yet if you look in Include/cpython/object.h you will see const char *tp_name;.

My guess is the PyObject_VAR_HEAD macro usage is messing up error detection somehow as Go to Definition worked fine and got me to the correct struct.

Extension version: 1.14.5
VS Code version: Code - Insiders 1.77.0-insider (a5bd844beddef8ca5f9ccfdb1bb7b3b4f8e5204e, 2023-03-22T10:38:48.144Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: Yes
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz (8 x 2112)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.75GB (2.11GB free)
Process Argv --crash-reporter-id 2f8216b4-0af9-4bf4-a156-6cdcff01b0ab
Screen Reader no
VM 0%
Item Value
Remote Dev Container
OS Linux x64 5.15.90.1-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz (8 x 2112)
Memory (System) 7.63GB (5.12GB free)
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256198
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vsdfh931:30280409
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30404738
cppdebug:30492333
vscaat:30438846
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30618038
pylantcb52:30590116
pyindex848:30611229
nodejswelcome1:30587009
pyind779:30611226
pythonsymbol12:30651887
2i9eh265:30646982
showlangstatbar:30659908
pythonb192cf:30661257
azdwalk:30687957
pythonms35:30671666
03d35959:30680466
ecj1e332:30687743

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the diagnostic using the referenced CPython files, Python/ceval.c and Include/cpython/object.h, focusing on PyObject_VAR_HEAD and the tp_name field. Trace the C/C++ extension's error-detection path; done means it no longer reports that _typeobject lacks tp_name while Go to Definition still resolves correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.