Skip to content

Commit

Permalink
V3.8.6 (#190)
Browse files Browse the repository at this point in the history
* better editor mgmt

* more doc mgmt refresh/close

* added release notes to pipeline

* 3.8.6
  • Loading branch information
DumpySquare authored Aug 31, 2022
1 parent a50a2b2 commit 998975f
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 12 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:

- name: get extension version
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

- name: capture latest release notes
run: echo "RELEASE_NOTE=$(node src/scripts/changelog.js)" >> $GITHUB_ENV

- name: create upload artifacts
uses: actions/upload-artifact@v2
Expand All @@ -87,7 +90,7 @@ jobs:
with:
tag_name: v${{ env.PACKAGE_VERSION }}
release_name: ${{ env.VSIX_NAME }}
body: See [CHANGE LOG](https://github.com/f5devcentral/vscode-f5-chariot/blob/main/README.md) for details.
body: ${{env.RELEASE_NOTE}} See [CHANGE LOG](https://github.com/f5devcentral/vscode-f5/blob/main/README.md) for full details.
draft: false
prerelease: false

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "The F5 Extension",
"description": "Supercharge your F5 automation development",
"publisher": "F5DevCentral",
"version": "3.8.5",
"version": "3.8.6",
"keywords": [
"F5",
"F5Networks",
Expand Down
7 changes: 7 additions & 0 deletions src/cfgExploreCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,20 @@ export function cfgExplore(context: ExtensionContext) {
// flip switch and refresh details
if(cfgProvider.xcDiag){
cfgProvider.xcDiag = false;
ext.xcDiag.enabled = false;
console.log('xc diag updatediagnostics disable');
if(ext.xcDiag.lastDoc) {
// clear the last editor diags
ext.xcDiag.updateDiagnostic(ext.xcDiag.lastDoc);
}
} else {
cfgProvider.xcDiag = true;

// was having errors about functions undefined, so, make sure everything is loaded as we turn this on
// if (ext.xcDiag.updateDiagnostic === undefined) {
console.log('xc diag updatediagnostics enable');
ext.xcDiag = new XcDiag(context);
ext.xcDiag.enabled = true;
// }
}
cfgProvider.refresh();
Expand Down Expand Up @@ -230,6 +236,7 @@ export function cfgExplore(context: ExtensionContext) {
diagTag = true;
}

// provide the text and "IF" xc diagnostics "CAN" be applied
cfgProvider.render(text, diagTag);
}));

Expand Down
30 changes: 30 additions & 0 deletions src/scripts/changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
let fs = require('fs');
const path = require('path');

const args = process.argv.slice(2);

// src/scripts/changelog.js
const text = fs.readFileSync(path.join('CHANGELOG.md'), "utf-8");


// trying to take arg for version...
// if(args[0]) {
// const rx2 = new RegExp(`## \[${args[0]}` + "\].+([\\s\\w\\>\\'\\-\\/]+)", 'g');
// const rx3 = /## \[\d.\d.\d\].+([\s\w\>\'\-\/]+)(?=---)/;

// const b2 = rx2.exec(text);

// const b3 = b2;
// // const rx = /## \[3.8.5\].+([\s\w\>\'\-\/]+)/;
// }

// currently just returns the most recent or first match
const rx = /## \[\d.\d.\d\].+([\s\w\>\'\-\/]+)(?=---)/;

const body = rx.exec(text);

return console.log(body[0]);

// debugger;


40 changes: 32 additions & 8 deletions src/tmosXcDiag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
Position,
Range,
TextDocument,
Uri
Uri,
workspace
} from "vscode";

import { logger } from "./logger";
Expand All @@ -30,8 +31,10 @@ export type xcDiagRule = {


export class XcDiag {
public enabled: boolean = false;
public lastDoc: TextDocument | undefined = undefined;

diagXC: DiagnosticCollection;
public diagXC: DiagnosticCollection;

settingsFileLocation: string;
rules: xcDiagRule[];
Expand All @@ -45,6 +48,14 @@ export class XcDiag {
this.settingsFileLocation = path.join(context.extensionPath, 'diagRules', 'tmosXcRules.json');
this.rules = this.loadRules();

context.subscriptions.push(
workspace.onDidChangeTextDocument(e => this.updateDiagnostic(e.document))
);

context.subscriptions.push(
workspace.onDidCloseTextDocument(doc => this.diagXC.delete(doc.uri))
);

}

loadRules() {
Expand Down Expand Up @@ -217,14 +228,27 @@ export class XcDiag {
}

updateDiagnostic(doc: TextDocument) {
// clear current diags dispalyed
this.diagXC.clear();

// get the text from the doc/editor and feed through xc diagnostics
const diags = this.getDiagnostic(doc.getText());
if(doc.fileName === 'app.conf') {

// clear current diags in this class
this.diagXC.clear();
// clear the current diags in the doc/editor
this.diagXC.delete(doc.uri);

if(this.enabled) {

// pubish the diags to document
this.diagXC.set(doc.uri, diags);
// capture the doc we are working with
this.lastDoc = doc;

// get the text from the doc/editor and feed through xc diagnostics
const diags = this.getDiagnostic(doc.getText());

// pubish the diags to document
this.diagXC.set(doc.uri, diags);
}

}
}
}

0 comments on commit 998975f

Please sign in to comment.