Cannot detect platformio.ini if it is not in parent directory of Arduino INO project file
Windows, Linux, Mac
Cannot detect platformio.ini if it is not in parent directory of Arduino INO project file
https://docs.platformio.org/en/latest/projectconf/section_platformio.html
Repro:
Clone repo: https://github.com/openenergymonitor/open_evse Open the file "firmware/open_evse.ino" Observe environment selection not available from Deviot menu
Expected Results
There should be 3 envs available for selection
Notes:
Standard PIO doesn't require the INO file as Arduino IDE does but instead basis project configuration off the "platformio.ini" file so does not have a problem. Other IDEs have addressed this by making the user use "Open Directory" or open the platformio.ini file directly so that the configuration can be immediately identified (it is required to be at the root of the opened directory for the PlatformIO extension for VSCode for example).
Would an easy solution be to keep the current behavior, but if the user has the 'platformio.ini' file open and attempts to select Environment, Deviot could use the "environment" sections present in the INI file, and if the user instead opens the INO file, either use the current behavior of using the INO to guess the board, or just allow the standard PIO board selection (no ENV selection available if Deviot cannot determine location of "platformio.ini" file because it is too many directories up) ?
-=dave
Any thoughts on how we could hack this to work ? I love Deviot so much better than VSCode, but it's becoming a workflow problem to have to keep switching between ST3 and VSCode for Editor/Compile.
Would a hack simply be to extend search for platformio.ini up an additional directory (or perhaps make the parent directory INI search limit configurable with a user preference ?
Thanks for all your hard work on this great project !
-=dave
Would #276 be a way to try and accomplish this ? (yes, I know it's a hack :cry: )
Hey @fiveangle as you mentioned, deviot only check the current folder (based on the opened file) or one folder up.
I'm seeing your hack is working for you, I could add a recursive search for the platformio.ini but I do not know if that is the best solution. I think it could be better to ask to select the platformio.ini file when it's not found
what do you think?
I agree that asking user to set the platformio.ini file is the best solution and eliminates potential confusion when it cannot be found using current behavior.