Skip to content

${env} isn't processed in C_Cpp.default.includePath #3309

Closed

Description

@ijash

Type: LanguageService

Describe the bug

  • OS and Version: Linux mint 19.01
  • VS Code Version: 1.32.3
  • C/C++ Extension Version:0.21
  • Other extension: arduino 0.2.25

I can't get the C_Cpp.default.IncludePath get to work. please see details below.

To Reproduce

  1. i have followed the instruction in https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Customizing%20Default%20Settings.md
  2. my settings.json is
{    "C_Cpp.default.includePath": [
        "${env.HOME}/.arduino"
        ]
}

my c_cpp_properties.json is:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "/opt/arduino/arduino-1.8.8/tools/**",
                "/opt/arduino/arduino-1.8.8/hardware/arduino/avr/**",
                "${default}"
            ],
            "forcedInclude": [
                "/opt/arduino/arduino-1.8.8/hardware/arduino/avr/cores/arduino/Arduino.h"
            ],
            "intelliSenseMode": "gcc-x64",
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17"
        }
    ],
    "version": 4
}

mostly auto generated except ${default}

  1. i write in main.ino which use C++ language as follows:
#include <MFRC522.h>

and got a problem Include file not found in browse.path.

  1. BUT, when i move the "${env.HOME}/.arduino" to c_cpp_properties.json inside configurations->includePath array, the problem disappears.

Expected behavior

I expect something like global configuration or default configuration in settings.json so i don't have to re-write configuration each new project to c_cpp_properties.json. and my expectation is the same as issue #368 (comment)

Screenshots

this is the current problem:
image

this is the behavior after i edit the c_cpp_properties.json:
image

Additional context

-none

Activity

  1. sean-mcmanus commented on Mar 18, 2019

    @sean-mcmanus
    Contributor

    You mention systemIncludePath and includePath -- which one are you actually using?

    The "Include file not found in browse.path." is when the browse.path isn't set corectly (i.e. IntelliSense is not being used). It's possible the bug is that we're not correctly copying over the C_Cpp.default.includePath setting into the browse.path.

  2. ijash commented on Mar 18, 2019

    @ijash
    Author

    You mention systemIncludePath and includePath -- which one are you actually using?

    The "Include file not found in browse.path." is when the browse.path isn't set corectly (i.e. IntelliSense is not being used). It's possible the bug is that we're not correctly copying over the C_Cpp.default.includePath setting into the browse.path.

    my bad, it's IncludePath. i've updated the post.

    you mention :

    not correctly copying over the C_Cpp.default.includePath setting into the browse.path.

    and how to do that?

  3. sean-mcmanus commented on Mar 18, 2019

    @sean-mcmanus
    Contributor

    Our code is supposed to do that copying -- the bug could be that we don't do that correctly...I'll double check.

  4. ijash commented on Mar 18, 2019

    @ijash
    Author

    Our code is supposed to do that copying -- the bug could be that we don't do that correctly...I'll double check.

    thank you, if anything I am able to provide for help, please let me know.

  5. sean-mcmanus commented on Mar 18, 2019

    @sean-mcmanus
    Contributor

    I reproed the bug -- the problem is we aren't not processing the "${env}" when they're in the "default" settings.

  6. changed the title [-]C_Cpp.default.systemIncludePath is not working. the same value only works in c_cpp_properties.json[/-] [+]${env} isn't processed in C_Cpp.default.includePath[/+] on Mar 18, 2019
  7. sean-mcmanus commented on Mar 18, 2019

    @sean-mcmanus
    Contributor

    Thanks for reporting this. We have a fix at #3310, but I don't know if it will make into 0.22.0 yet (otherwise, it'll be in the release after that).

  8. ijash commented on Mar 19, 2019

    @ijash
    Author

    Thanks for reporting this. We have a fix at #3310, but I don't know if it will make into 0.22.0 yet (otherwise, it'll be in the release after that).

    thank you for updating this issue, looking forward in the next linux release.

  9. sean-mcmanus commented on Mar 21, 2019

    @sean-mcmanus
    Contributor

    0.22.0 has the fix for ${env.HOME} not working in the "default.*" settings.

  10. locked and limited conversation to collaborators on Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.quick fix

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions