This repository has been archived by the owner on Dec 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
10 changed files
with
134 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +0,0 @@ | ||
on: | ||
push: | ||
branches: | ||
- release/patch | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
merge: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
build: | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- run: npm install | ||
publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Publish | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
run: npm run deploy\:patch | ||
env: | ||
VSCE_PAT: ${{ secrets.VSCE_PAT }} | ||
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
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
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,68 @@ | ||
import * as vscode from "vscode"; | ||
import { Provider } from "../utils/base-provider"; | ||
import ActiveEditorsTreeItem from "../utils/active-editors-tree-item"; | ||
export default class ActiveEditorsProvider | ||
extends Provider<ActiveEditorsTreeItem> | ||
implements vscode.TreeDataProvider<ActiveEditorsTreeItem> | ||
{ | ||
constructor(protected _projectDirUri: vscode.Uri) { | ||
super(_projectDirUri); | ||
} | ||
protected readonly _onDidChangeTreeData: vscode.EventEmitter< | ||
void | ActiveEditorsTreeItem | ActiveEditorsTreeItem[] | null | undefined | ||
> = new vscode.EventEmitter< | ||
void | ActiveEditorsTreeItem | ActiveEditorsTreeItem[] | null | undefined | ||
>(); | ||
onDidChangeTreeData?: | ||
| vscode.Event< | ||
| void | ||
| ActiveEditorsTreeItem | ||
| ActiveEditorsTreeItem[] | ||
| null | ||
| undefined | ||
> | ||
| undefined = this._onDidChangeTreeData.event; | ||
refresh(): void { | ||
this._onDidChangeTreeData?.fire(); | ||
} | ||
getTreeItem( | ||
element: ActiveEditorsTreeItem | ||
): vscode.TreeItem | Thenable<vscode.TreeItem> { | ||
return element; | ||
} | ||
getChildren( | ||
element?: ActiveEditorsTreeItem | undefined | ||
): vscode.ProviderResult<ActiveEditorsTreeItem[]> { | ||
const openDocuments = vscode.workspace.textDocuments; | ||
const activeEditors: ActiveEditorsTreeItem[] = []; | ||
this.refresh(); | ||
openDocuments.forEach((editor) => { | ||
if (editor.fileName.endsWith(".git")) { | ||
return null; | ||
} | ||
const activeEditor = new ActiveEditorsTreeItem( | ||
"\\" + | ||
editor.fileName.substring( | ||
editor.fileName.indexOf("app\\") + "app\\".length | ||
), | ||
vscode.TreeItemCollapsibleState.None, | ||
{ | ||
command: "vscode.open", | ||
title: "", | ||
arguments: [editor.uri], | ||
} | ||
); | ||
activeEditors.push(activeEditor); | ||
}); | ||
return activeEditors; | ||
} | ||
closeEditor(element: ActiveEditorsTreeItem) { | ||
vscode.window.visibleTextEditors.map((editor) => { | ||
if (editor.document.fileName === element.label) { | ||
vscode.commands.executeCommand("workbench.action.closeActiveEditor"); | ||
} | ||
}); | ||
this.refresh(); | ||
return; | ||
} | ||
} |
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
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,10 @@ | ||
import * as vscode from "vscode"; | ||
export default class ActiveEditorsTreeItem extends vscode.TreeItem { | ||
constructor( | ||
public readonly label: string, | ||
public readonly collapsibleState: vscode.TreeItemCollapsibleState, | ||
public readonly command?: vscode.Command | ||
) { | ||
super(label, collapsibleState); | ||
} | ||
} |
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,19 @@ | ||
import * as vscode from "vscode"; | ||
import FileTreeItem from "./file-tree-item"; | ||
export abstract class Provider<T extends vscode.TreeItem> { | ||
constructor(protected _projectDirUri: vscode.Uri) {} | ||
protected readonly _onDidChangeTreeData: vscode.EventEmitter< | ||
void | T | T[] | null | undefined | ||
> = new vscode.EventEmitter<void | T | T[] | null | undefined>(); | ||
onDidChangeTreeData?: | ||
| vscode.Event<void | T | T[] | null | undefined> | ||
| undefined = this._onDidChangeTreeData.event; | ||
refresh(): void { | ||
this._onDidChangeTreeData?.fire(); | ||
} | ||
getTreeItem(element: T): vscode.TreeItem | Thenable<vscode.TreeItem> { | ||
return element; | ||
} | ||
|
||
abstract getChildren(element?: T | undefined): vscode.ProviderResult<T[]>; | ||
} |