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

Intellisense issues with KEIL extensions #3222

Open
zoharshemesh opened this issue Feb 26, 2019 · 30 comments
Open

Intellisense issues with KEIL extensions #3222

zoharshemesh opened this issue Feb 26, 2019 · 30 comments

Comments

@zoharshemesh
Copy link

Hello
I am running VSCODE with the c/c++ extension by Microsoft.
I have configured the extensions c_cpp_properties.json correctly.
I can jump to definitions of any symbols in the opened folder correctly.
Yet the auto-completion is not working, nor the function suggestions (e.g. arguments)
When I start typing a variable name, a project level menu list is showed (literally every symbol in the entire project).
Additionally, structures/unions members have not suggested upon typing [. or ->) symbols.
Is something misconfigured, or is this bug/unimplemented behavior?

Thanks.

@bobbrow
Copy link
Member

bobbrow commented Feb 26, 2019

Do you see any "problems" in the problems window? When this happens (getting every symbol in the project), it is usually because a #include statement didn't resolve. You can try setting "C_Cpp.intelliSenseEngineFallback": "Disabled" to turn off this behavior. We plan to disable this by default in the future due to the confusion it generally causes.

@sean-mcmanus sean-mcmanus added Language Service more info needed The issue report is not actionable in its current state labels Feb 26, 2019
@zoharshemesh
Copy link
Author

Hello,
Thanks for your response.
I am an embedded RT team leader developing mostly in C language.
We are using KEIL uVision but would like to use a different more language-awareness editor. I have bought SlickEdit editor, which works perfectly by simply open SlickEdit project (@ KEIL workspace location). SlickEdit detects the projects symbols, functions, tooltip, structures members etc. perfectly (without any additional user involvement).
We have many problems getting the same results using VSCode.
VSCode detects all project (and workspace) functions, structures, members (F12, goto definitions is working perfectly), but fails to 'connect' the members to the structures (e.g. by CTRL+SPACE, or . or ->), nighter it hints about the function arguments (again although it detects the function location and definition).
I would like to use VSCode and drop SlickEdit depend (maintenance, updates etc.)
I have surfed and read every forum related to the subject, but unable to find any (easy) solution.
I still didn't give up yet :)

Yours,
Zohar Shemesh

@bobbrow
Copy link
Member

bobbrow commented Feb 27, 2019

This is what I mean:

  1. Check the Problems window and see if you have something like "#include errors detected". If this is the case, you might be seeing the wrong member list for structs/classes/etc.
    image

  2. If this is the case, move the cursor to the green squiggled #include, click the lightbulb and update your include path or choose "force semantic IntelliSense" if you don't want to configure it right now:
    image

  3. If you choose to ignore the error and force semantic IntelliSense, then the member list will look like what you expect:
    image

Also, we don't natively support Keil intrinsics and keywords. You will have to workaround this problem by adding them to the c_cpp_properties.json file in the "defines" array and assigning them to nothing so that our compiler skips over them. For example:

    "defines": [
        "task=",
        "priority="
    ]

@zoharshemesh
Copy link
Author

zoharshemesh commented Feb 27, 2019 via email

@bobbrow
Copy link
Member

bobbrow commented Feb 27, 2019

Sorry, the image did not appear. Can you try again?

@zoharshemesh
Copy link
Author

zoharshemesh commented Feb 27, 2019 via email

@bobbrow
Copy link
Member

bobbrow commented Feb 27, 2019

I think you'll need to add it through the web interface. Replying to the email notification with an image is not working (and it's posting your personal information online... I deleted it for you).

@zoharshemesh
Copy link
Author

zoharshemesh commented Feb 27, 2019 via email

@zoharshemesh
Copy link
Author

image

@bobbrow
Copy link
Member

bobbrow commented Feb 27, 2019

There could be an error somewhere that is causing the variable not to be defined. If you hover the mouse over TaskTimers do you get a tooltip with information about the variable?

@zoharshemesh
Copy link
Author

zoharshemesh commented Feb 27, 2019

No, I get: "<error-type> TaskTimers"

@bobbrow
Copy link
Member

bobbrow commented Feb 27, 2019

Can you go to the declaration of TaskTimers and see if there is an error squiggle nearby?

Just a reminder that we don't support Keil keywords, so it's highly possible our compiler is getting confused by them and skipping over some variable declarations during its error recovery.

@zoharshemesh
Copy link
Author

