Skip to content

Commit

Permalink
Add support for Multi Root Workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
formulahendry committed Nov 4, 2017
1 parent 66c3ba7 commit 3141e78
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 0.0.15 (2017-11-04)
* Add support for Multi Root Workspace

### 0.0.14 (2017-06-19)
* Fix [#30](https://github.com/formulahendry/vscode-auto-rename-tag/issues/30)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Auto Rename Tag

[![Marketplace Version](http://vsmarketplacebadge.apphb.com/version/formulahendry.auto-rename-tag.svg)](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) [![Installs](http://vsmarketplacebadge.apphb.com/installs/formulahendry.auto-rename-tag.svg)](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) [![Rating](http://vsmarketplacebadge.apphb.com/rating/formulahendry.auto-rename-tag.svg)](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) [![Build Status](https://travis-ci.org/formulahendry/vscode-auto-rename-tag.svg?branch=master)](https://travis-ci.org/formulahendry/vscode-auto-rename-tag)
[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/formulahendry.auto-rename-tag.svg)](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) [![Installs](https://vsmarketplacebadge.apphb.com/installs/formulahendry.auto-rename-tag.svg)](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) [![Rating](https://vsmarketplacebadge.apphb.com/rating/formulahendry.auto-rename-tag.svg)](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) [![Build Status](https://travis-ci.org/formulahendry/vscode-auto-rename-tag.svg?branch=master)](https://travis-ci.org/formulahendry/vscode-auto-rename-tag)

Automatically rename paired HTML/XML tag, same as Visual Studio IDE does.

Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "auto-rename-tag",
"displayName": "Auto Rename Tag",
"description": "Auto rename paired HTML/XML tag",
"version": "0.0.14",
"version": "0.0.15",
"publisher": "formulahendry",
"icon": "images/logo.png",
"engines": {
"vscode": "^1.7.0"
"vscode": "^1.17.0"
},
"categories": [
"Other",
Expand All @@ -17,7 +17,8 @@
"rename",
"tag",
"html",
"xml"
"xml",
"multi-root ready"
],
"bugs": {
"url": "https://github.com/formulahendry/vscode-auto-rename-tag/issues",
Expand All @@ -40,7 +41,8 @@
"auto-rename-tag.activationOnLanguage": {
"type": "array",
"default": ["*"],
"description": "Set the languages that the extension will be activated. e.g. [\"html\",\"xml\",\"php\"] By default, it is [\"*\"] and will be activated for all languages."
"description": "Set the languages that the extension will be activated. e.g. [\"html\",\"xml\",\"php\"] By default, it is [\"*\"] and will be activated for all languages.",
"scope": "resource"
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/tagManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ export class TagManager {
}

private isEnabled(): boolean {
if (!vscode.window.activeTextEditor || !vscode.window.activeTextEditor.document) {
const editor = vscode.window.activeTextEditor;
if (!editor || !editor.document) {
return false;
}
let languageId = vscode.window.activeTextEditor.document.languageId;
let config = vscode.workspace.getConfiguration('auto-rename-tag');
let config = vscode.workspace.getConfiguration('auto-rename-tag', editor.document.uri);
let languages = config.get<string[]>("activationOnLanguage", ["*"]);
if (languages.indexOf("*") === -1 && languages.lastIndexOf(languageId) === -1) {
return false;
Expand Down

0 comments on commit 3141e78

Please sign in to comment.