Skip to content

Commit 6e69172

Browse files
committed
Skip missing linting API if ancient PIO Core is used
1 parent 9d1eb74 commit 6e69172

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/project/manager.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,19 @@ export default class ProjectManager {
192192

193193
// validate configuration file
194194
const configUri = vscode.Uri.file(path.join(projectDir, 'platformio.ini'));
195-
const isConfigValid = await this._configProvider.lintConfig(configUri);
196-
if (!isConfigValid) {
197-
vscode.window.showErrorMessage(
198-
'The project configuration process has encountered an error due to ' +
199-
"a problem with the 'platformio.ini' file. " +
200-
'Please review the file and fix the issues.'
201-
);
202-
vscode.window.showTextDocument(configUri);
203-
return;
195+
try {
196+
const isConfigValid = await this._configProvider.lintConfig(configUri);
197+
if (!isConfigValid) {
198+
vscode.window.showErrorMessage(
199+
'The project configuration process has encountered an error due to ' +
200+
"a problem with the 'platformio.ini' file. " +
201+
'Please review the file and fix the issues.'
202+
);
203+
vscode.window.showTextDocument(configUri);
204+
return;
205+
}
206+
} catch (err) {
207+
console.error(err);
204208
}
205209

206210
if ('env' in options) {

0 commit comments

Comments
 (0)