Skip to content

Commit

Permalink
prebuild vsix package in ci (#235)
Browse files Browse the repository at this point in the history
* prebuild vsix package in ci

- activate extension automatically
- improve "Validate Azure Pipeline" status bar visibility

* fix ci
  • Loading branch information
ChristopherHX authored Oct 11, 2023
1 parent a31bb86 commit c7ee3e7
Show file tree
Hide file tree
Showing 4 changed files with 1,894 additions and 1,987 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
npm install
dotnet workload install wasm-tools
npm run build
node_modules/.bin/vsce pack -o azure-pipelines-vscode-ext.vsix
node_modules/.bin/vsce pack --pre-release -o azure-pipelines-vscode-ext-pre-release.vsix
working-directory: src/azure-pipelines-vscode-ext
- name: Make layout
run: |
Expand All @@ -48,6 +50,7 @@ jobs:
mv src/azure-pipelines-vscode-ext/build webapp/azure-pipelines-vscode-ext/
mv src/azure-pipelines-vscode-ext/dist webapp/azure-pipelines-vscode-ext/
mv src/azure-pipelines-vscode-ext/package.json webapp/azure-pipelines-vscode-ext/
mv src/azure-pipelines-vscode-ext/*.vsix webapp/azure-pipelines-vscode-ext/
- name: Setup Pages
if: github.event_name == 'push'
uses: actions/configure-pages@v3
Expand Down
16 changes: 5 additions & 11 deletions src/azure-pipelines-vscode-ext/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,17 @@ function activate(context) {

statusbar.command = 'extension.validateAzurePipeline';

var onDocumentChanged = document => {
if(document && document.languageId && (document.languageId === "azure-pipelines" || document.languageId === "yaml")) {
var onLanguageChanged = languageId => {
if(languageId === "azure-pipelines" || languageId === "yaml") {
statusbar.show();
} else {
statusbar.hide();
}
};
var onTextEditChanged = texteditor => onDocumentChanged(texteditor ? texteditor.document : null);
var onTextEditChanged = texteditor => onLanguageChanged(texteditor && texteditor.document && texteditor.document.languageId ? texteditor.document.languageId : null);
context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(onTextEditChanged))
context.subscriptions.push(vscode.workspace.onDidCloseTextDocument(document => {
var texteditor = vscode.window.activeTextEditor;
onDocumentChanged(texteditor && texteditor.document === document ? document : null);
}));
context.subscriptions.push(vscode.workspace.onDidOpenTextDocument(document => {
var texteditor = vscode.window.activeTextEditor;
onDocumentChanged(texteditor && texteditor.document === document ? document : null);
}));
context.subscriptions.push(vscode.workspace.onDidCloseTextDocument(document => onLanguageChanged(document && document.languageId ? document.languageId : null)));
context.subscriptions.push(vscode.workspace.onDidOpenTextDocument(document => onLanguageChanged(document && document.languageId ? document.languageId : null)));
onTextEditChanged(vscode.window.activeTextEditor);
}

Expand Down
Loading

0 comments on commit c7ee3e7

Please sign in to comment.