Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OEDependsDot view/commands #378

Draft
wants to merge 6 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
"vscode": "^1.92.0"
},
"dependencies": {
"ejs": "^3.1.10",
"find": "^0.3.0",
"node-pty": "^1.0.0",
"semver": "^7.6.3",
"vscode-languageclient": "^9.0.1"
},
"devDependencies": {
"@types/ejs": "^3.1.5",
"@types/find": "^0.2.4",
"@types/semver": "^7.5.8",
"@types/vscode": "^1.96.0"
Expand Down
4 changes: 4 additions & 0 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { type BitbakeScanResult, scanContainsData } from './lib/src/types/Bitbak
import { reviewDiagnostics } from './language/diagnosticsSupport'
import { embeddedLanguageDocsManager } from './language/EmbeddedLanguageDocsManager'
import { NotificationMethod } from './lib/src/types/notifications'
import { DependsDotView } from './ui/DependsDotView'

let client: LanguageClient
const bitbakeDriver: BitbakeDriver = new BitbakeDriver()
Expand All @@ -37,6 +38,7 @@ const bitbakeWorkspace: BitbakeWorkspace = new BitbakeWorkspace()
let bitbakeRecipesView: BitbakeRecipesView | undefined
let devtoolWorkspacesView: DevtoolWorkspacesView | undefined
let terminalProvider: BitbakeTerminalProfileProvider | undefined
let dependsDotWebview: DependsDotView | undefined

export function canModifyConfig (): boolean {
const disableConfigModification = vscode.workspace.getConfiguration('bitbake').get('disableConfigModification')
Expand Down Expand Up @@ -160,6 +162,8 @@ export async function activate (context: vscode.ExtensionContext): Promise<void>
bitbakeRecipesView.registerView(context)
devtoolWorkspacesView = new DevtoolWorkspacesView(bitBakeProjectScanner)
devtoolWorkspacesView.registerView(context)
dependsDotWebview = new DependsDotView(bitBakeProjectScanner, context.extensionUri)
dependsDotWebview.registerView(context)
void vscode.commands.executeCommand('setContext', 'bitbake.active', true)
const bitbakeStatusBar = new BitbakeStatusBar(bitBakeProjectScanner)
context.subscriptions.push(bitbakeStatusBar.statusBarItem)
Expand Down
26 changes: 26 additions & 0 deletions client/src/ui/BitbakeCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export function registerBitbakeCommands (context: vscode.ExtensionContext, bitba
vscode.commands.registerCommand('bitbake.stop-toaster', async () => { await stopToaster(bitBakeProjectScanner.bitbakeDriver) }),
vscode.commands.registerCommand('bitbake.clear-workspace-state', async () => { await clearAllWorkspaceState(context) }),
vscode.commands.registerCommand('bitbake.examine-dependency-taskexp', async (uri) => { await examineDependenciesTaskexp(bitbakeWorkspace, bitBakeProjectScanner, uri) }),
// Repurpose to be per recipe? (and ask for image if not already supplied)
vscode.commands.registerCommand('bitbake.oe-depends-dot', async (uri) => { await runOeDependsDot(bitbakeWorkspace, bitBakeProjectScanner, uri) }),
// Handles enqueued parsing requests (onSave)
vscode.tasks.onDidEndTask((e) => {
if (e.execution.task.name === 'Bitbake: Parse') {
Expand Down Expand Up @@ -615,6 +617,30 @@ export async function examineDependenciesTaskexp (bitbakeWorkspace: BitbakeWorks
}
}

export async function runOeDependsDot (bitbakeWorkspace: BitbakeWorkspace, bitBakeProjectScanner: BitBakeProjectScanner, uri?: unknown): Promise<void> {
if (isTaskexpStarted) {
void vscode.window.showInformationMessage('taskexp is already started')
return
}
const chosenImage = await selectRecipe(bitbakeWorkspace, bitBakeProjectScanner, uri)
const chosenRecipe = await selectRecipe(bitbakeWorkspace, bitBakeProjectScanner, uri)
if (chosenImage !== undefined && chosenRecipe !== undefined) {
logger.debug(`Command: oe-depends-dot: ${chosenRecipe}`)
isTaskexpStarted = true
const process = await runBitbakeTerminal(bitBakeProjectScanner.bitbakeDriver,
{
specialCommand: `bitbake -g ${chosenRecipe} -u taskexp`
} as BitbakeTaskDefinition,
`Bitbake: taskexp: ${chosenRecipe}`)
process.onExit((e) => {
isTaskexpStarted = false
if (e.exitCode !== 0) {
void vscode.window.showErrorMessage(`Failed to start taskexp with exit code ${e.exitCode}. See terminal output.`)
}
})
}
}

async function openBitbakeDevshell (terminalProvider: BitbakeTerminalProfileProvider, bitbakeWorkspace: BitbakeWorkspace, bitBakeProjectScanner: BitBakeProjectScanner, uri?: unknown): Promise<vscode.Terminal | undefined> {
const chosenRecipe = await selectRecipe(bitbakeWorkspace, bitBakeProjectScanner, uri)
if (chosenRecipe === undefined) return
Expand Down
Loading
Loading