microsoft / microsoft/vscode-cpptools
User-defined keywords lead to incorrect function documentation popup text
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
Brief Issue Summary
I observed that the popup on mouseover displays the class documentation instead of the function documentation after user-defined keywords while working on a project that uses Qt. The documentation would be incorrect for the first 'signal' after the 'signals' keyword or the first 'slot' after the 'slots' keyword.
After some tests it seems to me that any user defined 'keyword' in a class declaration that is non-standard can cause this. But when a semicolon is added after the keyword (see function 'baaaaz') or the ':' when the keyword is used as access specifier.
The following code should reproduce the behavior:
#define PROTECTED protected // same for Qt's 'signals' and 'slots'
#define MARKER
// class foo
class foo
{
protected:
// function bar
void bar(){} // function doc works
PROTECTED:
// function baz
void baz(){} // class doc displayed
MARKER
// function baaz
void baaz(){} // class doc displayed
public MARKER:
// function baaaz
void baaaz(){} // class doc displayed
MARKER;
// function baaaaz
void baaaaz(){} // function doc works
};
About-Info:
Version: 1.67.2 (system setup)
Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
Date: 2022-05-17T18:15:52.058Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.19044
Installed extensions:
bierner.markdown-mermaid
cschlosser.doxdocgen
fredericbonnet.cmake-test-adapter
GitHub.vscode-pull-request-github
hbenl.vscode-test-explorer
IBM.output-colorizer
idleberg.haskell-nsis
idleberg.nsis
matepek.vscode-catch2-test-adapter
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-vscode-remote.remote-containers
ms-vscode-remote.remote-ssh
ms-vscode-remote.remote-ssh-edit
ms-vscode-remote.remote-wsl
ms-vscode.cmake-tools
ms-vscode.cpptools
ms-vscode.cpptools-extension-pack
ms-vscode.cpptools-themes
ms-vscode.test-adapter-converter
ms-vsliveshare.vsliveshare
tht13.html-preview-vscode
twxs.cmake
vscode-icons-team.vscode-icons
yzhang.markdown-all-in-one
Disabling all extensions except ms-vscode.cpptools, twxs.cmake and ms-vscode.cmake-tools did not resolve the problem.
CMake Tools Diagnostics
{
"os": "win32",
"vscodeVersion": "1.67.2",
"cmtVersion": "1.10.5",
"configurations": [
{
"folder": "d:\\temp\\cmake_test",
"cmakeVersion": "3.20.3",
"configured": true,
"generator": "Visual Studio 15 2017",
"usesPresets": false,
"compilers": {}
}
],
"cpptoolsIntegration": {
"isReady": true,
"hasCodeModel": true,
"activeBuildType": "Debug",
"buildTypesSeen": [
"Debug",
"Release",
"MinSizeRel",
"RelWithDebInfo"
],
"requests": [
"file:///d%3A/temp/cmake_test/main.cpp"
],
"responses": [
{
"uri": "file:///d%3A/temp/cmake_test/main.cpp",
"configuration": {
"defines": [
"WIN32",
"_WINDOWS",
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "c:/program files (x86)/microsoft visual studio/2017/professional/vc/tools/msvc/14.16.27023/bin/hostx64/x64/cl.exe",
"compilerArgs": [
"/DWIN32",
"/D_WINDOWS",
"/EHsc",
"/Zi",
"/Ob0",
"/Od",
"/RTC1",
"-MDd"
],
"forcedInclude": []
}
}
],
"partialMatches": [],
"targetCount": 3,
"executablesCount": 1,
"librariesCount": 0,
"targets": [
{
"name": "ALL_BUILD",
"type": "UTILITY"
},
{
"name": "ZERO_CHECK",
"type": "UTILITY"
},
{
"name": "cmake_test",
"type": "EXECUTABLE"
}
]
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": false
}
]
}
Debug Log
[main] Building folder: cmake_test
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build ALL_BUILD
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build d:/temp/cmake_test/build --config Debug --target ALL_BUILD -j 10 --
[build] Microsoft (R)-Build-Engine, Version 15.9.21+g9802d43bc3 für .NET Framework
[build] Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
[build]
[build] cmake_test.vcxproj -> D:\temp\cmake_test\build\Debug\cmake_test.exe
[cmakefileapi-parser] Read reply folder: d:\temp\cmake_test\build\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: ["cache-v2-980a6d47311a203dab4b.json","codemodel-v2-58e69dfe636bbba44f32.json","index-2022-06-01T09-31-38-0958.json","target-ALL_BUILD-Debug-91a196090d5775a66cd9.json","target-ALL_BUILD-MinSizeRel-91a196090d5775a66cd9.json","target-ALL_BUILD-Release-91a196090d5775a66cd9.json","target-ALL_BUILD-RelWithDebInfo-91a196090d5775a66cd9.json","target-cmake_test-Debug-8f03cceca3277767524a.json","target-cmake_test-MinSizeRel-843648a35f2a2201d1e2.json","target-cmake_test-Release-68bc7f63270a2e7d50a6.json","target-cmake_test-RelWithDebInfo-c52032589702cb55ae4a.json","target-ZERO_CHECK-Debug-434a17f91b7a4bbf371b.json","target-ZERO_CHECK-MinSizeRel-434a17f91b7a4bbf371b.json","target-ZERO_CHECK-Release-434a17f91b7a4bbf371b.json","target-ZERO_CHECK-RelWithDebInfo-434a17f91b7a4bbf371b.json","toolchains-v1-561ee6e580cc0310872a.json"]
[build] Build finished with exit code 0
[cache] Reading CMake cache file d:/temp/cmake_test/build/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [9721] cmake.build finished (returned 0)
Additional Information
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il comportamento dell'hover in main.cpp utilizzando le macro fornite, quindi traccia la gestione dell'hover e della documentazione dell'estensione C++ per le parole chiave delle classi definite dall'utente. Il lavoro è completato quando gli hover delle funzioni mostrano la documentazione delle funzioni per baz, baaz e baaaz, preservando i casi già funzionanti; aggiungi o esegui la copertura di regressione se viene identificata la posizione di test pertinente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, typescript, vscode
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100