Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C language 'Go to Definition' recognition function error #3609

Closed
JasonLeeCn opened this issue May 8, 2019 · 2 comments
Closed

C language 'Go to Definition' recognition function error #3609

JasonLeeCn opened this issue May 8, 2019 · 2 comments
Labels
bug Feature: Go to Definition An issue related to Go to Definition/Declaration. fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@JasonLeeCn
Copy link

Issue Type: Bug

If the function without parameter, but the function declaration with 'void' in header file. In other file (not the function entity file) call the function. Using F12 (Go to Definition), the editor will just jump to the header file, not the function entify '*.c' file.

Eg.:
file1: testA.c
void test_a()
{
/* function entity*/
}

file2: testA.h
extern void test_a(void);

file3: testB.c
#include "testA.h"

void test_b(void)
{
test_a();
}

When 'Go to Definition' to test_a(); the editor will jump to testA.h file not testA.c file. But if testA.c is
void test_a(void)
{
/* function entity */
}
It can jump to the testA.c file.

Extension version: 0.23.0
VS Code version: Code 1.33.1 (51b0b28134d51361cf996d2f0a1c698247aeabd8, 2019-04-11T08:27:14.102Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (4 x 2496)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 7.66GB (3.48GB free)
Process Argv D:\Workspace\Projects\EB_QL_02\03_Software_Design\Trunk\EB_PMSM
Screen Reader no
VM 0%
@sean-mcmanus sean-mcmanus self-assigned this May 9, 2019
@sean-mcmanus sean-mcmanus added bug Feature: Go to Definition An issue related to Go to Definition/Declaration. Language Service fixed Check the Milestone for the release in which the fix is or will be available. labels May 9, 2019
@sean-mcmanus sean-mcmanus added this to the June 2019 milestone May 9, 2019
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented May 9, 2019

Thanks a lot for reporting this -- we fixed a similar bug a 6 months ago, but we missed this case. It's caused by "void" being missing in the param list of the definition. It should be fixed in our next release.

This particularly issues only repros with .c files (not .cpp).

@sean-mcmanus
Copy link
Contributor

Fixed with 0.24.0-insiders (available by setting "C_Cpp.updateChannel" to "Insiders").

@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Go to Definition An issue related to Go to Definition/Declaration. fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Projects
None yet
Development

No branches or pull requests

2 participants