/
smalltown-boy
/
vscode-nuttx
Обзор
Документация
Войти
/
smalltown-boy
/
vscode-nuttx
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/extension.js
84 строки
3 KB
smalltown-boy
fix: CHANGELOG.md
29 дек 2025, 22:04
29 дек 2025, 22:04
c944e88
Код
Авторство
О чём код?
const vscode = require("vscode"); const { NuttxTreeProvider } = require('./nuttxTreeProvider'); const terminalManager = require('./terminal'); // Импортируем терминал const { printInfo } = require('./commands/printInfo'); const { cleanProject } = require('./commands/cleanProject'); const { cleanAllProject } = require('./commands/cleanAllProject'); const { buildProject } = require('./commands/buildProject'); const { configPaths } = require('./commands/configPaths'); const { setBoard } = require('./commands/setBoard'); const { configBoard } = require('./commands/configBoard'); const { createNuttXProject } = require('./commands/createNuttXProject'); const { configRun } = require('./commands/configRun'); module.exports = { activate, deactivate }; // Activate function activate(context) { // Reading nuttx paths const config = vscode.workspace.getConfiguration(); const appsPath = config.get('nuttx.appsPath'); const nuttxPath = config.get('nuttx.nuttxPath'); const selectedBoard = config.get('nuttx.selectedBoard'); // Check configurations if (!appsPath || !nuttxPath) { vscode.window.showWarningMessage('NuttX paths not configured!'); } if ( !selectedBoard ) { vscode.window.showWarningMessage('Board not selected!'); } const treeProvider = new NuttxTreeProvider(); vscode.window.registerTreeDataProvider('nuttxCommands', treeProvider); context.subscriptions.push( vscode.commands.registerCommand('nuttx-helper.refreshCommands', () => { treeProvider.refresh(); }) ); const commandInfo = "nuttx-helper.Info"; const commandCreate = "nuttx-helper.CreateNuttXProject"; const commandClean = "nuttx-helper.Clean"; const commandCleanAll = "nuttx-helper.CleanAll"; const commandBuild = "nuttx-helper.Build"; const commandSetBoard = "nuttx-helper.SetBoard"; const commandConfigBoard = "nuttx-helper.ConfigBoard"; const commandConfigPaths = "nuttx-helper.ConfigPaths"; const commandConfigRun = "nuttx-helper.ConfigRun"; let pInfo = vscode.commands.registerCommand(commandInfo, printInfo); let pCreate = vscode.commands.registerCommand(commandCreate, createNuttXProject); let pClean = vscode.commands.registerCommand(commandClean, cleanProject); let pCleanAll = vscode.commands.registerCommand(commandCleanAll, cleanAllProject); let pBuild = vscode.commands.registerCommand(commandBuild, buildProject); let pSetBoard = vscode.commands.registerCommand(commandSetBoard, setBoard); let pConfigBoard = vscode.commands.registerCommand(commandConfigBoard, configBoard); let pConfigPaths = vscode.commands.registerCommand(commandConfigPaths, configPaths); let pConfigRun = vscode.commands.registerCommand(commandConfigRun, configRun); context.subscriptions.push(pInfo); context.subscriptions.push(pCreate); context.subscriptions.push(pClean); context.subscriptions.push(pCleanAll); context.subscriptions.push(pBuild); context.subscriptions.push(pSetBoard); context.subscriptions.push(pConfigBoard); context.subscriptions.push(pConfigPaths); context.subscriptions.push(pConfigRun); // Добавляем подписку на очистку терминала при деактивации расширения context.subscriptions.push({ dispose: () => terminalManager.disposeTerminal() }); } function deactivate() { }