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 doesn't work without #include <Arduino.h> #55

Closed
zeroamps opened this issue Feb 19, 2021 · 17 comments
Closed

IntelliSense doesn't work without #include <Arduino.h> #55

zeroamps opened this issue Feb 19, 2021 · 17 comments
Assignees
Labels
status: waiting for information More information must be provided before work can proceed topic: language server Related to the Arduino Language Server type: imperfection Perceived defect in any part of project

Comments

@zeroamps
Copy link

IntelliSense doesn't work correctly.
After adding #include <Arduino.h> it starts working fine.

Screenshots
image

Desktop

  • OS: Windows 10
  • Arduino PRO IDE : 0.1.4.
@kittaakos
Copy link
Contributor

@chovanj, which board did you select? At the moment, the language features do not start until you pick a board.

@zeroamps
Copy link
Author

@chovanj, which board did you select? At the moment, the language features do not start until you pick a board.

image

@kittaakos
Copy link
Contributor

Do you see any errors in the console if you start the app from CMD.exe?

@kittaakos
Copy link
Contributor

Also, do you see an error like Couldn't start client Arduino Language Server (or similar) when you start the app?
You can see the notification center by clicking on this icon:
Screen Shot 2021-02-19 at 17 29 49

@zeroamps
Copy link
Author

No, there are no messages in the status bar.

@kittaakos
Copy link
Contributor

Can you please enable the language server logs and share them with us?


Please follow the steps if you want to help us figure out what's wrong:

  • create a new sketch,
  • save it (so that you will find it later in your Sketchbook),
  • open the preferences with Ctrl+,,
  • select Enable language server logging,
    image
  • and pick a board; you can reselect the current one. (The last steps should trigger the language server restart.)

You will find a few log files in the sketch folder; could you please attach them to this issue? Thank you!

@kittaakos
Copy link
Contributor

By the way, did you install the platform for the Uno board?

@zeroamps
Copy link
Author

By the way, did you install the platform for the Uno board?

Hi, from this video it could be more obvious.

GIF 2-23-2021 2-56-36 PM

@kittaakos
Copy link
Contributor

from this video it could be more obvious.

Could you please share the log files with us to make this more obvious? Thanks!

@rsora rsora transferred this issue from arduino/arduino-pro-ide Mar 1, 2021
@silvanocerza silvanocerza added type: bug status: waiting for information More information must be provided before work can proceed labels Mar 1, 2021
@mink99
Copy link

mink99 commented Apr 17, 2021

This seems to be a conceptual/design error in the clang integration.
The compilation path is well known in the ide, but the clang tool is fed with a different source of information, which is obviously faulty. Providing two different sources of information, the compile path generated correctly, and the clang include path not will or has resulted already in many similar bugs.

You may see that the IDE had not even tried to parse the libraries, regardless of whether the project is using an included system library (referring to Arduino.h) or a user library (referring to nmidi.h in my example)
inols-clangd.log
inols-clangd-err.log

@mink99
Copy link

mink99 commented Apr 18, 2021

Simple partial Fix:
create a clangd configuration file in your home directory (see : https://clangd.llvm.org/config.html) like this

CompileFlags:
       Add:    -I K:\Develop\Libraries

now clangd will parse the #includes, (even by magic the <arduino.h>)

please note:
K:\Develop is my sketch folder, therefore K:\Develop\Libraries is my libraries folder

of course the correct solution would be to create a project configuration file (.clandgd) in the current source tree and put the well known library path , system and user in there.

@mink99
Copy link

mink99 commented Apr 18, 2021

no <arduino.h> included :
Image3

@per1234 per1234 removed the status: waiting for information More information must be provided before work can proceed label Sep 8, 2021
@cmaglie cmaglie removed the type: bug label Sep 16, 2021
@rsora rsora added type: imperfection Perceived defect in any part of project topic: language server Related to the Arduino Language Server labels Sep 22, 2021
@per1234
Copy link
Contributor

per1234 commented Dec 13, 2021

Thanks for your reports @zeroamps and @mink99 . There have been some recent improvements to the Arduino Language Server that provides this capability in the IDE. These improvements are available from the latest release of the Arduino IDE.

Please try again with the latest build of the Arduino IDE and let us know whether or not the bug is fixed for you.

@per1234 per1234 added the status: waiting for information More information must be provided before work can proceed label Dec 13, 2021
@per1234
Copy link
Contributor

per1234 commented Mar 11, 2022

Closing due to lack of response.

@zeroamps and @mink99 if you will provide the requested information by commenting here, I'll be happy to re-open this issue.

@per1234 per1234 closed this as completed Mar 11, 2022
@per1234 per1234 assigned per1234 and unassigned cmaglie Mar 11, 2022
@mink99
Copy link

mink99 commented Mar 11, 2022

Tried, and did not work....
Did you try the recommended fix (.clangd as mentioned above ) ?

@mink99
Copy link

mink99 commented Mar 11, 2022

The bug is not about Arduino.h. it is about all external libraries that are not in the project directory, but are used in an include <blablabla.h> statement, or as described above, the compilation path is not provided to the language parser.

@mink99
Copy link

mink99 commented Mar 11, 2022

It seems you even broke the simple fix with .clangd with the latest update :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for information More information must be provided before work can proceed topic: language server Related to the Arduino Language Server type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

8 participants