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

support relative paths for forcedInclude #2780

Closed
pagdot opened this issue Nov 6, 2018 · 13 comments
Closed

support relative paths for forcedInclude #2780

pagdot opened this issue Nov 6, 2018 · 13 comments
Assignees
Labels
embedded Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@pagdot
Copy link

pagdot commented Nov 6, 2018

I'd like forcedInclude to use the specified include paths. At the moment it is necessary to specify the full path.

@bobbrow
Copy link
Member

bobbrow commented Nov 7, 2018

What exactly do you mean? "forcedInclude": "foo.h" will use the "includePath" to locate foo.h?

@pagdot
Copy link
Author

pagdot commented Nov 9, 2018

I've included headerfiles from included folders, but they don't get included unless I specify them with full path

@bobbrow bobbrow changed the title use include paths on forcedInclude support relative paths for forcedInclude Nov 9, 2018
@sean-mcmanus
Copy link
Contributor

This looks like it would be an easy bug for us to fix -- we fixed it 4 months ago for forced includes that are specified in the compile_commands (i.e. if a non-valid path is in forcedInclude, then try appending each includePath to find the first one that is valid).

@ivankravets
Copy link

PlatformIO users also experience this issue platformio/platformio-core#3379

How is it difficult to fix it? Do we have any workarounds?

/cc @valeros , @sstaub

@pagdot
Copy link
Author

pagdot commented Feb 14, 2020

@ivankravets I just took a (quick) look into it and it may be a problem with the actual (external) languageserver. I don't think it is open source :/ because there are only links to binaries.

@ivankravets
Copy link

I don't think it is open source

This extension is open source. Microsoft claims that VSCode is open source.

@pagdot
Copy link
Author

pagdot commented Feb 14, 2020

Yeah, kind of... But it seems to use a closed source language server. In the package.json Line 1779 is the download link for binaries containing the languageserver. This repo only seem to contain the client. I haven't seen a reference to the source of the actual languageserver. If you find its source I will take a look into it

@ivankravets
Copy link

But it seems to use a closed source language server

This is the main reason why do we have a lot of issues and a slow development process. The community can't contribute and help.

@robotdad what is a reason for keeping this project close sourced?

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Feb 14, 2020

  • It's easy to fix. See my comment support relative paths for forcedInclude #2780 (comment) .
  • But you're correct that the fix is in our closed source language server.
  • The main reason the language server is closed source is because our parser is licensed from another company's closed source parser. There are potential changes in the (not short term) future that could allow us to open source more code.
  • One potential workaround is to convert the relative paths to absolute paths yourselves, via the same method we would do (appending the relative path onto each includePath in succession until a valid path is found).

@ivankravets
Copy link

@sean-mcmanus thanks so much for the quick answer! Yes, I got you. We did a quick fix on our side platformio/platformio-core@fbfbf34 and plan to publish bugfix release of PIO Core 4.2.1 next week.

Could you check this mbed/.vscode/c_cpp_properties.json https://pastebin.com/RfiSbpTZ?

  • Are structure and data goo?
  • Do you have any hints/recommendations?
  • Is it OK that we have empty `""`` blocks in arrays? It is simpler for us to generate this config.

Thanks!

@sean-mcmanus
Copy link
Contributor

@ivankravets The data looks fine to me. The empty "" in arrays is fine -- we just ignore them. I don't have any hints/recommendations.

@bobbrow bobbrow modified the milestones: On Deck, 1.0.0 Mar 31, 2020
@elahehrashedi elahehrashedi added the fixed Check the Milestone for the release in which the fix is or will be available. label Apr 13, 2020
@sean-mcmanus
Copy link
Contributor

@elahehrashedi
Copy link
Contributor

This issue is fixed in 0.28.0.
0.28.0 release: https://github.com/microsoft/vscode-cpptools/releases/tag/0.28.0

@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
embedded Feature Request 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

6 participants