Hi,
This is no KEIL related, the TaskTimers is TMR_ST simple structure:
image

@bobbrow
Copy link
Member

bobbrow commented Feb 27, 2019

Can you look at the place in the code where TaskTimers is delcared?

@zoharshemesh
Copy link
Author

zoharshemesh commented Feb 27, 2019 via email

@bobbrow
Copy link
Member

bobbrow commented Feb 27, 2019

If you hover over TaskTimers in that line where it is declared, does the tooltip look right?
We are US West (Pacific)

@zoharshemesh
Copy link
Author

zoharshemesh commented Feb 27, 2019

I get the following tooltip
<error-type> TaskTimers
Thanks

@zoharshemesh
Copy link
Author

Getting error-type

@bobbrow
Copy link
Member

bobbrow commented Feb 27, 2019

Ok, so the problem is somewhere in that file causing TMR_ST to not be defined. Could be in one of the includes, or a squiggle in the file where TaskTimers is declared.

Are you able to reproduce this problem in a small project that you can send us? It may be faster for us to investigate that way.

@zoharshemesh
Copy link
Author

I will try to build a small project Tomorrow.
Thanks for your attention and help
Yours
Zohar Shemesh

@zoharshemesh
Copy link
Author

Hi,
So I have played with the settings and folders, I have opened a folder, which contains two files.
VSCode does not detect any problems (although there are lots of missing definitions), when I hover over
SysTick.zip

structures, which are declared in the header file, VScode show the methods/structures tooltip but fails to extract the members (same issue).
I have attached those file for you (again, I am using VScode 'open folder' feature).
Thanks,
Zohar Shemesh

@bobbrow
Copy link
Member

bobbrow commented Feb 28, 2019

After fixing the SysTick.c file to include the SysTick.h file, I was able to get suggestions for data members:
image

However, some of the nested struct members didn't resolve because their fields were not understood by the compiler:
image
image

Forcing definition of missing data types (which I assume are Keil intrinsics) fixes this issue (add this to your c_cpp_properties.json file:
image
image

If you add the intrinsics to your configuration, does it help resolve your issue? Or is there something else I'm missing?

@zoharshemesh
Copy link
Author

I have tried that, somehow when I force fuzzy, some of the structure members appears.
This is very odd, I have a lot of files in my project (more than 60), it is very difficult and annoying to review each file for problems...
I think I will stay with SlickEdit for know (it does the same thing without any User modification or special handling).

I really appreciate your help!
Thanks so much.
Yours,
Zohar Shemesh

@bobbrow
Copy link
Member

bobbrow commented Feb 28, 2019

Fuzzy IntelliSense doesn't do any type checking. It's strictly a syntactical parser, so it's not as accurate with suggestions. Unfortunately, we don't support KEIL extensions in the semantic parser, so we can't provide accurate suggestions without additional configuration.

@bobbrow bobbrow added Feature Request and removed more info needed The issue report is not actionable in its current state labels Feb 28, 2019
@bobbrow bobbrow changed the title Intellisense issues Intellisense issues with KEIL extensions Feb 28, 2019
@zoharshemesh
Copy link
Author

There is nothing related to KEIL, just to correct parse the header files. F12 is perfectly works on all structure names, members and functions.
So I am really confuse, why structure members behaves differently.

Yours,
Zohar Shemesh

@bobbrow
Copy link
Member

bobbrow commented Feb 28, 2019

The example you sent me had trouble only because of KEIL extensions. If you can describe the problem or provide a different example that shows KEIL is not the cause, then I can investigate more.

@Colengms Colengms added this to the Triage milestone May 8, 2020
@github-actions
Copy link

This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog.

@github-actions github-actions bot added the more votes needed Issues that have been postponed until more community members upvote it label Oct 17, 2020
@denis-shienkov
Copy link

Hi guys, it would be good to have the support not only for the Keil toolchain, but also for the:

  • IAR EW toolchain (for all supported architectures with a custom keywords, include AVR, 8051 and etc).
  • KEIL toolchain (for C51, C251, C166, ARM architecures).
  • SDCC toolchain (for 8051, Z80, STM8 and other architectures)

@github-actions
Copy link

This feature request has received enough votes to be added to our backlog.

@wsytlzdh
Copy link

there are many embeded developer /project using c/c++. so that will be great to support this. and anybody can tell me is there any milestone? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants