Skip to content

Commit

Permalink
last minute v0.1.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-uk committed Sep 27, 2019
1 parent 2accd7f commit 60bca5e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ src/**
.gitignore
tsconfig.json
tslint.json
tests/**
test/**
.github/**
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ Extension as been tested successfully against all 890+ [Azure Quickstart Templat
- Click 'LAYOUT' button to re-layout icons in default way

## Linked Templates
Notes:
- If the linked template URL is accessible, it will be downloaded and used.
- If the URL is not accessible, then the local filesystem of the VS Code workspace will be searched for the file. Some assumptions are made:
The extension will attempt to locate and display linked templates, these resources will be shown grouped together in a shaded box. Linked template support is at an early stage, and comes with some limitations. This is an outline of how it works:
- If the resolved linked template URL is externally accessible, it will be downloaded and used.
- If the URL is not accessible, then the local filesystem of the VS Code workspace will be searched for the file. Some assumptions are made in this search:
- The linked template file must end '.json'
- The linked template file is located somewhere under the path of the main template, sub-folders will be searched. If the file resides elsewhere outside this path it will not be located.
- The linked template file should located somewhere under the path of the main template, sub-folders will be searched. If the file resides elsewhere outside this path it will not be located.
- The first matching file will be used. This is only a problem if you have multiple linked templates with the same file names but in different sub-folders, this is considered a rare edge case and will not be addressed.
- If linked template URL or filename is dynamic based on template parameters it is very likely not to resolve, and will not be found.
- If the linked template can not be located/loaded then a icon representing the deployment will be shown as a fallback.
- If linked template URL or filename is dynamic and based on template parameters it
- Nested templates are not supported, these are rarely used
- Currently there is no cache for data fetched from external URLs
- The layout of the icons/resources can initially be a bit strange, and will require some manual tidy up to look good. I'm investigating how to improve this.

# Notes
This is a port of a older *ARM Viewer* project, which was a standalone Node.js webapp https://github.com/benc-uk/azure-armviewer
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"mocha": "^6.2.0",
"strip-bom": "^3.0.0",
"ts-loader": "^6.1.2",
"ts-mocha": "^6.0.0",
"tslint": "^5.16.0",
"typescript": "^3.5.1"
}
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showErrorMessage("No editor active, open a ARM template JSON file in the editor");
return;
} else {
if(vscode.window.activeTextEditor.document.languageId != "json") {
if(!(vscode.window.activeTextEditor.document.languageId == "json" || vscode.window.activeTextEditor.document.languageId == "arm-template")) {
vscode.window.showErrorMessage("Current file is not JSON");
return;
}
Expand Down Expand Up @@ -148,7 +148,7 @@ async function refreshView() {

if(editor) {
// Skip non-JSON
if(editor.document.languageId != "json" && editor.document.languageId != "arm-template") {
if(!(editor.document.languageId == "json" || editor.document.languageId == "arm-template")) {
return;
}

Expand Down

0 comments on commit 60bca5e

Please sign in to comment.