diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..02509e2 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,23 @@ +{ + "env": { + "browser": false, + "commonjs": true, + "es6": true, + "node": true + }, + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "sourceType": "module" + }, + "rules": { + "no-const-assign": "warn", + "no-this-before-super": "warn", + "no-undef": "warn", + "no-unreachable": "warn", + "no-unused-vars": "warn", + "constructor-super": "warn", + "valid-typeof": "warn" + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..0915202 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the extensions.json format + "recommendations": [ + "dbaeumer.vscode-eslint" + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..05dca91 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,22 @@ +// A launch configuration that launches the extension inside a new window +{ + "version": "0.1.0", + "configurations": [ + { + "name": "Launch Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], + "stopOnEntry": false + }, + { + "name": "Launch Tests", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/test" ], + "stopOnEntry": false + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..20af2f6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +// Place your settings in this file to overwrite default and user settings. +{ +} \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..499648c --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,7 @@ +.vscode/** +.vscode-test/** +test/** +.gitignore +jsconfig.json +vsc-extension-quickstart.md +.eslintrc.json diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b447b05 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Change Log +All notable changes to the "todone" extension will be documented in this file. + +Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. + +## [Unreleased] +- Initial release \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f73df06 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# All your base are belong to us diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..b7caa7d --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ] + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..9016688 --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,33 @@ +{ + "comments": { + "lineComment": "+" + }, + "autoClosingPairs": [ + { + "open": "`", + "close": "`" + }, + { + "open": "///", + "close": "///" + }, + { + "open": "/*", + "close": "*/" + } + ], + "surroundingPairs": [ + [ + "///", + "///" + ], + [ + "`", + "`" + ], + [ + "/*", + "*/" + ] + ] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..42f26a5 --- /dev/null +++ b/package.json @@ -0,0 +1,64 @@ +{ + "name": "todone", + "displayName": "todone", + "description": "Simple, hierarchical, prioritized to do lists in plain text", + "version": "0.0.1", + "publisher": "tiffon", + "engines": { + "vscode": "^1.16.0" + }, + "categories": [ + "Other" + ], + "contributes": { + "languages": [ + { + "id": "todone", + "aliases": [ + "ToDone", + "To-Done" + ], + "extensions": [ + ".todone", + ".todo" + ], + "configuration": "./language-configuration.json" + } + ], + "grammars": [ + { + "language": "todone", + "scopeName": "text.todone", + "path": "./todone.tmLanguage" + } + ], + "configurationDefaults": { + "[todone]": { + "editor.tabSize": 5, + "editor.insertSpaces": false, + "editor.tokenColorCustomizations": { + "textMateRules": [ + { + "scope": "symbol.definition.task-heading.todone", + "settings": { + "foreground": "#ff8800" + } + } + ] + } + } + } + }, + "scripts": { + "postinstall": "node ./node_modules/vscode/bin/install", + "test": "node ./node_modules/vscode/bin/test" + }, + "devDependencies": { + "typescript": "^2.5.2", + "vscode": "^1.1.5", + "mocha": "^3.5.0", + "eslint": "^4.6.1", + "@types/node": "^7.0.0", + "@types/mocha": "^2.2.42" + } +} diff --git a/test/extension.test.js b/test/extension.test.js new file mode 100644 index 0000000..c3c1517 --- /dev/null +++ b/test/extension.test.js @@ -0,0 +1,24 @@ +/* global suite, test */ + +// +// Note: This example test is leveraging the Mocha test framework. +// Please refer to their documentation on https://mochajs.org/ for help. +// + +// The module 'assert' provides assertion methods from node +var assert = require('assert'); + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +var vscode = require('vscode'); +var myExtension = require('../extension'); + +// Defines a Mocha test suite to group tests of similar kind together +suite("Extension Tests", function() { + + // Defines a Mocha unit test + test("Something 1", function() { + assert.equal(-1, [1, 2, 3].indexOf(5)); + assert.equal(-1, [1, 2, 3].indexOf(0)); + }); +}); \ No newline at end of file diff --git a/test/index.js b/test/index.js new file mode 100644 index 0000000..5604517 --- /dev/null +++ b/test/index.js @@ -0,0 +1,22 @@ +// +// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING +// +// This file is providing the test runner to use when running extension tests. +// By default the test runner in use is Mocha based. +// +// You can provide your own test runner if you want to override it by exporting +// a function run(testRoot: string, clb: (error:Error) => void) that the extension +// host can call to run the tests. The test runner is expected to use console.log +// to report the results back to the caller. When the tests are finished, return +// a possible error to the callback or null if none. + +var testRunner = require('vscode/lib/testrunner'); + +// You can directly control Mocha options by uncommenting the following lines +// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info +testRunner.configure({ + ui: 'tdd', // the TDD UI is being used in extension.test.js (suite, test, etc.) + useColors: true // colored output from test results +}); + +module.exports = testRunner; \ No newline at end of file diff --git a/todone-0.0.1.vsix b/todone-0.0.1.vsix new file mode 100644 index 0000000..939242f Binary files /dev/null and b/todone-0.0.1.vsix differ diff --git a/todone.tmLanguage b/todone.tmLanguage new file mode 100644 index 0000000..5134aae --- /dev/null +++ b/todone.tmLanguage @@ -0,0 +1,639 @@ + + + + + fileTypes + + todo + todone + + name + ToDone + patterns + + + include + #everything + + + repository + + complete + + begin + ^(\s*)(\+!?)(\-+)? + beginCaptures + + 2 + + name + keyword.operator.completed.todone + + 3 + + name + keyword.operator.completed.secondary.todone + + + end + ^(?!\1)|^\s*$|^(?=\1[^\s]) + name + storage.type.task.completed.todone + patterns + + + match + ^\s+(\+)?(!?\-+) + name + keyword.operator.completed.secondary.todone + + + include + #ignore + + + include + #task-over-raw-note + + + + everything + + patterns + + + include + #complete + + + include + #ignore + + + include + #task-class + + + include + #lvl-disaster + + + include + #lvl-1 + + + include + #lvl-2 + + + include + #lvl-3 + + + include + #lvl-4 + + + include + #lvl-5 + + + include + #note + + + + ignore + + begin + (?x) +^ + (\s*) + (\.)(\+?!?\-+[12345]?) + \s* + (?:\( + ([^\)]+) + \))? + + beginCaptures + + 2 + + name + keyword.operator.ignore.todone + + 3 + + name + keyword.operator.ignore.secondary.todone + + 4 + + name + keyword.operator.ignore.desc.todone + + + end + ^(?!\1)|^\s*$|^(?=\1[^\s]) + name + storage.type.task.ignore.todone + patterns + + + captures + + 0 + + name + keyword.operator.ignore.secondary.todone + + + match + ^\s+\.?\+?\s*!?\s*\-+ + name + keyword.operator.task.todone + + + include + #task-over-raw-note + + + + lvl-1 + + begin + (\s*)(\-{1}|\-(1))\s+((?:://|/(?!//)|[^:\n/])*) + beginCaptures + + 0 + + name + symbol.definition.task-heading.todone + + 2 + + name + keyword.operator.task.lvl1.todone + + 3 + + name + keyword.operator.task.numeral.lvl1.todone + + 4 + + name + entity.name.task.lvl1.todone + + + end + ^(?!\1)|^(?=\s*\n)|^(?=\1[^\s]) + name + storage.type.task.todone + patterns + + + include + #everything + + + + lvl-2 + + begin + (\s*)(\-{2}|\-(2))\s+((?:://|/(?!//)|[^:\n/])*) + beginCaptures + + 0 + + name + symbol.definition.task-heading.todone + + 2 + + name + keyword.operator.task.lvl2.todone + + 3 + + name + keyword.operator.task.numeral.lvl2.todone + + 4 + + name + entity.name.task.lvl2.todone + + + end + ^(?!\1)|^(?=\s*\n)|^(?=\1[^\s]) + name + storage.type.task.todone + patterns + + + include + #everything + + + + lvl-3 + + begin + (\s*)(\-{3}|\-(3))\s+((?:://|/(?!//)|[^:\n/])*) + beginCaptures + + 0 + + name + symbol.definition.task-heading.todone + + 2 + + name + keyword.operator.task.lvl3.todone + + 3 + + name + keyword.operator.task.numeral.lvl3.todone + + 4 + + name + entity.name.task.lvl3.todone + + + end + ^(?!\1)|^(?=\s*\n)|^(?=\1[^\s]) + name + storage.type.task.todone + patterns + + + include + #everything + + + + lvl-4 + + begin + (\s*)(\-{4}|\-(4))\s+((?:://|/(?!//)|[^:\n/])*) + beginCaptures + + 0 + + name + symbol.definition.task-heading.todone + + 2 + + name + keyword.operator.task.lvl4.todone + + 3 + + name + keyword.operator.task.numeral.lvl4.todone + + 4 + + name + entity.name.task.lvl4.todone + + + end + ^(?!\1)|^(?=\s*\n)|^(?=\1[^\s]) + name + storage.type.task.todone + patterns + + + include + #everything + + + + lvl-5 + + begin + (\s*)(\-{5}|\-(5))\s+((?:://|/(?!//)|[^:\n/])*) + beginCaptures + + 0 + + name + symbol.definition.task-heading.todone + + 2 + + name + keyword.operator.task.lvl5.todone + + 3 + + name + keyword.operator.task.numeral.lvl5.todone + + 4 + + name + entity.name.task.lvl5.todone + + + end + ^(?!\1)|^(?=\s*\n)|^(?=\1[^\s]) + name + storage.type.task.todone + patterns + + + include + #everything + + + + lvl-disaster + + begin + (?x) +(\s*) +(!) + (?: + (\-{1}|\-(1))\s+((?:://|/(?!//)|[^:\n/])*:?) | + (\-{2}|\-(2))\s+((?:://|/(?!//)|[^:\n/])*:?) | + (\-{3}|\-(3))\s+((?:://|/(?!//)|[^:\n/])*:?) | + (\-{4}|\-(4))\s+((?:://|/(?!//)|[^:\n/])*:?) | + (\-{5}|\-(5))\s+((?:://|/(?!//)|[^:\n/])*:?) + + ) + + beginCaptures + + 0 + + name + symbol.definition.task-heading.todone + + 10 + + name + keyword.operator.task.numeral.lvl3.todone + + 11 + + name + entity.name.task.lvl3.todone + + 12 + + name + keyword.operator.task.lvl4.todone + + 13 + + name + keyword.operator.task.numeral.lvl4.todone + + 14 + + name + entity.name.task.lvl4.todone + + 15 + + name + keyword.operator.task.lvl5.todone + + 16 + + name + keyword.operator.task.numeral.lvl5.todone + + 17 + + name + entity.name.task.lvl5.todone + + 2 + + name + punctuation.definition.disaster.begin.todone + + 3 + + name + keyword.operator.task.lvl1.todone + + 4 + + name + keyword.operator.task.numeral.lvl1.todone + + 5 + + name + entity.name.task.lvl1.todone + + 6 + + name + keyword.operator.task.lvl2.todone + + 7 + + name + keyword.operator.task.numeral.lvl2.todone + + 8 + + name + entity.name.task.lvl2.todone + + 9 + + name + keyword.operator.task.lvl3.todone + + + end + ^(?!\1\s)|^(?=\s*\n)|^(?=\1[^\s]) + endCaptures + + 0 + + name + punctuation.definition.class-block.todone + + + name + meta.condition.disaster.todone + patterns + + + include + #everything + + + + note + + begin + (?=.) + end + $ + name + storage.task-note.todone + patterns + + + match + ((?!///)[^`])+ + + + + include + #note-em + + + include + #raw-note + + + + note-em + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.note.em.begin.todone + + + end + ` + endCaptures + + 0 + + name + punctuation.definition.note.em.end.todone + + + name + storage.task-note.em.todone + patterns + + + match + \\` + + + + raw-note + + begin + /// + beginCaptures + + 0 + + name + punctuation.definition.note.raw.begin.todone + + + end + /// + endCaptures + + 0 + + name + punctuation.definition.note.raw.end.todone + + + name + storage.task-note.raw.todone + patterns + + + include + #note-em + + + match + ((?!///)[^`])+ + + + + + task-class + + patterns + + + begin + \/\* + beginCaptures + + 0 + + name + punctuation.definition.class-block.todone + + + end + \*\/ + endCaptures + + 0 + + name + punctuation.definition.class-block.todone + + + name + entity.name.class.todone + + + match + ^[^\s\.\-+!].*$ + name + entity.name.class.todone + + + + task-over-raw-note + + begin + /// + end + /// + patterns + + + begin + ` + end + ` + patterns + + + match + \\` + + + + + + + scopeName + text.todone + uuid + 12e7f4f7-cca7-4ce0-a426-d8d7cf029da2 + + diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md new file mode 100644 index 0000000..4728aac --- /dev/null +++ b/vsc-extension-quickstart.md @@ -0,0 +1,33 @@ +# Welcome to your first VS Code Extension + +## What's in the folder +* This folder contains all of the files necessary for your extension +* `package.json` - this is the manifest file in which you declare your extension and command. +The sample plugin registers a command and defines its title and command name. With this information +VS Code can show the command in the command palette. It doesn’t yet need to load the plugin. +* `extension.js` - this is the main file where you will provide the implementation of your command. +The file exports one function, `activate`, which is called the very first time your extension is +activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`. +We pass the function containing the implementation of the command as the second parameter to +`registerCommand`. + +## Get up and running straight away +* press `F5` to open a new window with your extension loaded +* run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World` +* set breakpoints in your code inside extension.js to debug your extension +* find output from your extension in the debug console + +## Make changes +* you can relaunch the extension from the debug toolbar after changing code in `extension.js` +* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes + +## Explore the API +* you can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts` + +## Run tests +* open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests` +* press `F5` to run the tests in a new window with your extension loaded +* see the output of the test result in the debug console +* make changes to `test/extension.test.js` or create new test files inside the `test` folder + * by convention, the test runner will only consider files matching the name pattern `**.test.js` + * you can create folders inside the `test` folder to structure your tests any way you want \ No newline at end of file