Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Mar 18, 2024
1 parent d91361c commit 86e5dfd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 37 deletions.
11 changes: 7 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
"type": "git",
"url": "https://github.com/yoctoproject/vscode-bitbake.git"
},
"keywords": [
"coc.nvim"
],
"engines": {
"vscode": "^1.75.0"
"coc": "^0.0.82"
},
"categories": [
"Programming Languages"
Expand Down Expand Up @@ -832,13 +835,13 @@
},
"dependencies": {
"find": "^0.2.7",
"node-pty": "^1.0.0",
"vscode-languageclient": "^8.1.0"
"node-pty": "^1.0.0"
},
"devDependencies": {
"@types/find": "^0.2.2",
"@types/node": "^20.6.2",
"@types/vscode": "^1.75.1"
"coc.nvim": "^0.0.83-next.18"
"typescript": "^5.3.3"
},
"workspaces": [
"src/lib"
Expand Down
66 changes: 33 additions & 33 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,41 +75,41 @@ async function disableInteferingSettings (): Promise<void> {
}
}

async function installExtensions (extensionId: string): Promise<void> {
await vscode.window.showInformationMessage(`The extension ${extensionId} is required for yocto-project.yocto-bitbake to work properly. Do you want to install it?`, 'Install', 'Show extension page', 'Cancel')
.then((item) => {
if (item === 'Install') {
void vscode.window.withProgress({
location: vscode.ProgressLocation.Notification,
title: `Installing ${extensionId}...`,
cancellable: false
}, async (progress, token) => {
try {
await vscode.commands.executeCommand('workbench.extensions.installExtension', extensionId).then(() => {
progress.report({ message: `${extensionId} has been installed` })
})
} catch (error) {
await vscode.window.showErrorMessage(`Failed to install ${extensionId}: ${JSON.stringify(error)}`)
}
})
} else if (item === 'Show extension page') {
void vscode.commands.executeCommand('extension.open', extensionId)
}
})
}
// async function installExtensions (extensionId: string): Promise<void> {
// await vscode.window.showInformationMessage(`The extension ${extensionId} is required for yocto-project.yocto-bitbake to work properly. Do you want to install it?`, 'Install', 'Show extension page', 'Cancel')
// .then((item) => {
// if (item === 'Install') {
// void vscode.window.withProgress({
// location: vscode.ProgressLocation.Notification,
// title: `Installing ${extensionId}...`,
// cancellable: false
// }, async (progress, token) => {
// try {
// await vscode.commands.executeCommand('workbench.extensions.installExtension', extensionId).then(() => {
// progress.report({ message: `${extensionId} has been installed` })
// })
// } catch (error) {
// await vscode.window.showErrorMessage(`Failed to install ${extensionId}: ${JSON.stringify(error)}`)
// }
// })
// } else if (item === 'Show extension page') {
// void vscode.commands.executeCommand('extension.open', extensionId)
// }
// })
// }

export async function activate (context: vscode.ExtensionContext): Promise<void> {
const requiredExtensions = [
'mads-hartmann.bash-ide-vscode', // https://marketplace.visualstudio.com/items?itemName=mads-hartmann.bash-ide-vscode
'ms-python.python' // https://marketplace.visualstudio.com/items?itemName=ms-python.python
]

for (const extensionId of requiredExtensions) {
// mads-hartmann.bash-ide-vscode is not currently available in the web version of VSCode, thus do not install it
if (vscode.extensions.getExtension(extensionId) === undefined && vscode.env.uiKind !== vscode.UIKind.Web) {
await installExtensions(extensionId)
}
}
// const requiredExtensions = [
// 'mads-hartmann.bash-ide-vscode', // https://marketplace.visualstudio.com/items?itemName=mads-hartmann.bash-ide-vscode
// 'ms-python.python' // https://marketplace.visualstudio.com/items?itemName=ms-python.python
// ]
//
// for (const extensionId of requiredExtensions) {
// // mads-hartmann.bash-ide-vscode is not currently available in the web version of VSCode, thus do not install it
// if (vscode.extensions.getExtension(extensionId) === undefined && vscode.env.uiKind !== vscode.UIKind.Web) {
// await installExtensions(extensionId)
// }
// }

logger.outputChannel = vscode.window.createOutputChannel('BitBake')

Expand Down

0 comments on commit 86e5dfd

Please sign in to comment.