├── .eslintrc.json ├── .gitignore ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── .vscodeignore ├── README.md ├── extension.js ├── jsconfig.json ├── package.json └── test ├── extension.test.js └── index.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": false, 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "parserOptions": { 9 | "ecmaFeatures": { 10 | "jsx": true 11 | }, 12 | "sourceType": "module" 13 | }, 14 | "rules": { 15 | "no-const-assign": "warn", 16 | "no-this-before-super": "warn", 17 | "no-undef": "warn", 18 | "no-unreachable": "warn", 19 | "no-unused-vars": "warn", 20 | "constructor-super": "warn", 21 | "valid-typeof": "warn" 22 | } 23 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Launch Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], 11 | "stopOnEntry": false 12 | }, 13 | { 14 | "name": "Launch Tests", 15 | "type": "extensionHost", 16 | "request": "launch", 17 | "runtimeExecutable": "${execPath}", 18 | "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/test" ], 19 | "stopOnEntry": false 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version 4 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | test/** 4 | .gitignore 5 | jsconfig.json 6 | vsc-extension-quickstart.md 7 | .eslintrc.json 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tab Hero 2 | 3 | Tab Hero allows users to save a set of tabs, then restore that set of tabs later on 4 | 5 | ## Features 6 | 7 | `Cmd+Shift+P` or `Ctrl+Shift+P` to access the menu 8 | `Save Tab Set` saves all open tabs 9 | `Open Tab Set` opens the saved tab set 10 | 11 | ## Release Notes 12 | 13 | Beta 14 | 15 | ## Known Issues 16 | 17 | There is currently no persistance when you close VS Code. 18 | When initially opening VS Code, only the focused tab and any accessed files after that are registered to the extension. So any files that are opened with background focus initially are not registered to the extension until they are given focus. 19 | 20 | ### 0.0.1 21 | 22 | Initial release of Tab Hero (Beta) 23 | -------------------------------------------------------------------------------- /extension.js: -------------------------------------------------------------------------------- 1 | let vscode = require('vscode'); 2 | let savedSet = []; 3 | 4 | function activate(context) { 5 | 6 | console.log('Tab Hero is now active! Let\'s save those tabs!'); 7 | 8 | let saveTabSet = vscode.commands.registerCommand('extension.saveTabSet', function () { 9 | savedSet = vscode.workspace.textDocuments.filter(item => !item.isUntitled); 10 | vscode.window.showInformationMessage('Tabs Saved! : ' + savedSet.length); 11 | }); 12 | 13 | let openTabSet = vscode.commands.registerCommand('extension.openTabSet', function () { 14 | vscode.window.showInformationMessage('Tabs to Open: ' + savedSet.length); 15 | savedSet.forEach((tab) => { 16 | vscode.workspace.openTextDocument(tab.uri) 17 | .then(doc => vscode.window.showTextDocument(doc)) 18 | }); 19 | }); 20 | 21 | vscode.workspace.onDidOpenTextDocument((document) => { 22 | console.log('Document opened: ', document); 23 | console.log('Current documents:', vscode.workspace.textDocuments); 24 | }); 25 | 26 | context.subscriptions.push(saveTabSet, openTabSet); 27 | } 28 | exports.activate = activate; 29 | 30 | function deactivate() { 31 | } 32 | exports.deactivate = deactivate; 33 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "lib": [ 6 | "es6" 7 | ] 8 | }, 9 | "exclude": [ 10 | "node_modules" 11 | ] 12 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tab-hero", 3 | "displayName": "Tab Hero", 4 | "description": "A tab saving extension for VS Code", 5 | "version": "0.0.1", 6 | "publisher": "devtanc", 7 | "engines": { 8 | "vscode": "^1.5.0" 9 | }, 10 | "categories": [ 11 | "Other" 12 | ], 13 | "keywords": [ 14 | "tab", 15 | "workspace", 16 | "save", 17 | "manage" 18 | ], 19 | "activationEvents": [ 20 | "*" 21 | ], 22 | "main": "./extension", 23 | "contributes": { 24 | "commands": [{ 25 | "command": "extension.saveTabSet", 26 | "title": "Save Tab Set" 27 | }, { 28 | "command": "extension.openTabSet", 29 | "title": "Open Tab Set" 30 | }] 31 | }, 32 | "scripts": { 33 | "postinstall": "node ./node_modules/vscode/bin/install" 34 | }, 35 | "devDependencies": { 36 | "typescript": "^2.0.3", 37 | "vscode": "^1.0.0", 38 | "mocha": "^2.3.3", 39 | "eslint": "^3.6.0", 40 | "@types/node": "^6.0.40", 41 | "@types/mocha": "^2.2.32" 42 | } 43 | } -------------------------------------------------------------------------------- /test/extension.test.js: -------------------------------------------------------------------------------- 1 | /* global suite, test */ 2 | 3 | // 4 | // Note: This example test is leveraging the Mocha test framework. 5 | // Please refer to their documentation on https://mochajs.org/ for help. 6 | // 7 | 8 | // The module 'assert' provides assertion methods from node 9 | var assert = require('assert'); 10 | 11 | // You can import and use all API from the 'vscode' module 12 | // as well as import your extension to test it 13 | var vscode = require('vscode'); 14 | var myExtension = require('../extension'); 15 | 16 | // Defines a Mocha test suite to group tests of similar kind together 17 | suite("Extension Tests", function() { 18 | 19 | // Defines a Mocha unit test 20 | test("Something 1", function() { 21 | assert.equal(-1, [1, 2, 3].indexOf(5)); 22 | assert.equal(-1, [1, 2, 3].indexOf(0)); 23 | }); 24 | }); -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testRoot: string, clb: (error:Error) => void) that the extension 9 | // host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | var testRunner = require('vscode/lib/testrunner'); 14 | 15 | // You can directly control Mocha options by uncommenting the following lines 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info 17 | testRunner.configure({ 18 | ui: 'tdd', // the TDD UI is being used in extension.test.js (suite, test, etc.) 19 | useColors: true // colored output from test results 20 | }); 21 | 22 | module.exports = testRunner; --------------------------------------------------------------------------------