Skip to content

Commit

Permalink
Items Explorer view - Initial contribution (#20)
Browse files Browse the repository at this point in the history
Items Explorer view - Initial contribution
* Items Explorer - added Item icons + cleanup
* Rule template PR discussion follow-up.
Added "Copy State" context menu for Items.
Removed ongoing "Find References" feature.
General code cleanup.
Added Item code completions - Closes #7
* Documented code + updated changelog
* Version bump

Signed-off-by: Kuba Wolanin <hi@kubawolanin.com> (github: kubawolanin)
  • Loading branch information
kubawolanin authored Jul 7, 2017
1 parent 96ce27f commit 8b62397
Show file tree
Hide file tree
Showing 36 changed files with 831 additions and 107 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
out
node_modules
*.vsix
*.vsix
*.todo
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# This file lists all individuals having contributed content to the repository.
# For how it is generated, see `project-orga/generate-authors.sh`.

Claudio Spizzi <claudiospizzi@users.noreply.github.com>
Dennis Gieseler <dennisausbremen@users.noreply.github.com>
Kai Kreuzer <kai@openhab.org>
Kuba Wolanin <hi@kubawolanin.com>
Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# openHAB VS Code Extension Change Log

## Unreleased
- Add icon theme
## 0.1.0 - 2017-07-07
- Completely new openHAB Items Explorer view in the sidebar!
- Preview **all** of your items thanks to the REST API
- Dynamic rules from the Items Explorer view - including the current state
- Ability to copy Item's name and state
- Clicking non-Group item opens it in the Paper UI by default
- Note: Currently in VS Code stable Items Explorer is permanently visible. VS Code Insiders allows you to hide the tree view thanks to [vscode#29436](https://github.com/Microsoft/vscode/issues/29436)
- Added Items autocompletion (with IntelliSense documentation) (#7)
- Quick search in the Community Forum
- Added icon theme

## 0.0.2 - 2017-06-21
- openHAB hostname and port are now configurable through user or workspace settings (#14)
Expand Down
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,20 @@ general guidelines for the community as a whole:
respond to an email you are potentially sending to a large number of
people. Please consider this before you update. Also remember that
nobody likes spam.

## Attributions

The following icons were used from [Material Design Iconset](material.io/icons/) (available under the Apache License Version 2.0):

| Item type | Icon name |
|--|--|
| Color | `ic_format_color_fill_black_24px` |
| Contact | `ic_flip_black_24px` |
| DateTime | `ic_access_time_black_24px` |
| Dimmer | `ic_brightness_medium_black_24px` |
| Switch | `ic_radio_button_checked_black_24px` |
| String | `ic_view_headline_black_24px` |
| Group | `ic_folder_open_black_24px` |
| Number | `ic_dialpad_black_24px` |
| Player | `ic_play_circle_outline_black_24px` |
| Rollershutter | `ic_line_weight_black_24px` |
146 changes: 109 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"name": "openhab",
"displayName": "openHAB",
"description": "openHAB syntax highlight, code snippets, integrated Basic UI preview and docs search",
"version": "0.0.2",
"version": "0.1.0",
"publisher": "openhab",
"icon": "openhab.png",
"repository": {
"type": "git",
"url": "https://github.com/openhab/openhab-vscode.git"
},
"license": "SEE LICENSE IN LICENSE",
"engines": {
"vscode": "^1.13.0"
},
Expand All @@ -21,41 +22,97 @@
"onCommand:openhab.searchDocs",
"onCommand:openhab.searchCommunity",
"onCommand:openhab.basicUI",
"onCommand:openhab.command.items.refreshEntry",
"onCommand:openhab.command.items.showInPaperUI",
"onCommand:openhab.command.items.copyName",
"onCommand:openhab.command.items.copyState",
"onCommand:openhab.command.items.addRule",
"onLanguage:openhab"
],
"main": "./out/src/extension",
"contributes": {
"menus": {
"editor/title": [{
"when": "resourceLangId == openhab",
"command": "openhab.basicUI",
"group": "navigation"
}]
"when": "resourceLangId == openhab",
"command": "openhab.basicUI",
"group": "navigation"
}],
"view/title": [{
"command": "openhab.command.items.refreshEntry",
"when": "view == openhabItems",
"group": "navigation"
}],
"view/item/context": [{
"command": "openhab.command.items.showInPaperUI",
"when": "view == openhabItems"
},
{
"command": "openhab.command.items.copyName",
"when": "view == openhabItems"
},
{
"command": "openhab.command.items.copyState",
"when": "view == openhabItems && viewItem != statelessItem && viewItem != statelessGroup"
},
{
"command": "openhab.command.items.addRule",
"when": "view == openhabItems"
}
]
},
"keybindings": [{
"when": "resourceLangId == openhab",
"command": "openhab.basicUI",
"key": "ctrl+alt+o",
"mac": "cmd+alt+o"
}, {
},
{
"when": "resourceLangId == openhab",
"command": "openhab.searchDocs",
"key": "shift+alt+o"
}],
}
],
"commands": [{
"command": "openhab.searchDocs",
"title": "openHAB: Search in Docs"
}, {
},
{
"command": "openhab.searchCommunity",
"title": "openHAB: Search in Community Forum"
}, {
},
{
"command": "openhab.command.items.showInPaperUI",
"title": "Show in Paper UI"
},
{
"command": "openhab.command.items.addRule",
"title": "Create a Rule"
},
{
"command": "openhab.command.items.copyName",
"title": "Copy Name"
},
{
"command": "openhab.command.items.copyState",
"title": "Copy State"
},
{
"command": "openhab.command.items.refreshEntry",
"title": "Refresh",
"icon": {
"light": "resources/light/refresh.svg",
"dark": "resources/dark/refresh.svg"
}
},
{
"command": "openhab.basicUI",
"title": "openHAB: Open Basic UI",
"icon": {
"light": "./images/oh_color.svg",
"dark": "./images/oh.svg"
}
}],
}
],
"configuration": {
"type": "object",
"title": "openHAB Configuration",
Expand All @@ -78,35 +135,46 @@
}
},
"languages": [{
"id": "openhab",
"aliases": ["openHAB"],
"extensions": [
".rules",
".script",
".items",
".sitemap",
".things",
".persist"
],
"configuration": "./language-configuration.json"
}],
"id": "openhab",
"aliases": [
"openHAB"
],
"extensions": [
".rules",
".script",
".items",
".sitemap",
".things",
".persist"
],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "openhab",
"scopeName": "source.openhab",
"path": "./syntaxes/openhab.tmLanguage.json"
}],
"language": "openhab",
"scopeName": "source.openhab",
"path": "./syntaxes/openhab.tmLanguage.json"
}],
"views": {
"explorer": [{
"id": "openhabItems",
"name": "openHAB Items",
"when": "resourceLangId == openhab"
}]
},
"snippets": [{
"language": "openhab",
"path": "./snippets/openhabrules.json"
}, {
},
{
"language": "openhab",
"path": "./snippets/openhab.json"
}],
}
],
"iconThemes": [{
"id": "openhab",
"label": "openHAB",
"path": "./fileicons/openhab-icon-theme.json"
}]
"id": "openhab",
"label": "openHAB",
"path": "./fileicons/openhab-icon-theme.json"
}]
},
"scripts": {
"vscode:prepublish": "tsc -p ./",
Expand All @@ -115,14 +183,18 @@
"test": "node ./node_modules/vscode/bin/test"
},
"devDependencies": {
"@types/node": "^6.0.40",
"@types/mocha": "^2.2.32",
"typescript": "^2.0.3",
"vscode": "^1.0.0",
"mocha": "^2.3.3",
"@types/node": "^6.0.40",
"@types/mocha": "^2.2.32"
"mocha": "^2.3.3"
},
"dependencies": {
"@types/lodash": "^4.14.58",
"lodash": "^4.17.4"
"@types/request-promise-native": "^1.0.5",
"copy-paste": "^1.3.0",
"lodash": "^4.17.4",
"request": "^2.81.0",
"request-promise-native": "^1.0.4"
}
}
}
5 changes: 5 additions & 0 deletions resources/dark/color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/dark/contact.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions resources/dark/datetime.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/dark/dimmer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/dark/group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/dark/number.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/dark/player.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/dark/refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions resources/dark/rollershutter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/dark/string.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/dark/switch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions resources/light/color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/light/contact.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions resources/light/datetime.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/light/dimmer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/light/group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/light/number.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/light/player.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/light/refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8b62397

Please sign in to comment.