Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Fixed an issue when Atom has become unresponsive // Resolve #2444
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Sep 14, 2020
1 parent dadbd2a commit 8da87e5
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
8 changes: 6 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

# 2.7.2

* Fixed an issue when Atom has become unresponsive (issue [#2444](https://github.com/platformio/platformio-atom-ide/issues/2444))

## 2.7.1 (2020-06-14)

* Fixed an error "ENOENT: no such file or directory, open '~/.platformio/homestate.json'"
Expand Down Expand Up @@ -160,8 +164,8 @@
## 2.0.0 (2018-01-23)

* PlatformIO Home
- PIO Account
- Library Manager
- PIO Account
- Library Manager
- Board Explorer
- Platform Manager
* New PlatformIO IDE Installer
Expand Down
33 changes: 17 additions & 16 deletions lib/installer/python-prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
* the root directory of this source tree.
*/

import * as pioNodeHelpers from 'platformio-node-helpers';
import * as config from '../config';
import * as utils from '../utils';

import fs from 'fs-plus';
import path from 'path';


export default class PythonPrompt {

Expand All @@ -19,15 +22,14 @@ export default class PythonPrompt {
STATUS_CUSTOMEXE = 2;

async prompt() {
let pythonExecutable = null;
const selectedItem = atom.confirm({
message: 'PlatformIO: Can not find Python 2.7 Interpreter',
message: 'PlatformIO: Can not find Python 3.5+ Interpreter',
detailedMessage: 'PlatformIO Core is written in Python and depends on it. ' +
'Please install Python 2.7 (PYTHON 3 IS NOT SUPPORTED YET) or ' +
'if you have it, please choose a directory where "python/python.exe" program is located.',
'Please install Python 3.5+ or ' +
'if you have it, please choose a directory where "python3/python.exe" program is located.',
buttons: [
'Install Python 2.7',
'I have Python 2.7',
'Install Python 3',
'I have Python 3',
'Try again',
'Abort PlatformIO IDE Installation'
]
Expand All @@ -39,15 +41,14 @@ export default class PythonPrompt {
return { status: this.STATUS_TRY_AGAIN };

case 1:
pythonExecutable = await pioNodeHelpers.misc.getPythonExecutable(
atom.config.get('platformio-ide.useBuiltinPIOCore'),
await this.chooseCustomPythonDirs()
);
if (pythonExecutable) {
return {
status: this.STATUS_CUSTOMEXE,
pythonExecutable
};
for (const d in (await this.chooseCustomPythonDirs() || [])) {
const pythonExecutable = path.join(d, config.IS_WINDOWS ? 'python.exe' : 'python3');
if (fs.isFileSync(pythonExecutable)) {
return {
status: this.STATUS_CUSTOMEXE,
pythonExecutable
};
}
}
return { status: this.STATUS_TRY_AGAIN };

Expand Down
2 changes: 1 addition & 1 deletion lib/installer/stages/code-completion-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class CodeCompletionEngineStage extends BaseStage {

async clangInstalled() {
return new Promise(resolve => {
pioNodeHelpers.misc.runCommand('clang', ['--version'], code => resolve(code === 0));
pioNodeHelpers.proc.runCommand('clang', ['--version'], code => resolve(code === 0));
});
}

Expand Down
4 changes: 2 additions & 2 deletions lib/services/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { getTerminalViews, runCmdsInTerminal } from './terminal';

import { TERMINAL_REOPEN_DELAY } from '../config';
import { debugProject } from './debugger';
import { isPIOProject } from '../utils';
import fs from 'fs';
import { isPIOProject } from '../utils';

export default class BuildProvider {

Expand All @@ -33,7 +33,7 @@ export default class BuildProvider {

async settings() {
const pt = new pioNodeHelpers.project.ProjectTasks(this.projectDir, 'atom');
return (await pt.getGenericTasks())
return (await pt.getGeneralTasks())
.filter(task => !(task.coreTarget === 'upload' && task.args.includes('monitor')))
.map(task => {
if (task.coreTarget === 'debug') {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function runAPMCommand(args, callback, options = {}) {
if (options.busyTitle) {
beginBusy(options.busyTitle);
}
pioNodeHelpers.misc.runCommand(
pioNodeHelpers.proc.runCommand(
atom.packages.getApmPath(),
['--no-color', ...args],
(code, stdout, stderr) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"command-join": "^3.0.0",
"etch": "^0.14.0",
"fs-plus": "^3.0.1",
"platformio-node-helpers": "~7.0.1",
"platformio-node-helpers": "~7.2.0",
"semver": "^6.2.0"
},
"devDependencies": {
Expand Down

0 comments on commit 8da87e5

Please sign in to comment.