-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial doctor function * check settings fs access * add idf tools validation * add report file * refactor ignore result files * Delete result.json * add system info * launch cpp json files * add ru i18n cmd title * add cmd to readme
- Loading branch information
1 parent
1419c4c
commit 8c55198
Showing
30 changed files
with
1,049 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ testFiles/tools | |
bandit_output.txt | ||
flake8_output.txt | ||
results/ | ||
report.txt | ||
report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,5 @@ package-lock.json | |
node_modules | ||
gulpfile.js | ||
.yarnrc | ||
report.txt | ||
report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Project: ESP-IDF VSCode Extension | ||
* File Created: Wednesday, 30th December 2020 4:45:23 pm | ||
* Copyright 2020 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { join } from "path"; | ||
import * as vscode from "vscode"; | ||
import { execChildProcess } from "./execChildProcess"; | ||
import { reportObj } from "./types"; | ||
|
||
export async function checkEspIdfRequirements( | ||
reportedResult: reportObj, | ||
context: vscode.ExtensionContext | ||
) { | ||
const requirementsPath = join( | ||
reportedResult.configurationSettings.espIdfPath, | ||
"requirements.txt" | ||
); | ||
const result = await checkRequirements( | ||
context, | ||
reportedResult, | ||
requirementsPath | ||
); | ||
reportedResult.idfCheckRequirements.output = result; | ||
reportedResult.idfCheckRequirements.result = result; | ||
} | ||
|
||
export async function checkRequirements( | ||
context: vscode.ExtensionContext, | ||
reportedResult: reportObj, | ||
requirementsPath: string | ||
) { | ||
const checkPythonDepsScript = join( | ||
reportedResult.configurationSettings.espIdfPath, | ||
"tools", | ||
"check_python_dependencies.py" | ||
); | ||
const modifiedEnv: { [key: string]: string } = <{ [key: string]: string }>( | ||
Object.assign({}, process.env) | ||
); | ||
modifiedEnv.IDF_PATH = reportedResult.configurationSettings.espIdfPath; | ||
const requirementsResult = await execChildProcess( | ||
`${reportedResult.configurationSettings.pythonBinPath} ${checkPythonDepsScript} -r "${requirementsPath}"`, | ||
context.extensionPath, | ||
{ env: modifiedEnv, cwd: context.extensionPath } | ||
); | ||
return requirementsResult.trim(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Project: ESP-IDF VSCode Extension | ||
* File Created: Wednesday, 30th December 2020 4:40:28 pm | ||
* Copyright 2020 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { pathExists, readJSON } from "fs-extra"; | ||
import { join } from "path"; | ||
import * as vscode from "vscode"; | ||
import { IdfToolsManager } from "../idfToolsManager"; | ||
import { PlatformInformation } from "../PlatformInformation"; | ||
import { OutputChannel } from "../logger/outputChannel"; | ||
import { reportObj } from "./types"; | ||
|
||
export async function checkEspIdfTools( | ||
reportedResult: reportObj, | ||
context: vscode.ExtensionContext | ||
) { | ||
const platformInfo = await PlatformInformation.GetPlatformInformation(); | ||
let toolsJsonPath: string = join( | ||
reportedResult.configurationSettings.espIdfPath, | ||
"tools", | ||
"tools.json" | ||
); | ||
const jsonExists = await pathExists(toolsJsonPath); | ||
if (!jsonExists) { | ||
const idfToolsJsonToUse = | ||
reportedResult.espIdfVersion.result.localeCompare("4.0") < 0 | ||
? "fallback-tools.json" | ||
: "tools.json"; | ||
toolsJsonPath = join(context.extensionPath, idfToolsJsonToUse); | ||
} | ||
const toolsJson = await readJSON(toolsJsonPath); | ||
const idfToolsManager = new IdfToolsManager( | ||
toolsJson, | ||
platformInfo, | ||
OutputChannel.init() | ||
); | ||
const verifiedPkgs = await idfToolsManager.getRequiredToolsInfo( | ||
reportedResult.configurationSettings.toolsPath, | ||
reportedResult.configurationSettings.customExtraPaths | ||
); | ||
reportedResult.espIdfToolsVersions = verifiedPkgs; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Project: ESP-IDF VSCode Extension | ||
* File Created: Wednesday, 30th December 2020 4:47:28 pm | ||
* Copyright 2020 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { join } from "path"; | ||
import * as vscode from "vscode"; | ||
import { reportObj } from "./types"; | ||
import { checkRequirements } from "./checkEspIdfRequirements"; | ||
|
||
export async function checkExtensionRequirements( | ||
reportedResult: reportObj, | ||
context: vscode.ExtensionContext | ||
) { | ||
const requirementsPath = join(context.extensionPath, "requirements.txt"); | ||
const result = await checkRequirements( | ||
context, | ||
reportedResult, | ||
requirementsPath | ||
); | ||
reportedResult.extensionRequirements.output = result; | ||
reportedResult.extensionRequirements.result = result; | ||
} | ||
|
||
export async function checkDebugAdapterRequirements( | ||
reportedResult: reportObj, | ||
context: vscode.ExtensionContext | ||
) { | ||
const requirementsPath = join( | ||
context.extensionPath, | ||
"esp_debug_adapter", | ||
"requirements.txt" | ||
); | ||
const result = await checkRequirements( | ||
context, | ||
reportedResult, | ||
requirementsPath | ||
); | ||
reportedResult.debugAdapterRequirements.output = result; | ||
reportedResult.debugAdapterRequirements.result = result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Project: ESP-IDF VSCode Extension | ||
* File Created: Tuesday, 12th January 2021 7:43:50 pm | ||
* Copyright 2021 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { ESP } from "../config"; | ||
import { reportObj } from "./types"; | ||
import * as vscode from "vscode"; | ||
import * as os from "os"; | ||
|
||
export async function checkSystemInfo(reportedResult: reportObj) { | ||
const extensionVersion = vscode.extensions.getExtension(ESP.extensionID); | ||
reportedResult.systemInfo.architecture = os.arch(); | ||
reportedResult.systemInfo.envPath = | ||
process.platform === "win32" ? process.env.Path : process.env.PATH; | ||
reportedResult.systemInfo.extensionVersion = extensionVersion | ||
? extensionVersion.packageJSON.version | ||
: "ESP-IDF_VERSION_NOT_FOUND"; | ||
reportedResult.systemInfo.language = vscode.env.language; | ||
reportedResult.systemInfo.platform = os.platform(); | ||
reportedResult.systemInfo.systemName = os.release(); | ||
reportedResult.systemInfo.shell = vscode.env.shell; | ||
reportedResult.systemInfo.vscodeVersion = vscode.version; | ||
} |
Oops, something went wrong.