Skip to content

Commit 61145aa

Browse files
committed
Added a new setting platformio-ide.autoOpenPlatformIOIniFile to control an automatic opening of the platformio.ini file from a project when no other editors are opened // Resolve platformio#2419
1 parent a81a097 commit 61145aa

File tree

3 files changed

+43
-34
lines changed

3 files changed

+43
-34
lines changed

CHANGELOG.md

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
## 2.3.1 (2021-??-??)
44

5+
- Added a new setting ``platformio-ide.autoOpenPlatformIOIniFile`` to control an automatic opening of the `platformio.ini` file from a project when no other editors are opened (issue [#2419](https://github.com/platformio/platformio-vscode-ide/issues/2419))
56
- Automatically activate project environment opened via "PIO Home > New Project / Open Project" (issue [#2414](https://github.com/platformio/platformio-vscode-ide/issues/2414))
67
- Do not show "Default" environment when a project does not have any build environments (issue [#2450](https://github.com/platformio/platformio-vscode-ide/issues/2450))
78

89
## 2.3.0 (2021-03-03)
910

1011
**Requires PlatformIO Core 5.1 or above**
1112

12-
* Project management:
13-
- Show active project in the status bar (issue [#2276](https://github.com/platformio/platformio-vscode-ide/issues/2276))
14-
- Automatically switch to the latest project on restart (issue [#2365](https://github.com/platformio/platformio-vscode-ide/issues/2365))
15-
- Automatically restore the latest project environment (issue [#2344](https://github.com/platformio/platformio-vscode-ide/issues/2344))
16-
* Allowed passing custom base URL of the Python Package Index using new `customPyPiIndexUrl` setting
17-
* Open ["platformio.ini" configuration file](https://docs.platformio.org/page/projectconf/index.html) from newly added project (if there are no other active editors) (issue [#2263](https://github.com/platformio/platformio-vscode-ide/issues/2263))
18-
* Updated PlatformIO Core installer to v1.0.0 ([release notes](https://github.com/platformio/platformio-core-installer/releases/tag/v1.0.0))
19-
* Added protection for infinite IntelliSense index rebuilding (issue [#2363](https://github.com/platformio/platformio-vscode-ide/issues/2363))
20-
* Added "OpenAPI (Swagger) Editor" extension to the conflicted list (issue [#2324](https://github.com/platformio/platformio-vscode-ide/issues/2324))
21-
* Fixed issues when the "Upload and Monitor" command didn't terminate the running task and didn't reopen a monitor with delay (issue [#2266](https://github.com/platformio/platformio-vscode-ide/issues/2266), issue [#2319](https://github.com/platformio/platformio-vscode-ide/issues/2319))
22-
* Fixed an issue with broken IntelliSense index rebuilding or tasks loading for big projects (issue [#2321](https://github.com/platformio/platformio-vscode-ide/issues/2321))
23-
* Fixed an issue when a debug breakpoint was not allowed for Assembly files
13+
- Project management:
14+
* Show active project in the status bar (issue [#2276](https://github.com/platformio/platformio-vscode-ide/issues/2276))
15+
* Automatically switch to the latest project on restart (issue [#2365](https://github.com/platformio/platformio-vscode-ide/issues/2365))
16+
* Automatically restore the latest project environment (issue [#2344](https://github.com/platformio/platformio-vscode-ide/issues/2344))
17+
- Allowed passing custom base URL of the Python Package Index using new `customPyPiIndexUrl` setting
18+
- Open ["platformio.ini" configuration file](https://docs.platformio.org/page/projectconf/index.html) from newly added project (if there are no other active editors) (issue [#2263](https://github.com/platformio/platformio-vscode-ide/issues/2263))
19+
- Updated PlatformIO Core installer to v1.0.0 ([release notes](https://github.com/platformio/platformio-core-installer/releases/tag/v1.0.0))
20+
- Added protection for infinite IntelliSense index rebuilding (issue [#2363](https://github.com/platformio/platformio-vscode-ide/issues/2363))
21+
- Added "OpenAPI (Swagger) Editor" extension to the conflicted list (issue [#2324](https://github.com/platformio/platformio-vscode-ide/issues/2324))
22+
- Fixed issues when the "Upload and Monitor" command didn't terminate the running task and didn't reopen a monitor with delay (issue [#2266](https://github.com/platformio/platformio-vscode-ide/issues/2266), issue [#2319](https://github.com/platformio/platformio-vscode-ide/issues/2319))
23+
- Fixed an issue with broken IntelliSense index rebuilding or tasks loading for big projects (issue [#2321](https://github.com/platformio/platformio-vscode-ide/issues/2321))
24+
- Fixed an issue when a debug breakpoint was not allowed for Assembly files
2425

2526
## 2.2.1 (2020-11-12)
2627

@@ -55,36 +56,36 @@
5556

5657
## 2.1.0 (2020-09-16)
5758

58-
* Added a new setting ``platformio-ide.autoPreloadEnvTasks`` to enable automatic preloading of the project environment tasks (issue [#2004](https://github.com/platformio/platformio-vscode-ide/issues/2004))
59-
* Renamed "PIO Remote" group of tasks to "Remote Development"
60-
* Updated PlatformIO Core installer to [v0.3.5](https://github.com/platformio/platformio-core-installer/releases/tag/v0.3.5)
59+
- Added a new setting ``platformio-ide.autoPreloadEnvTasks`` to enable automatic preloading of the project environment tasks (issue [#2004](https://github.com/platformio/platformio-vscode-ide/issues/2004))
60+
- Renamed "PIO Remote" group of tasks to "Remote Development"
61+
- Updated PlatformIO Core installer to [v0.3.5](https://github.com/platformio/platformio-core-installer/releases/tag/v0.3.5)
6162

6263
## 2.0.1 (2020-09-10)
6364

64-
* Moved "Project Tasks" view back to "PlatformIO" activity (you can now drag it to any location)
65+
- Moved "Project Tasks" view back to "PlatformIO" activity (you can now drag it to any location)
6566

6667
## 2.0.0 (2020-09-10)
6768

6869
**Requires PlatformIO Core 5.0 or above**
6970
**Requires VSCode 1.44 or above**
7071

71-
* New PlatformIO Task Explorer
72-
- Instant access to the Project Tasks within the VSCode Explorer
73-
- Grouped tasks: Generic, Advanced, PIO Remote, Platform, Custom, etc.
74-
- Support for PlatformIO dev-platform tasks (Program FPGA bitstream, Burn bootloader, Upload to FS, OTA Update, etc). The list of tasks depends on a particular dev-platform
75-
- Access to [User Custom Targets](https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#custom-targets)
76-
* New Project Environment Switcher
77-
- Switch between project environments declared in [platformio.ini](https://docs.platformio.org/en/latest/projectconf/index.html) project configuration file (issue [#544](https://github.com/platformio/platformio-vscode-ide/issues/544))
78-
- Activate IntelliSense service based on the current environment
79-
- Automatically generate a debugging configuration for the active environment
80-
* New PlatformIO IDE Installer
81-
- Added progress information
82-
- Switched to the cross-platform and portable [get-platformio.py](https://github.com/platformio/platformio-core-installer) installer script
83-
- Use built-in portable Python 3 on Windows and macOS (it can be disabled with ``platformio-ide.useBuiltinPython`` setting)
84-
* Added support for ``extends`` option in ``platformio.ini`` project configuration file (issue [#1371](https://github.com/platformio/platformio-vscode-ide/issues/1371))
85-
* Contribute PlatformIO Core CLI into VSCode's default Terminal
86-
* Reduced startup time (PlatformIO Core verification process)
87-
* Fixed a bug when hotkeys in PlatformIO Home did not work on macOS (issue [#606](https://github.com/platformio/platformio-vscode-ide/issues/606))
72+
- New PlatformIO Task Explorer
73+
* Instant access to the Project Tasks within the VSCode Explorer
74+
* Grouped tasks: Generic, Advanced, PIO Remote, Platform, Custom, etc.
75+
* Support for PlatformIO dev-platform tasks (Program FPGA bitstream, Burn bootloader, Upload to FS, OTA Update, etc). The list of tasks depends on a particular dev-platform
76+
* Access to [User Custom Targets](https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#custom-targets)
77+
- New Project Environment Switcher
78+
* Switch between project environments declared in [platformio.ini](https://docs.platformio.org/en/latest/projectconf/index.html) project configuration file (issue [#544](https://github.com/platformio/platformio-vscode-ide/issues/544))
79+
* Activate IntelliSense service based on the current environment
80+
* Automatically generate a debugging configuration for the active environment
81+
- New PlatformIO IDE Installer
82+
* Added progress information
83+
* Switched to the cross-platform and portable [get-platformio.py](https://github.com/platformio/platformio-core-installer) installer script
84+
* Use built-in portable Python 3 on Windows and macOS (it can be disabled with ``platformio-ide.useBuiltinPython`` setting)
85+
- Added support for ``extends`` option in ``platformio.ini`` project configuration file (issue [#1371](https://github.com/platformio/platformio-vscode-ide/issues/1371))
86+
- Contribute PlatformIO Core CLI into VSCode's default Terminal
87+
- Reduced startup time (PlatformIO Core verification process)
88+
- Fixed a bug when hotkeys in PlatformIO Home did not work on macOS (issue [#606](https://github.com/platformio/platformio-vscode-ide/issues/606))
8889

8990
## 1.10.0 (2019-11-20)
9091

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,11 @@
517517
"default": false,
518518
"description": "Activate the PlatformIO extension only when a PlatformIO-based project (with `platformio.ini`) is opened in the workspace"
519519
},
520+
"platformio-ide.autoOpenPlatformIOIniFile": {
521+
"type": "boolean",
522+
"default": true,
523+
"description": "Automatically open the `platformio.ini` file from a project when no other editors are opened"
524+
},
520525
"platformio-ide.autoCloseSerialMonitor": {
521526
"type": "boolean",
522527
"default": true,

src/project/observable.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ export default class ProjectObservable {
186186
this._taskManager = new ProjectTaskManager(projectDir, observer);
187187

188188
// open "platformio.ini" if no visible editors
189-
if (vscode.window.visibleTextEditors.length === 0) {
189+
if (
190+
vscode.window.visibleTextEditors.length === 0 &&
191+
extension.getSetting('autoOpenPlatformIOIniFile')
192+
) {
190193
vscode.window.showTextDocument(
191194
vscode.Uri.file(path.join(projectDir, 'platformio.ini'))
192195
);

0 commit comments

Comments
 (0)