-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7e4cdc
commit 2d91247
Showing
8 changed files
with
191 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"version": "0.1.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ], | ||
"stopOnEntry": false, | ||
"sourceMaps": true, | ||
"outFiles": [ "${workspaceRoot}/out/src/**/*.js" ], | ||
"preLaunchTask": "npm" | ||
}, | ||
{ | ||
"name": "Launch Tests", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ], | ||
"stopOnEntry": false, | ||
"sourceMaps": true, | ||
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ], | ||
"preLaunchTask": "npm" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"files.exclude": { | ||
"out": false | ||
}, | ||
"search.exclude": { | ||
"out": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"version": "0.1.0", | ||
"command": "npm", | ||
"isShellCommand": true, | ||
"showOutput": "silent", | ||
"args": ["run", "compile", "--loglevel", "silent"], | ||
"isBackground": true, | ||
"problemMatcher": "$tsc-watch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
out/test/** | ||
test/** | ||
src/** | ||
**/*.map | ||
.gitignore | ||
tsconfig.json | ||
vsc-extension-quickstart.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
# Change Log | ||
|
||
All notable changes to the "tanakh" extension will be documented in this file. | ||
|
||
Check [Keep a Changelog](https://keepachangelog.com/) for recommendations on how to structure this file. | ||
|
||
## [Unreleased] | ||
- Initial release | ||
|
||
## [1.0.0] | ||
|
||
### Added | ||
|
||
- Beautiful spinning tanakh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "tanakh", | ||
"displayName": "tanakh", | ||
"description": "(´・_・`)", | ||
"version": "1.0.0", | ||
"publisher": "acid-chicken", | ||
"license": "MIT", | ||
"engines": { | ||
"vscode": "^1.10.0" | ||
}, | ||
"categories": [ | ||
"Other" | ||
], | ||
"keywords": [ | ||
"tanakh", | ||
"たなこふ" | ||
], | ||
"activationEvents": [ | ||
"*" | ||
], | ||
"contributes": { | ||
"commands": [ | ||
{ | ||
"command": "extension.updateTanakh", | ||
"title": "たなこふ" | ||
} | ||
] | ||
}, | ||
"main": "./out/src/extension", | ||
"scripts": { | ||
"vscode:prepublish": "tsc -p ./", | ||
"compile": "tsc -watch -p ./", | ||
"postinstall": "node ./node_modules/vscode/bin/install" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^2.0.3", | ||
"vscode": "^1.0.0", | ||
"@types/node": "^6.0.106" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/acid-chicken/vscode-tanakh.git" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
'use strict' | ||
|
||
import * as vscode from 'vscode' | ||
|
||
export function activate(context: vscode.ExtensionContext) { | ||
let tanakh = new Tanakh() | ||
let controller = new TanakhController(tanakh) | ||
let disposable = vscode.commands.registerCommand('extension.updateTanakh', () => { | ||
tanakh.update() | ||
}) | ||
context.subscriptions.push(controller) | ||
context.subscriptions.push(tanakh) | ||
context.subscriptions.push(disposable) | ||
} | ||
|
||
export function deactivate() { | ||
} | ||
|
||
class Tanakh { | ||
public constructor() { | ||
this.status.command = 'extension.updateTanakh' | ||
this.status.tooltip = 'たなこふ' | ||
} | ||
|
||
public update() { | ||
this.counter++ | ||
this.status.text = this.faces[this.counter %= this.faces.length] | ||
this.status.show() | ||
} | ||
|
||
public dispose() { | ||
this.status.dispose() | ||
} | ||
|
||
private status = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right) | ||
|
||
private counter = 0 | ||
|
||
private faces = [ | ||
' (´・_・`)´・_・`) ', | ||
' (´・_・`)_・`) ', | ||
' (´・_・`)`) ', | ||
' ((´・_・`) ', | ||
' (´・(´・_・`) ', | ||
' (´・_(´・_・`) ', | ||
' (´・_・`)´・_・`) ', | ||
' (´・_・`)_・`) ', | ||
' (´・_・`)`) ', | ||
' (´・_・`)) ', | ||
' ((´・_・`) ', | ||
' (´・(´・_・`) ', | ||
' (´・_(´・_・`) ' | ||
] | ||
} | ||
|
||
class TanakhController { | ||
private tanakh: Tanakh | ||
private disposable: vscode.Disposable | ||
|
||
public constructor(tanakh: Tanakh) { | ||
this.tanakh = tanakh | ||
let subscriptions: vscode.Disposable[] = [] | ||
vscode.window.onDidChangeTextEditorSelection(this.tanakh.update, this, subscriptions) | ||
this.tanakh.update() | ||
this.disposable = vscode.Disposable.from(...subscriptions) | ||
} | ||
|
||
public dispose() { | ||
this.disposable.dispose() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es6", | ||
"outDir": "out", | ||
"lib": [ | ||
"es6" | ||
], | ||
"sourceMap": true, | ||
"rootDir": "." | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
".vscode-test" | ||
] | ||
} |