-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
26 deletions.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as vscode from 'vscode'; | ||
import { | ||
getWorkspaceSettings, | ||
} from './settings'; | ||
import { getProjectRoot } from './utilities'; | ||
|
||
export async function createStatusBar(commandName: string, serverId:string): Promise<vscode.StatusBarItem>{ | ||
// Create a status bar item | ||
const statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100); | ||
statusBarItem.command = commandName; | ||
// https://code.visualstudio.com/api/references/vscode-api#WorkspaceConfiguration | ||
const projectRoot = await getProjectRoot(); | ||
const workspaceSetting = await getWorkspaceSettings(serverId, projectRoot, true); | ||
let environment = 'base'; // todo: Assume base, better to take this from server as it could be changed in project settings. | ||
|
||
if (workspaceSetting.environment) { | ||
environment = workspaceSetting.environment; | ||
} | ||
|
||
statusBarItem.text = `$(kedro-logo) ${environment}`; | ||
statusBarItem.show(); | ||
return statusBarItem; | ||
} |
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