vscode#StatusBarAlignment TypeScript Examples
The following examples show how to use
vscode#StatusBarAlignment.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: extension.ts From plugin-vscode with Apache License 2.0 | 6 votes |
constructor() {
this.ballerinaHome = '';
this.ballerinaCmd = '';
this.ballerinaVersion = '';
this.webviewPanels = {};
this.sdkVersion = window.createStatusBarItem(StatusBarAlignment.Left, 100);
this.sdkVersion.text = `Ballerina SDK: Detecting`;
this.sdkVersion.command = `ballerina.showLogs`;
this.sdkVersion.show();
this.isSwanLake = false;
this.is12x = false;
// Load the extension
this.extension = extensions.getExtension(EXTENSION_ID)!;
this.clientOptions = {
documentSelector: [{ scheme: 'file', language: LANGUAGE.BALLERINA }, { scheme: 'file', language: LANGUAGE.TOML }],
synchronize: { configurationSection: LANGUAGE.BALLERINA },
outputChannel: getOutputChannel(),
revealOutputChannelOn: RevealOutputChannelOn.Never,
};
this.telemetryReporter = createTelemetryReporter(this);
}
Example #2
Source File: compilationStatusView.ts From ide-vscode with MIT License | 6 votes |
public static createAndRegister(context: ExtensionContext, languageClient: DafnyLanguageClient): CompilationStatusView {
const statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, StatusBarPriority);
const view = new CompilationStatusView(statusBarItem);
context.subscriptions.push(
languageClient.onCompilationStatus(params => view.compilationStatusChanged(params)),
languageClient.onVerificationStarted(params => view.verificationStarted(params)),
languageClient.onVerificationCompleted(params => view.verificationCompleted(params)),
workspace.onDidCloseTextDocument(document => view.documentClosed(document)),
workspace.onDidChangeTextDocument(() => view.updateActiveDocumentStatus()),
window.onDidChangeActiveTextEditor(() => view.updateActiveDocumentStatus()),
enableOnlyForDafnyDocuments(statusBarItem),
statusBarItem
);
return view;
}
Example #3
Source File: dafnyVersionView.ts From ide-vscode with MIT License | 6 votes |
public static async createAndRegister(context: ExtensionContext, languageServerVersion: string): Promise<void> {
const statusBarItem = window.createStatusBarItem(StatusBarAlignment.Right, StatusBarPriority);
statusBarItem.text = languageServerVersion;
statusBarItem.tooltip = await getTooltipText(context, languageServerVersion);
context.subscriptions.push(
enableOnlyForDafnyDocuments(statusBarItem),
statusBarItem
);
}
Example #4
Source File: client.ts From vscode-discord with MIT License | 6 votes |
public connect() {
if (!this.statusBar)
this.statusBar = window.createStatusBarItem(
StatusBarAlignment.Left,
100
);
this.statusBar.text = "$(pulse)";
this.statusBar.tooltip = "RPC Connecting to Discord...";
if (this.config.get("showStatusBar") == true) this.statusBar.show();
this.rpc = new RPCClient({ transport: "ipc" });
this.rpc
.login({ clientId: this.config.get<string>("clientID") })
.catch(() => this.disconnect());
this.rpc.once("ready", () => {
this.ready = true;
this.statusBar.text = "$(vm-active)";
this.statusBar.tooltip = "RPC Connected to Discord";
this.statusBar.command = null;
});
}
Example #5
Source File: q-status-bar-manager.ts From vscode-q with MIT License | 6 votes |
private constructor(context: ExtensionContext) {
this.queryModeStatusBar = window.createStatusBarItem(StatusBarAlignment.Left, 99);
context.subscriptions.push(this.queryModeStatusBar);
this.queryModeStatusBar.color = this.isLightTheme ? '#512DA8' : '#B39DDB';
this.queryModeStatusBar.command = 'q-client.switchMode';
this.queryModeStatusBar.text = '$(triangle-left)q ' + QConnManager.queryMode.toLowerCase();
this.queryModeStatusBar.show();
this.connStatusBar = window.createStatusBarItem(StatusBarAlignment.Left, 98);
context.subscriptions.push(this.connStatusBar);
this.connStatusBar.color = this.isLightTheme ? '#512DA8' : '#B39DDB';
this.connStatusBar.command = 'q-client.connectEntry';
this.connStatusBar.show();
this.queryStatusBar = window.createStatusBarItem(StatusBarAlignment.Left, 97);
this.queryStatusBar.text = '$(play-circle)';
this.queryStatusBar.color = '#4CAF50';
this.queryStatusBar.tooltip = 'Querying';
context.subscriptions.push(this.queryStatusBar);
this.unlimitedQueryStatusBar = window.createStatusBarItem(StatusBarAlignment.Left, 96);
this.unlimitedQueryStatusBar.text = '$(flame)';
this.unlimitedQueryStatusBar.color = '#F44336';
this.unlimitedQueryStatusBar.tooltip = 'Unlimited Query';
context.subscriptions.push(this.unlimitedQueryStatusBar);
}
Example #6
Source File: status.ts From vscode-stories with MIT License | 5 votes |
constructor() {
this.item = window.createStatusBarItem(StatusBarAlignment.Right);
this.stop();
this.item.show();
}
Example #7
Source File: AuthorizationStatusBar.ts From al-objid with MIT License | 5 votes |
private constructor() {
super();
this.registerDisposable((this._status = window.createStatusBarItem(StatusBarAlignment.Left, 1)));
window.onDidChangeActiveTextEditor(this.updateStatusBar, this);
}
Example #8
Source File: statusBar.ts From vscode-todo-md with MIT License | 5 votes |
constructor() {
super();
this.statusBarItem = window.createStatusBarItem(`${Constants.ExtensionMenuPrefix} Main`, StatusBarAlignment.Left, -20001);
this.statusBarItem.name = `${Constants.ExtensionMenuPrefix} Main`;
this.show();
}
Example #9
Source File: statusBar.ts From vscode-todo-md with MIT License | 5 votes |
constructor() {
super();
this.statusBarItem = window.createStatusBarItem(`Todo MD: Counter`, StatusBarAlignment.Left, -20000);
this.statusBarItem.name = `Todo MD: Counter`;
}
Example #10
Source File: status-bar.ts From vscode-cadence with Apache License 2.0 | 5 votes |
export function createActiveAccountStatusBarItem (): StatusBarItem {
const statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 100)
statusBarItem.command = SWITCH_ACCOUNT
return statusBarItem
}
Example #11
Source File: status-bar.ts From vscode-cadence with Apache License 2.0 | 5 votes |
export function createEmulatorStatusBarItem (): StatusBarItem {
return window.createStatusBarItem(StatusBarAlignment.Left, 200)
}
Example #12
Source File: versionStatusBar.ts From vscode-dbt-power-user with MIT License | 5 votes |
readonly statusBar: StatusBarItem = window.createStatusBarItem(
StatusBarAlignment.Left,
10
);
Example #13
Source File: coverage.ts From gnucobol-debug with GNU General Public License v3.0 | 5 votes |
private statusBar: StatusBarItem = window.createStatusBarItem(StatusBarAlignment.Right, 100);
Example #14
Source File: DrawioEditorService.ts From vscode-drawio with GNU General Public License v3.0 | 5 votes |
private readonly statusBar = this.dispose.track(
window.createStatusBarItem(StatusBarAlignment.Right)
);
Example #15
Source File: SnippetStatus.ts From vsinder with Apache License 2.0 | 5 votes |
constructor() {
this.item = window.createStatusBarItem(StatusBarAlignment.Right);
this.item.text = "$(file-code) VSinder Snippet";
this.item.command = "vsinder.addCodeToProfile";
}
Example #16
Source File: button.ts From cloudmusic-vscode with MIT License | 5 votes |
LEFT = StatusBarAlignment.Left
Example #17
Source File: spIndex.ts From sourcepawn-vscode with MIT License | 4 votes |
export function activate(context: ExtensionContext) {
const providers = new Providers(context.globalState);
const SBItem = window.createStatusBarItem(StatusBarAlignment.Left, 0);
SBItem.command = "status.enablingSPFeatures";
SBItem.text = "Enabling SourcePawn features...";
SBItem.show();
let workspaceFolders = Workspace.workspaceFolders || [];
if (workspaceFolders.length === 0) {
window.showWarningMessage(
"No workspace or folder found. \n Please open the folder containing your .sp file, not just the .sp file."
);
} else {
const watcher = Workspace.createFileSystemWatcher(
"**/*.{inc,sp}",
false,
true,
false
);
watcher.onDidCreate((uri) => {
let uriString = URI.file(uri.fsPath).toString();
providers.itemsRepository.documents.add(uriString);
let mainPath = findMainPath(uri);
if (mainPath !== undefined && mainPath !== "") {
mainPath = URI.file(mainPath).toString();
for (let document of Workspace.textDocuments) {
if (document.uri.toString() === mainPath) {
refreshDiagnostics(document);
break;
}
}
}
});
watcher.onDidDelete((uri) => {
providers.itemsRepository.documents.delete(uri.fsPath);
});
// Get all the files from the workspaces
getDirectories(
workspaceFolders.map((e) => e.uri.fsPath),
providers
);
}
Workspace.onDidChangeWorkspaceFolders((e) => {
getDirectories(
e.added.map((folder) => folder.uri.fsPath),
providers
);
});
// Get the names and directories of optional include directories.
let optionalIncludeDirs: string[] =
Workspace.getConfiguration("sourcepawn").get("optionalIncludeDirsPaths") ||
[];
optionalIncludeDirs = optionalIncludeDirs.map((e) =>
resolve(...workspaceFolders.map((folder) => folder.uri.fsPath), e)
);
getDirectories(optionalIncludeDirs, providers);
loadFiles(providers, SBItem);
Workspace.onDidChangeConfiguration((e) => {
if (e.affectsConfiguration("sourcepawn.MainPath")) {
let newMainPath = findMainPath();
if (newMainPath !== undefined && !checkMainPath(newMainPath)) {
window.showErrorMessage(
"A setting for the main.sp file was specified, but seems invalid. Right click on a file and use the command at the bottom of the menu to set it as main."
);
}
}
});
window.onDidChangeActiveTextEditor((e) => {
if (e !== undefined) {
updateDecorations(providers.itemsRepository);
providers.itemsRepository.handleDocumentOpening(e.document.uri.fsPath);
}
});
context.subscriptions.push(
languages.registerDocumentSymbolProvider(SP_MODE, providers)
);
context.subscriptions.push(
languages.registerCompletionItemProvider(
SP_MODE,
providers,
"<",
'"',
"'",
"/",
"\\",
".",
":",
" "
)
);
context.subscriptions.push(
languages.registerCompletionItemProvider(
SP_MODE,
providers.documentationProvider,
"*"
)
);
context.subscriptions.push(
languages.registerSignatureHelpProvider(SP_MODE, providers, "(", ",", "\n")
);
context.subscriptions.push(
languages.registerDocumentSemanticTokensProvider(
SP_MODE,
providers,
SP_LEGENDS
)
);
context.subscriptions.push(
languages.registerDefinitionProvider(SP_MODE, providers)
);
context.subscriptions.push(
languages.registerReferenceProvider(SP_MODE, providers)
);
context.subscriptions.push(
languages.registerRenameProvider(SP_MODE, providers)
);
context.subscriptions.push(
languages.registerDocumentFormattingEditProvider(
{
language: "sourcepawn",
scheme: "file",
pattern: "**/*.sp",
},
new SMDocumentFormattingEditProvider()
)
);
context.subscriptions.push(
languages.registerDocumentFormattingEditProvider(
[
{
language: "sp-translations",
},
{
language: "sp-gamedata",
},
{
language: "valve-cfg",
},
{
language: "valve-ini",
},
{
language: "sourcemod-kv",
},
],
new CFGDocumentFormattingEditProvider()
)
);
context.subscriptions.push(
languages.registerHoverProvider(SP_MODE, providers)
);
Workspace.onDidChangeTextDocument(
providers.itemsRepository.handleDocumentChange,
providers.itemsRepository,
context.subscriptions
);
Workspace.onDidOpenTextDocument(
providers.itemsRepository.handleNewDocument,
providers.itemsRepository,
context.subscriptions
);
Workspace.onDidCreateFiles(
providers.itemsRepository.handleAddedDocument,
providers.itemsRepository,
context.subscriptions
);
// Register SM Commands
registerSMCommands(context);
// Register SM linter
registerSPLinter(context);
// Register CFG linter
registerCFGLinter(context);
}