Skip to content

Commit

Permalink
Add "Format document with sqlfluff" status bar button
Browse files Browse the repository at this point in the history
  • Loading branch information
barrywhart committed Jan 2, 2024
1 parent 364e7d9 commit 68962c2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ export const activate = (context: vscode.ExtensionContext) => {
};
context.subscriptions.push(vscode.commands.registerCommand(fixCommand, fixCommandHandler));

// Adds a "Fix document with sqlfluff" button to the lower right corner of
// the VS Code window
const customStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
customStatusBarItem.text = "$(pencil)";
customStatusBarItem.tooltip = "Fix document with sqlfluff";
customStatusBarItem.command = fixCommand;
customStatusBarItem.show();

const formatSelection = "sqlfluff.format.selection";
const formatSelectionHandler = async () => {
if (vscode.window.activeTextEditor) {
Expand Down

0 comments on commit 68962c2

Please sign in to comment.