├── .gitignore ├── .prettierignore ├── typings ├── node.d.ts └── vscode-typings.d.ts ├── images ├── dash.png ├── vscode-dash.gif └── dash-docset-key.jpg ├── .prettierrc ├── test ├── mocha.opts ├── index.ts └── dash.test.ts ├── .editorconfig ├── .vscodeignore ├── .travis.yml ├── .github ├── pull-request-template.md └── no-response.yml ├── tsconfig.json ├── wallaby.ts ├── .vscode ├── settings.json ├── launch.json └── tasks.json ├── LICENSE.md ├── src ├── dash.ts └── extension.ts ├── tslint.json ├── CHANGELOG.md ├── .all-contributorsrc ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | coverage 4 | .nyc_output 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package.json 3 | package-lock.json 4 | out 5 | -------------------------------------------------------------------------------- /typings/node.d.ts: -------------------------------------------------------------------------------- 1 | /// -------------------------------------------------------------------------------- /images/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deerawan/vscode-dash/HEAD/images/dash.png -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 80, 3 | "singleQuote": true, 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /images/vscode-dash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deerawan/vscode-dash/HEAD/images/vscode-dash.gif -------------------------------------------------------------------------------- /typings/vscode-typings.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /images/dash-docset-key.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deerawan/vscode-dash/HEAD/images/dash-docset-key.jpg -------------------------------------------------------------------------------- /test/mocha.opts: -------------------------------------------------------------------------------- 1 | --require ts-node/register 2 | --require source-map-support/register 3 | -R spec 4 | --ui tdd 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | tab_width = 2 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | typings/** 3 | out/test/** 4 | test/** 5 | src/** 6 | **/*.map 7 | .gitignore 8 | .prettierrc 9 | .prettierignore 10 | tsconfig.json 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 8 4 | install: 5 | - 'npm install' 6 | script: 7 | - 'tsc -p ./' 8 | - 'npm test' 9 | after_script: 'cat ./coverage/lcov.info | npx coveralls' 10 | -------------------------------------------------------------------------------- /.github/pull-request-template.md: -------------------------------------------------------------------------------- 1 | ### Changelog 2 | 3 | Please explain the changes you made here. 4 | 5 | ### Checklist 6 | 7 | - [ ] Code compiles correctly 8 | - [ ] Add or update tests, if possible 9 | - [ ] All tests passing 10 | - [ ] Update the README, if necessary 11 | - [ ] New contributor? added myself via `npm run contributor:add` 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "lib": ["es6", "es2017"], 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "outDir": "dist", 8 | "strict": true, 9 | "target": "es6" 10 | }, 11 | "include": ["src/**/*"], 12 | "exclude": ["./node_modules/*"] 13 | } 14 | -------------------------------------------------------------------------------- /wallaby.ts: -------------------------------------------------------------------------------- 1 | module.exports = function(w) { 2 | return { 3 | files: ['src/**/*.ts'], 4 | 5 | tests: ['test/**/*.test.ts'], 6 | 7 | env: { 8 | type: 'node', 9 | }, 10 | 11 | testFramework: 'mocha', 12 | setup: function(wallaby) { 13 | const mocha = wallaby.testFramework; 14 | mocha.ui('tdd'); 15 | // etc. 16 | }, 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // Place your settings in this file to overwrite default and user settings. 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | "typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version, 10 | "editor.formatOnSave": true, 11 | "editor.defaultFormatter": "esbenp.prettier-vscode" 12 | } 13 | -------------------------------------------------------------------------------- /.github/no-response.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-no-response - https://github.com/probot/no-response 2 | 3 | # Number of days of inactivity before an Issue is closed for lack of response 4 | daysUntilClose: 15 5 | # Label requiring a response 6 | responseRequiredLabel: needs more info 7 | # Comment to post when closing an Issue for lack of response. Set to `false` to disable 8 | closeComment: > 9 | This issue has been automatically closed because there has been no response 10 | to our request for more information from the original author. With only the 11 | information that is currently in the issue, we don't have enough information 12 | to take action. Please reach out if you have or find the answers we need so 13 | that we can investigate further. 14 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [{ 5 | "name": "Launch Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "runtimeExecutable": "${execPath}", 9 | "args": ["--extensionDevelopmentPath=${workspaceRoot}"], 10 | "stopOnEntry": false, 11 | "sourceMaps": true, 12 | "outFiles": ["${workspaceRoot}/out/src"], 13 | "preLaunchTask": "npm" 14 | }, 15 | { 16 | "name": "Launch Tests", 17 | "type": "extensionHost", 18 | "request": "launch", 19 | "runtimeExecutable": "${execPath}", 20 | "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test"], 21 | "stopOnEntry": false, 22 | "sourceMaps": true, 23 | "outFiles": ["${workspaceRoot}/out/test"], 24 | "preLaunchTask": "npm" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // Available variables which can be used inside of strings. 2 | // ${workspaceRoot}: the root folder of the team 3 | // ${file}: the current opened file 4 | // ${fileBasename}: the current opened file's basename 5 | // ${fileDirname}: the current opened file's dirname 6 | // ${fileExtname}: the current opened file's extension 7 | // ${cwd}: the current working directory of the spawned process 8 | 9 | // A task runner that calls a custom npm script that compiles the extension. 10 | { 11 | "version": "0.1.0", 12 | 13 | // we want to run npm 14 | "command": "npm", 15 | 16 | // the command is a shell script 17 | "isShellCommand": true, 18 | 19 | // show the output window only if unrecognized errors occur. 20 | "showOutput": "silent", 21 | 22 | // we run the custom script "compile" as defined in package.json 23 | "args": ["run", "compile", "--loglevel", "silent"], 24 | 25 | // The tsc compiler is started in watching mode 26 | "isWatching": true, 27 | 28 | // use the standard tsc in watch mode problem matcher to find compile problems in the output. 29 | "problemMatcher": "$tsc-watch" 30 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Budi Irawan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /test/index.ts: -------------------------------------------------------------------------------- 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 | const testRunner = require('vscode/lib/testrunner'); // eslint-disable-line 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.ts (suite, test, etc.) 19 | useColors: true, // colored output from test results 20 | }); 21 | 22 | module.exports = testRunner; 23 | -------------------------------------------------------------------------------- /src/dash.ts: -------------------------------------------------------------------------------- 1 | const OSOptions: OSOptions = { 2 | darwin: 'open -g', 3 | linux: 'zeal', 4 | // Same technique as Silverlake Software's "Search Docsets" extension, 5 | // which is written by Velocity's developer and is tested to work with current Velocity on W10. 6 | win32: 'cmd.exe /c start "" ', // TODO: do we need extra space? 7 | }; 8 | 9 | export class Dash { 10 | private OS: string; 11 | private URIHandler: string; 12 | private option: DashOption; 13 | 14 | constructor(OS: string, option: DashOption) { 15 | this.OS = OS; 16 | this.URIHandler = OSOptions[this.OS as keyof OSOptions] || 'zeal'; 17 | this.option = option; 18 | } 19 | 20 | /** 21 | * Get command to open dash 22 | * 23 | * @param {string} query - text to find 24 | * @param {string} docsets - array of docset e.g. [css, less] 25 | * @return {string} dash handler and uri 26 | */ 27 | getCommand(query: string, docsets: string[] = []): string { 28 | const keys = (docsets || []) 29 | .map(docset => `${this.option.exactDocset ? 'exact:' : ''}${docset}`) 30 | .join(','); 31 | const encodedQuery = encodeURIComponent(query); 32 | return `${this.URIHandler} "dash-plugin://query=${encodedQuery}${ 33 | keys ? `&keys=${keys}` : `` 34 | }"`; 35 | } 36 | } 37 | 38 | export interface DashOption { 39 | exactDocset: boolean; 40 | } 41 | 42 | interface OSOptions { 43 | darwin: string; 44 | linux: string; 45 | win32: string; 46 | } 47 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsRules": { 3 | "class-name": true, 4 | "comment-format": [true, "check-space"], 5 | "indent": [true, "spaces"], 6 | "no-duplicate-variable": true, 7 | "no-eval": true, 8 | "no-trailing-whitespace": true, 9 | "no-unsafe-finally": true, 10 | "one-line": [true, "check-open-brace", "check-whitespace"], 11 | "quotemark": [true, "double"], 12 | "semicolon": [true, "always"], 13 | "triple-equals": [true, "allow-null-check"], 14 | "variable-name": [true, "ban-keywords"], 15 | "whitespace": [ 16 | true, 17 | "check-branch", 18 | "check-decl", 19 | "check-operator", 20 | "check-separator", 21 | "check-type" 22 | ] 23 | }, 24 | "rules": { 25 | "class-name": true, 26 | "comment-format": [true, "check-space"], 27 | "indent": [true, "spaces"], 28 | "no-eval": true, 29 | "no-internal-module": true, 30 | "no-trailing-whitespace": true, 31 | "no-unsafe-finally": true, 32 | "no-var-keyword": true, 33 | "prefer-const": true, 34 | "one-line": [true, "check-open-brace", "check-whitespace"], 35 | "quotemark": [true, "single"], 36 | "semicolon": [true, "always"], 37 | "triple-equals": [true, "allow-null-check"], 38 | "typedef-whitespace": [ 39 | true, 40 | { 41 | "call-signature": "nospace", 42 | "index-signature": "nospace", 43 | "parameter": "nospace", 44 | "property-declaration": "nospace", 45 | "variable-declaration": "nospace" 46 | } 47 | ], 48 | "variable-name": [true, "ban-keywords"], 49 | "whitespace": [ 50 | true, 51 | "check-branch", 52 | "check-decl", 53 | "check-operator", 54 | "check-separator", 55 | "check-type" 56 | ] 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.4.0 2 | 3 | - Add Gradle support 4 | 5 | ## 2.3.0 6 | 7 | - Add CMake and Latex support (thx to @akdir) 8 | - Add Kotlin support (thx to @markokajzer) 9 | 10 | ## 2.2.0 11 | 12 | - Add Velocity support (thx to @salembeats) 13 | - Set extension type as UI to cater remote development 14 | 15 | ## 2.1.0 16 | 17 | - Add new exact docset option `dash.exactDocset` 18 | 19 | By default Dash will search the keyword in similar or related docsets outside of specified docset e.g. search a keyword in `.ts` file will also search into `vue` and `angular` docset even though only `typescript` and `javascript` specified in setting. 20 | 21 | - Upgrade husky to 1.1.x (thx to @cmygray) 22 | 23 | ## 2.0.0 24 | 25 | BREAKING CHANGES 26 | 27 | **features** 28 | 29 | - add new file name matching map to docsets 30 | - new plugin configuration structure 31 | 32 | ## 1.10.0 33 | 34 | - Add Ansible support 35 | 36 | ## 1.9.0 37 | 38 | - Add Terraform support 39 | 40 | ## 1.8.0 41 | 42 | - Add julia support (txh to [sbromberger](https://github.com/sbromberger)) 43 | 44 | ## 1.7.1 45 | 46 | - Configure prettier and TSLint 47 | - Improve typo (thx to [Weifding](https://github.com/weifding)) 48 | 49 | ## 1.7.0 50 | 51 | - Add two new commands! (thx to [Logan Saso](https://github.com/HazardDev)) 52 | 53 | ## 1.6.0 54 | 55 | - Add haml support 56 | 57 | ## 1.5.0 58 | 59 | - Add Zeal Support (thx to [szhongren](https://github.com/szhongren)!) 60 | - Add javascript to typescript mapping 61 | 62 | ## 1.4.0 63 | 64 | - Add Haxe support 65 | 66 | ## 1.3.0 67 | 68 | - Add Elm support 69 | - Add Change Keyboard Shortcut in README 70 | - Add Language Plugins in README 71 | 72 | ## 1.2.0 73 | 74 | - Add React support 75 | - Add Processing support 76 | - Add Shell Script support 77 | - Add Stylus support 78 | - Add TCL support 79 | - Improve README 80 | -------------------------------------------------------------------------------- /test/dash.test.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert'; 2 | import { Dash, DashOption } from '../src/dash'; 3 | 4 | suite('Dash Tests', () => { 5 | const dashOptionExactDocsetEnabled: DashOption = { exactDocset: true }; 6 | 7 | test('Get command with keys for macOS', () => { 8 | const dash = new Dash('darwin', dashOptionExactDocsetEnabled); 9 | const uri = dash.getCommand('size', ['css', 'less']); 10 | 11 | assert.equal( 12 | uri, 13 | 'open -g "dash-plugin://query=size&keys=exact:css,exact:less"' 14 | ); 15 | }); 16 | 17 | test('Get command with no keys for macOS', () => { 18 | const dash = new Dash('darwin', dashOptionExactDocsetEnabled); 19 | const uri = dash.getCommand('size'); 20 | 21 | assert.equal(uri, 'open -g "dash-plugin://query=size"'); 22 | }); 23 | 24 | test('Get command with keys for Windows', () => { 25 | const dash = new Dash('win32', dashOptionExactDocsetEnabled); 26 | const uri = dash.getCommand('size', ['css', 'less']); 27 | 28 | assert.equal( 29 | uri, 30 | 'cmd.exe /c start "" "dash-plugin://query=size&keys=exact:css,exact:less"' 31 | ); 32 | }); 33 | 34 | test('Get command with no keys for Windows', () => { 35 | const dash = new Dash('win32', dashOptionExactDocsetEnabled); 36 | const uri = dash.getCommand('size'); 37 | 38 | assert.equal(uri, 'cmd.exe /c start "" "dash-plugin://query=size"'); 39 | }); 40 | 41 | test('Get command with keys for Linux', () => { 42 | const dash = new Dash('linux', dashOptionExactDocsetEnabled); 43 | const uri = dash.getCommand('size', ['css', 'less']); 44 | 45 | assert.equal( 46 | uri, 47 | 'zeal "dash-plugin://query=size&keys=exact:css,exact:less"' 48 | ); 49 | }); 50 | 51 | test('Get command with no keys for Linux', () => { 52 | const dash = new Dash('linux', dashOptionExactDocsetEnabled); 53 | const uri = dash.getCommand('size'); 54 | 55 | assert.equal(uri, 'zeal "dash-plugin://query=size"'); 56 | }); 57 | 58 | test('Exact docset disabled', () => { 59 | const dashOptionExactDocsetDisabled: DashOption = { exactDocset: false }; 60 | 61 | const dash = new Dash('darwin', dashOptionExactDocsetDisabled); 62 | const uri = dash.getCommand('size', ['css', 'less']); 63 | 64 | assert.equal(uri, 'open -g "dash-plugin://query=size&keys=css,less"'); 65 | }); 66 | }); 67 | -------------------------------------------------------------------------------- /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "vscode-dash", 3 | "projectOwner": "deerawan", 4 | "files": [ 5 | "README.md" 6 | ], 7 | "imageSize": 100, 8 | "commit": true, 9 | "contributors": [ 10 | { 11 | "login": "deerawan", 12 | "name": "Budi Irawan", 13 | "avatar_url": "https://avatars1.githubusercontent.com/u/1243921?v=4", 14 | "profile": "http://budiirawan.com", 15 | "contributions": [ 16 | "code", 17 | "doc" 18 | ] 19 | }, 20 | { 21 | "login": "profelis", 22 | "name": "Dima Granetchi", 23 | "avatar_url": "https://avatars0.githubusercontent.com/u/250935?v=4", 24 | "profile": "https://github.com/profelis", 25 | "contributions": [ 26 | "code", 27 | "doc" 28 | ] 29 | }, 30 | { 31 | "login": "loganintech", 32 | "name": "Logan Saso", 33 | "avatar_url": "https://avatars2.githubusercontent.com/u/6226408?v=4", 34 | "profile": "https://github.com/loganintech", 35 | "contributions": [ 36 | "code", 37 | "doc" 38 | ] 39 | }, 40 | { 41 | "login": "szhongren", 42 | "name": "Zhongren Shao", 43 | "avatar_url": "https://avatars3.githubusercontent.com/u/8567599?v=4", 44 | "profile": "https://github.com/szhongren", 45 | "contributions": [ 46 | "code", 47 | "doc" 48 | ] 49 | }, 50 | { 51 | "login": "weifding", 52 | "name": "dingweifeng", 53 | "avatar_url": "https://avatars1.githubusercontent.com/u/5329046?v=4", 54 | "profile": "https://github.com/weifding", 55 | "contributions": [ 56 | "doc" 57 | ] 58 | }, 59 | { 60 | "login": "sbromberger", 61 | "name": "Seth Bromberger", 62 | "avatar_url": "https://avatars0.githubusercontent.com/u/941359?v=4", 63 | "profile": "http://www.bromberger.com", 64 | "contributions": [ 65 | "code", 66 | "doc" 67 | ] 68 | }, 69 | { 70 | "login": "br1anchen", 71 | "name": "br1anchen", 72 | "avatar_url": "https://avatars2.githubusercontent.com/u/1086461?v=4", 73 | "profile": "https://github.com/br1anchen", 74 | "contributions": [ 75 | "code" 76 | ] 77 | }, 78 | { 79 | "login": "cmygray", 80 | "name": "Won Kim", 81 | "avatar_url": "https://avatars3.githubusercontent.com/u/26966551?v=4", 82 | "profile": "https://medium.com/@cmygray", 83 | "contributions": [ 84 | "code" 85 | ] 86 | }, 87 | { 88 | "login": "salembeats", 89 | "name": "Cuyler Stuwe", 90 | "avatar_url": "https://avatars0.githubusercontent.com/u/20496944?v=4", 91 | "profile": "https://www.upwork.com/fl/cuylerstuwe", 92 | "contributions": [ 93 | "code" 94 | ] 95 | }, 96 | { 97 | "login": "ozylog", 98 | "name": "Cahya Pribadi", 99 | "avatar_url": "https://avatars3.githubusercontent.com/u/534150?v=4", 100 | "profile": "https://ozylog.com", 101 | "contributions": [ 102 | "code" 103 | ] 104 | }, 105 | { 106 | "login": "markokajzer", 107 | "name": "Marko Kajzer", 108 | "avatar_url": "https://avatars3.githubusercontent.com/u/9379317?v=4", 109 | "profile": "https://github.com/markokajzer", 110 | "contributions": [ 111 | "code" 112 | ] 113 | }, 114 | { 115 | "login": "akdir", 116 | "name": "akdir", 117 | "avatar_url": "https://avatars0.githubusercontent.com/u/19649463?v=4", 118 | "profile": "https://github.com/akdir", 119 | "contributions": [ 120 | "code" 121 | ] 122 | } 123 | ], 124 | "repoType": "github", 125 | "commitConvention": "none" 126 | } 127 | -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | import { 2 | window, 3 | workspace, 4 | commands, 5 | ExtensionContext, 6 | TextEditor, 7 | InputBoxOptions, 8 | } from 'vscode'; 9 | import * as path from 'path'; 10 | import * as micromatch from 'micromatch'; 11 | import { exec } from 'child_process'; 12 | import { Dash, DashOption } from './dash'; 13 | import { platform } from 'os'; 14 | 15 | const OS: string = platform(); 16 | 17 | export function activate(context: ExtensionContext): void { 18 | context.subscriptions.push( 19 | commands.registerCommand('extension.dash.specific', () => { 20 | searchSpecific(); 21 | }) 22 | ); 23 | 24 | context.subscriptions.push( 25 | commands.registerCommand('extension.dash.all', () => { 26 | searchAll(); 27 | }) 28 | ); 29 | 30 | context.subscriptions.push( 31 | commands.registerCommand('extension.dash.emptySyntax', () => { 32 | searchEmptySyntax(); 33 | }) 34 | ); 35 | 36 | context.subscriptions.push( 37 | commands.registerCommand('extension.dash.customSyntax', () => { 38 | searchCustomWithSyntax(); 39 | }) 40 | ); 41 | } 42 | 43 | /** 44 | * Search in dash for selection syntax documentation 45 | */ 46 | function searchSpecific(): void { 47 | const editor = getEditor() as TextEditor; 48 | const query = getSelectedText(editor); 49 | const docsets = getDocsets(); 50 | 51 | const dash = new Dash(OS, getDashOption()); 52 | 53 | exec(dash.getCommand(query, docsets)); 54 | } 55 | 56 | /** 57 | * Search in dash for all documentation 58 | */ 59 | function searchAll(): void { 60 | const editor = getEditor() as TextEditor; 61 | const query = getSelectedText(editor); 62 | const dash = new Dash(OS, getDashOption()); 63 | 64 | exec(dash.getCommand(query)); 65 | } 66 | 67 | /** 68 | * Search in dash for editor syntax documentation 69 | */ 70 | function searchEmptySyntax(): void { 71 | const query = ''; 72 | const docsets = getDocsets(); 73 | const dash = new Dash(OS, getDashOption()); 74 | 75 | exec(dash.getCommand(query, docsets)); 76 | } 77 | 78 | /** 79 | * Search in dash for editor syntax documentation with a custom query 80 | */ 81 | function searchCustomWithSyntax(): void { 82 | const docsets = getDocsets(); 83 | const dash = new Dash(OS, getDashOption()); 84 | 85 | const inputOptions: InputBoxOptions = { 86 | placeHolder: 'Something to search in Dash.', 87 | prompt: 'Enter something to search for in Dash.', 88 | }; 89 | 90 | window.showInputBox(inputOptions).then(query => { 91 | if (query) { 92 | // If they actually input code 93 | exec(dash.getCommand(query, docsets)); // Open it in dash 94 | } 95 | }); 96 | } 97 | 98 | /** 99 | * Get vscode active editor 100 | * 101 | * @return {TextEditor} 102 | */ 103 | function getEditor(): TextEditor | undefined { 104 | const editor = window.activeTextEditor; 105 | if (!editor) { 106 | return; 107 | } 108 | 109 | return editor; 110 | } 111 | 112 | /** 113 | * Get selected text by selection or by cursor position 114 | * 115 | * @param {TextEditor} active editor 116 | * @return {string} 117 | */ 118 | function getSelectedText(editor: TextEditor): string { 119 | const selection = editor.selection; 120 | let text = editor.document.getText(selection); 121 | 122 | if (!text) { 123 | const range = editor.document.getWordRangeAtPosition(selection.active); 124 | text = editor.document.getText(range); 125 | } 126 | 127 | return text; 128 | } 129 | 130 | /** 131 | * Get docset configuration 132 | * 133 | * @param {string} languageId e.g javascript, ruby 134 | * @return {string} 135 | */ 136 | function getDocsets(): string[] { 137 | const editor = getEditor() as TextEditor; 138 | const fileName = path.basename(editor.document.fileName); 139 | const languageId = editor.document.languageId; 140 | 141 | const fileNameDocsets = getFileNameDocsets(fileName); 142 | const languageIdDocsets = getLanguageIdDocsets(languageId); 143 | 144 | // prioritize docset matching by file name then language id 145 | return [...fileNameDocsets, ...languageIdDocsets]; 146 | } 147 | 148 | /** 149 | * Get docsets based on file name 150 | * @param {string} fileName 151 | * @return {string} 152 | */ 153 | function getFileNameDocsets(fileName: string): string[] { 154 | const fileNameConfig = workspace.getConfiguration('dash.fileNameToDocsetMap'); 155 | const matchedFileNameConfigKey = Object.keys(fileNameConfig).find(config => 156 | micromatch.isMatch(fileName, config) 157 | ); 158 | 159 | return matchedFileNameConfigKey 160 | ? fileNameConfig[matchedFileNameConfigKey] 161 | : []; 162 | } 163 | 164 | /** 165 | * Get docsets based on languge id 166 | * @param languageId 167 | * @return {string} 168 | */ 169 | function getLanguageIdDocsets(languageId: string): string[] { 170 | const languageIdConfig = workspace.getConfiguration( 171 | 'dash.languageIdToDocsetMap' 172 | ); 173 | 174 | return languageIdConfig[languageId] || []; 175 | } 176 | 177 | function getDashOption(): DashOption { 178 | const exactDocset = workspace 179 | .getConfiguration('dash') 180 | .get('exactDocset') as boolean; 181 | 182 | return { 183 | exactDocset, 184 | }; 185 | } 186 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-dash", 3 | "displayName": "Dash", 4 | "description": "Dash, Zeal and Velocity integration in Visual Studio Code", 5 | "version": "2.4.0", 6 | "publisher": "deerawan", 7 | "icon": "images/dash.png", 8 | "extensionKind": [ 9 | "ui" 10 | ], 11 | "license": "MIT", 12 | "galleryBanner": { 13 | "color": "#7171AD", 14 | "theme": "dark" 15 | }, 16 | "engines": { 17 | "node": ">8.12.0", 18 | "vscode": "^1.0.0" 19 | }, 20 | "bugs": { 21 | "url": "https://github.com/deerawan/vscode-dash/issues", 22 | "email": "deerawan@gmail.com" 23 | }, 24 | "homepage": "https://github.com/deerawan/vscode-dash", 25 | "repository": { 26 | "type": "git", 27 | "url": "https://github.com/deerawan/vscode-dash" 28 | }, 29 | "categories": [ 30 | "Other" 31 | ], 32 | "activationEvents": [ 33 | "onCommand:extension.dash.all", 34 | "onCommand:extension.dash.specific", 35 | "onCommand:extension.dash.customSyntax", 36 | "onCommand:extension.dash.emptySyntax" 37 | ], 38 | "main": "./dist/extension", 39 | "contributes": { 40 | "commands": [ 41 | { 42 | "command": "extension.dash.specific", 43 | "title": "Search in Dash for current selection" 44 | }, 45 | { 46 | "command": "extension.dash.all", 47 | "title": "Search in Dash for all documentation" 48 | }, 49 | { 50 | "command": "extension.dash.emptySyntax", 51 | "title": "Open Dash for current language documentation" 52 | }, 53 | { 54 | "command": "extension.dash.customSyntax", 55 | "title": "Search in Dash for a custom string" 56 | } 57 | ], 58 | "keybindings": [ 59 | { 60 | "command": "extension.dash.specific", 61 | "key": "ctrl+h", 62 | "mac": "ctrl+h", 63 | "when": "editorTextFocus" 64 | }, 65 | { 66 | "command": "extension.dash.all", 67 | "key": "ctrl+alt+h", 68 | "mac": "ctrl+alt+h", 69 | "when": "editorTextFocus" 70 | }, 71 | { 72 | "command": "extension.dash.emptySyntax", 73 | "key": "ctrl+shift+h", 74 | "mac": "ctrl+shift+h", 75 | "when": "editorTextFocus" 76 | }, 77 | { 78 | "command": "extension.dash.customSyntax", 79 | "key": "alt+h", 80 | "mac": "alt+h", 81 | "when": "editorTextFocus" 82 | } 83 | ], 84 | "configuration": { 85 | "type": "object", 86 | "title": "Dash Configuration", 87 | "properties": { 88 | "dash.languageIdToDocsetMap": { 89 | "type": "object", 90 | "description": "Set mapping of languageId to dash docset.", 91 | "default": { 92 | "ansible": [ 93 | "ansible" 94 | ], 95 | "ansible-advanced": [ 96 | "ansible" 97 | ], 98 | "css": [ 99 | "css", 100 | "bootstrap", 101 | "foundation", 102 | "less", 103 | "awesome", 104 | "cordova", 105 | "phonegap" 106 | ], 107 | "clojure": [ 108 | "clojure" 109 | ], 110 | "cmake": [ 111 | "cmake" 112 | ], 113 | "coffee": [ 114 | "coffee" 115 | ], 116 | "cpp": [ 117 | "cpp", 118 | "net", 119 | "boost", 120 | "qt", 121 | "cvcpp", 122 | "cocos2dx", 123 | "c", 124 | "manpages" 125 | ], 126 | "csharp": [ 127 | "net", 128 | "mono", 129 | "unity3d" 130 | ], 131 | "dart": [ 132 | "dartlang", 133 | "polymerdart", 134 | "angulardart" 135 | ], 136 | "elixir": [ 137 | "elixir" 138 | ], 139 | "elm": [ 140 | "elm" 141 | ], 142 | "erlang": [ 143 | "erlang" 144 | ], 145 | "go": [ 146 | "go", 147 | "godoc" 148 | ], 149 | "gradle": [ 150 | "gradle" 151 | ], 152 | "haskell": [ 153 | "haskell" 154 | ], 155 | "haml": [ 156 | "haml" 157 | ], 158 | "html": [ 159 | "html", 160 | "svg", 161 | "css", 162 | "bootstrap", 163 | "foundation", 164 | "awesome", 165 | "statamic", 166 | "javascript", 167 | "jquery", 168 | "jqueryui", 169 | "jquerym", 170 | "angularjs", 171 | "backbone", 172 | "marionette", 173 | "meteor", 174 | "moo", 175 | "prototype", 176 | "ember", 177 | "lodash", 178 | "underscore", 179 | "sencha", 180 | "extjs", 181 | "knockout", 182 | "zepto", 183 | "cordova", 184 | "phonegap", 185 | "yui" 186 | ], 187 | "jade": [ 188 | "jade" 189 | ], 190 | "java": [ 191 | "java", 192 | "javafx", 193 | "grails", 194 | "groovy", 195 | "playjava", 196 | "spring", 197 | "cvj", 198 | "processing" 199 | ], 200 | "javascript": [ 201 | "javascript", 202 | "jquery", 203 | "jqueryui", 204 | "jquerym", 205 | "react", 206 | "angularjs", 207 | "backbone", 208 | "marionette", 209 | "meteor", 210 | "sproutcore", 211 | "moo", 212 | "prototype", 213 | "bootstrap", 214 | "foundation", 215 | "lodash", 216 | "underscore", 217 | "ember", 218 | "sencha", 219 | "extjs", 220 | "titanium", 221 | "knockout", 222 | "zepto", 223 | "yui", 224 | "d3", 225 | "svg", 226 | "dojo", 227 | "coffee", 228 | "nodejs", 229 | "express", 230 | "grunt", 231 | "mongoose", 232 | "moment", 233 | "require", 234 | "awsjs", 235 | "jasmine", 236 | "sails", 237 | "sinon", 238 | "chai", 239 | "html", 240 | "css", 241 | "cordova", 242 | "phonegap", 243 | "unity3d" 244 | ], 245 | "javascriptreact": [ 246 | "react" 247 | ], 248 | "julia": [ 249 | "julia" 250 | ], 251 | "kotlin": [ 252 | "androidktx", 253 | "kotlin" 254 | ], 255 | "latex": [ 256 | "latex" 257 | ], 258 | "less": [ 259 | "less" 260 | ], 261 | "lua": [ 262 | "lua", 263 | "corona" 264 | ], 265 | "markdown": [ 266 | "markdown" 267 | ], 268 | "objective-c": [ 269 | "iphoneos", 270 | "macosx", 271 | "watchos", 272 | "tvos", 273 | "appledoc", 274 | "cocos2d", 275 | "cocos3d", 276 | "kobold2d", 277 | "sparrow", 278 | "c", 279 | "manpages" 280 | ], 281 | "perl": [ 282 | "perl", 283 | "manpages" 284 | ], 285 | "php": [ 286 | "php", 287 | "wordpress", 288 | "drupal", 289 | "zend", 290 | "laravel", 291 | "yii", 292 | "joomla", 293 | "ee", 294 | "codeigniter", 295 | "cakephp", 296 | "phpunit", 297 | "symfony", 298 | "typo3", 299 | "twig", 300 | "smarty", 301 | "craft", 302 | "phpp", 303 | "html", 304 | "statamic", 305 | "mysql", 306 | "sqlite", 307 | "mongodb", 308 | "psql", 309 | "redis" 310 | ], 311 | "pde": [ 312 | "processing" 313 | ], 314 | "puppet": [ 315 | "puppet" 316 | ], 317 | "python": [ 318 | "python", 319 | "django", 320 | "twisted", 321 | "sphinx", 322 | "flask", 323 | "tornado", 324 | "sqlalchemy", 325 | "numpy", 326 | "scipy", 327 | "salt", 328 | "pandas", 329 | "matplotlib", 330 | "cvp" 331 | ], 332 | "r": [ 333 | "r" 334 | ], 335 | "ruby": [ 336 | "ruby", 337 | "rubygems", 338 | "rails" 339 | ], 340 | "rust": [ 341 | "rust" 342 | ], 343 | "sass": [ 344 | "sass", 345 | "compass", 346 | "bourbon", 347 | "neat", 348 | "susy", 349 | "css" 350 | ], 351 | "scala": [ 352 | "scala", 353 | "akka", 354 | "playscala" 355 | ], 356 | "shellscript": [ 357 | "bash", 358 | "manpages" 359 | ], 360 | "sql": [ 361 | "mysql", 362 | "sqlite", 363 | "psql" 364 | ], 365 | "stylus": [ 366 | "stylus" 367 | ], 368 | "swift": [ 369 | "swift", 370 | "iphoneos", 371 | "macosx", 372 | "watchos", 373 | "tvos", 374 | "appledoc" 375 | ], 376 | "tcl": [ 377 | "tcl" 378 | ], 379 | "typescript": [ 380 | "typescript", 381 | "javascript" 382 | ], 383 | "yaml": [ 384 | "chef", 385 | "ansible" 386 | ], 387 | "haxe": [ 388 | "haxe" 389 | ], 390 | "terraform": [ 391 | "terraform" 392 | ] 393 | } 394 | }, 395 | "dash.fileNameToDocsetMap": { 396 | "type": "object", 397 | "description": "Set mapping of file name to dash docset (supports glob pattern).", 398 | "default": { 399 | "[dD]ocker*": [ 400 | "docker" 401 | ], 402 | "Vagrantfile": [ 403 | "vagrant" 404 | ], 405 | "gruntfile.js": [ 406 | "grunt" 407 | ], 408 | "gulpfile.js": [ 409 | "gulp" 410 | ], 411 | "*.ino": [ 412 | "arduino" 413 | ] 414 | } 415 | }, 416 | "dash.exactDocset": { 417 | "type": "boolean", 418 | "description": "Controls whether Dash should search the keyword in exact docsets specified in docset setting.", 419 | "default": false 420 | } 421 | } 422 | } 423 | }, 424 | "scripts": { 425 | "vscode:prepublish": "tsc -p ./", 426 | "compile": "tsc -watch -p ./", 427 | "postinstall": "node ./node_modules/vscode/bin/install", 428 | "contributor:add": "all-contributors add", 429 | "contributor:generate": "all-contributors generate", 430 | "contributor:check": "all-contributors check", 431 | "test": "nyc mocha './test/**/*.test.ts'", 432 | "format": "prettier --write \"{src,test}/**/*.{ts,md}\"", 433 | "lint": "eslint 'src/**/*.ts' 'test/**/*.ts' --fix" 434 | }, 435 | "dependencies": { 436 | "micromatch": "^4.0.2" 437 | }, 438 | "devDependencies": { 439 | "@istanbuljs/nyc-config-typescript": "^0.1.3", 440 | "@types/micromatch": "^3.1.0", 441 | "@types/mocha": "^5.2.7", 442 | "@types/node": "^12.7.2", 443 | "@typescript-eslint/eslint-plugin": "^2.0.0", 444 | "@typescript-eslint/parser": "^2.0.0", 445 | "all-contributors-cli": "^6.9.3", 446 | "coveralls": "^3.0.6", 447 | "eslint": "^6.1.0", 448 | "husky": "^3.0.3", 449 | "lint-staged": "^9.2.1", 450 | "mocha": "^6.2.0", 451 | "nyc": "^14.1.1", 452 | "prettier": "^1.18.2", 453 | "source-map-support": "^0.5.13", 454 | "ts-node": "^8.3.0", 455 | "typescript": "^3.5.3", 456 | "vscode": "^1.1.36" 457 | }, 458 | "husky": { 459 | "hooks": { 460 | "pre-commit": "lint-staged", 461 | "pre-push": "npm run vscode:prepublish" 462 | } 463 | }, 464 | "lint-staged": { 465 | "*.{ts,json,md}": [ 466 | "prettier --write", 467 | "git add" 468 | ], 469 | "*.ts": [ 470 | "eslint --fix", 471 | "eslint" 472 | ] 473 | }, 474 | "eslintConfig": { 475 | "env": { 476 | "node": true, 477 | "mocha": true 478 | }, 479 | "parser": "@typescript-eslint/parser", 480 | "plugins": [ 481 | "@typescript-eslint" 482 | ], 483 | "extends": [ 484 | "plugin:@typescript-eslint/eslint-recommended", 485 | "plugin:@typescript-eslint/recommended" 486 | ], 487 | "rules": { 488 | "@typescript-eslint/no-use-before-define": 0 489 | } 490 | }, 491 | "nyc": { 492 | "extends": "@istanbuljs/nyc-config-typescript", 493 | "check-coverage": true 494 | } 495 | } 496 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Visual Studio Code Dash 2 | 3 | [Dash](https://kapeli.com/dash) documentation integration for [Visual Studio Code](https://code.visualstudio.com/) 4 | 5 | > Dash is an API Documentation Browser and Code Snippet Manager for MacOS 6 | 7 | Also support [Zeal](https://zealdocs.org/) and [Velocity](https://velocity.silverlakesoftware.com/). 8 | 9 | [![Build Status](https://travis-ci.org/deerawan/vscode-dash.svg?branch=master)](https://travis-ci.org/deerawan/vscode-dash) [![Coverage Status](https://coveralls.io/repos/deerawan/vscode-dash/badge.svg?branch=master&service=github)](https://coveralls.io/github/deerawan/vscode-dash?branch=master) 10 | [![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-) 11 | 12 | ![vscode dash](https://raw.githubusercontent.com/deerawan/vscode-dash/master/images/vscode-dash.gif) 13 | 14 | ## Installation 15 | 16 | Type `cmd + shift + p` to launch command palette and choose `Extensions: Install Extension`. Search this package and install. 17 | 18 | ## Usage 19 | 20 | Get the text under your cursor or selected first: 21 | 22 | - Pressing `ctrl + h`. It will search for current specific documentation depends on language. 23 | - Pressing `ctrl + alt + h`. It will search for all documentation. 24 | 25 | No need to select the text: 26 | 27 | - Pressing `ctrl + shift + h`. It will open dash with current file's docset. 28 | - Pressing `alt + h`. It will open dash with custom string and current file's docset. 29 | 30 | ## Supported Docsets 31 | 32 | This plugin supports almost all docset configuration based on [Dash Mapping](https://kapeli.com/dash_plugins) 33 | 34 | ### Language to docset matching 35 | 36 | This plugin supports language to docset mapping. 37 | 38 | For other languages that are not supported by default in VS Code, 39 | you probably need to install [language plugins](https://marketplace.visualstudio.com/search?target=VSCode&category=Languages&sortBy=Downloads) 40 | first in order to allow VS Code to detect the language. 41 | 42 | 43 | Language | Dash Docset Keys | Docset Setting | Language Plugin | 44 | ------------ | ------------- | ------------- | :-------------: | 45 | Ansible | ansible | dash.languageIdToDocsetMap.ansible, dash.languageIdToDocsetMap.ansible-advanced | [link](https://marketplace.visualstudio.com/items?itemName=haaaad.ansible) 46 | C++ | cpp,net,boost,qt,cvcpp,cocos2dx,c,manpages | dash.languageIdToDocsetMap.cpp | [link](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) 47 | C# | net,mono,unity3d | dash.languageIdToDocsetMap.csharp 48 | Clojure | clojure | dash.languageIdToDocsetMap.clojure 49 | Cmake | cmake | dash.languageIdToDocsetMap.cmake | [link](https://marketplace.visualstudio.com/items?itemName=twxs.cmake) 50 | CoffeeScript | coffee | dash.languageIdToDocsetMap.coffee 51 | CSS | css,bootstrap,foundation,less,awesome,
cordova,phonegap | dash.languageIdToDocsetMap.css 52 | Dart | dartlang,polymerdart,angulardart | dash.languageIdToDocsetMap.dart | [link](https://marketplace.visualstudio.com/items?itemName=DanTup.dart-code) 53 | Elixir | elixir | dash.languageIdToDocsetMap.elixir | [link](https://marketplace.visualstudio.com/items?itemName=mjmcloug.vscode-elixir) 54 | Erlang | erlang | dash.languageIdToDocsetMap.erlang 55 | Go | go,godoc | dash.languageIdToDocsetMap.go | [link](https://marketplace.visualstudio.com/items?itemName=lukehoban.Go) 56 | Gradle | gradle | dash.languageIdToDocsetMap.gradle | [link](https://marketplace.visualstudio.com/items?itemName=naco-siren.gradle-language) 57 | Haskell | haskell | dash.languageIdToDocsetMap.haskell 58 | Haml | haml | dash.languageIdToDocsetMap.haml | [link](https://marketplace.visualstudio.com/items?itemName=karunamurti.haml) 59 | Haxe | haxe | dash.languageIdToDocsetMap.haxe | [link](https://marketplace.visualstudio.com/items?itemName=nadako.vshaxe) 60 | HTML | html,svg,css,bootstrap,foundation,
awesome,statamic,javascript,jquery,jqueryui,
jquerym,angularjs,backbone,marionette,
meteor,moo,prototype,ember,lodash,
underscore,sencha,extjs,knockout,
zepto,cordova,phonegap,yui | dash.languageIdToDocsetMap.html 61 | Jade | jade | dash.languageIdToDocsetMap.jade 62 | Java | java,javafx,grails,groovy,playjava,spring,
cvj,processing | dash.languageIdToDocsetMap.java | [link](https://marketplace.visualstudio.com/items?itemName=redhat.java) 63 | JavaScript | javascript,jquery,jqueryui,jquerym,react,
angularjs,backbone,marionette,meteor,
sproutcore,moo,prototype,bootstrap,
foundation,lodash,underscore,ember,
sencha,extjs,titanium,knockout,zepto,
yui,d3,svg,dojo,coffee,nodejs,express,
grunt,mongoose,moment,require,
awsjs,jasmine,sails,sinon,chai,
html,css,cordova,phonegap,unity3d | dash.languageIdToDocsetMap.javascript 64 | Julia | julia | dash.languageIdToDocsetMap.julia | [link](https://marketplace.visualstudio.com/items?itemName=julialang.language-julia) 65 | Kotlin | androidktx,kotlin | dash.languageIdToDocsetMap.kotlin | [link](https://marketplace.visualstudio.com/items?itemName=mathiasfrohlich.Kotlin) 66 | Latex | latex | dash.languageIdToDocsetMap.latex | [link](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop) 67 | Less | less | dash.languageIdToDocsetMap.less 68 | Lua | lua,corona | dash.languageIdToDocsetMap.lua | [link](https://marketplace.visualstudio.com/items?itemName=gccfeli.vscode-lua) 69 | Markdown | markdown | dash.languageIdToDocsetMap.markdown 70 | Objective-C | iphoneos,macosx,watchos,tvos,
appledoc,cocos2d,cocos3d,
kobold2d,sparrow,c,manpages | dash.languageIdToDocsetMap.objective-c 71 | Perl | perl,manpages | dash.languageIdToDocsetMap.perl 72 | PHP | php,wordpress,drupal,zend,laravel,yii,joomla,ee,
codeigniter,cakephp,phpunit,symfony,typo3,
twig,smarty,craft,phpp,html,statamic,mysql,
sqlite,mongodb,psql,redis | dash.languageIdToDocsetMap.php 73 | Processing | processing | dash.languageIdToDocsetMap.pde | [link](https://marketplace.visualstudio.com/items?itemName=Tobiah.language-pde) 74 | Puppet | puppet | dash.languageIdToDocsetMap.puppet | [link](https://marketplace.visualstudio.com/items?itemName=Borke.Puppet) 75 | Python | python,django,twisted,sphinx,flask,tornado,
sqlalchemy,numpy,scipy,salt,pandas,matplotlib,cvp | dash.languageIdToDocsetMap.python | [link](https://marketplace.visualstudio.com/items?itemName=tht13.python) 76 | R | r | dash.languageIdToDocsetMap.r 77 | Ruby | ruby,rubygems,rails | dash.languageIdToDocsetMap.ruby | [link](https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby) 78 | Rust | rust | dash.languageIdToDocsetMap.rust | [link](https://marketplace.visualstudio.com/items?itemName=saviorisdead.RustyCode) 79 | Sass | sass,compass,bourbon,neat,susy,css | dash.languageIdToDocsetMap.sass 80 | Scala | scala,akka,playscala | dash.languageIdToDocsetMap.scala 81 | Shell Scripts | bash,manpages | dash.languageIdToDocsetMap.shellscript 82 | SQL | mysql,sqlite,psql | dash.languageIdToDocsetMap.sql 83 | Stylus | stylus | dash.languageIdToDocsetMap.stylus | [link](https://marketplace.visualstudio.com/items?itemName=sysoev.language-stylus) 84 | Swift | swift,iphoneos,macosx,watchos,tvos,appledoc | dash.languageIdToDocsetMap.swift | [link](https://marketplace.visualstudio.com/items?itemName=rlovelett.vscode-swift-language) 85 | Tcl | tcl | dash.languageIdToDocsetMap.tcl | [link](https://marketplace.visualstudio.com/items?itemName=rashwell.tcl) 86 | Terraform | terraform | dash.languageIdToDocsetMap.terraform | [link](https://marketplace.visualstudio.com/items?itemName=mauve.terraform) 87 | TypeScript | typescript | dash.languageIdToDocsetMap.typescript 88 | YAML | chef,ansible | dash.languageIdToDocsetMap.yaml 89 | 90 | #### Added docset in this plugin 91 | 92 | 93 | Language | Dash Docset Keys | Docset Setting | Language Plugin 94 | ------------ | ------------- | ------------- | :-------------: 95 | Elm | elm | dash.languageIdToDocsetMap.elm | [link](https://marketplace.visualstudio.com/items?itemName=sbrink.elm) 96 | React | react | dash.languageIdToDocsetMap.javascriptreact | [link](https://marketplace.visualstudio.com/items?itemName=TwentyChung.jsx) 97 | 98 | ### File name to docset matching 99 | 100 | This plugin also supports file name matching to docset, this is useful to target docset for any specific file name such as `docker.yml` or `vagrantfile`. 101 | 102 | **NOTE: You can use glob pattern to define the file name** 103 | 104 | 105 | File Name | Dash Docset Keys | Docset Setting 106 | ------------ | ------------- | ------------- 107 | [dD]ocker* | docker | dash.fileNameToDocsetMap["docker.yml"] 108 | vagrantfile | vagrant | dash.fileNameToDocsetMap["vagrantfile"] 109 | gruntfile.js | grunt | dash.fileNameToDocsetMap["gruntfile.js"] 110 | gulpfile.js | gulp | dash.fileNameToDocsetMap["gulpfile.js"] 111 | *.ino | arduino | dash.fileNameToDocsetMap["*.ino"] 112 | 113 | ### What is `Dash Docset Keys`? 114 | 115 | You can find dash docset key in Dash application. 116 | 117 | ![dash docset key](https://raw.githubusercontent.com/deerawan/vscode-dash/master/images/dash-docset-key.jpg) 118 | 119 | ## Change Docset Configuration 120 | 121 | You can change docset in `settings.json` or pressing `cmd + ,`. 122 | Every configuration start with `dash.docset`. See `Docset Setting` column in Supported Docset table above. 123 | 124 | ### Example Case: 125 | 126 | Based on default docset configuration, if we search in typescript files (.ts), it will search in typescript docset. 127 | But now we want to make it able to search in javascript docset too. 128 | 129 | Type `cmd + ,` then we change typescript docset by adding new dash docset key "javascript". So, whenever we search from typescript files, it will search in typescript and javascript docset. 130 | 131 | The result will look like below: 132 | 133 | ``` 134 | // settings.json, add lines below 135 | "dash.languageIdToDocsetMap": { 136 | ..., 137 | "typescript": [ 138 | "typescript", 139 | "javascript" // we add new dash docset key here 140 | ] 141 | ... 142 | } 143 | ``` 144 | 145 | ## Change Keyboard Shortcut 146 | 147 | You can bind default shortcut to another shortcut keys 148 | 149 | Choose in top menu `Code -> Preferences -> Keyboard Shortcuts` or using shortcuts `cmd + K, cmd + S` 150 | 151 | Add one or two lines below 152 | 153 | ```json 154 | { "key": "your_shortcut", "command": "extension.dash.specific" }, // search selection in corresponding docset 155 | { "key": "your_shortcut", "command": "extension.dash.all" } // search in all docset 156 | { "key": "your_shortcut", "command": "extension.dash.emptySyntax" } // open dash with current file's docset open 157 | { "key": "your_shortcut", "command": "extension.dash.searchSyntax" } // open dash with custom string and current file's docset 158 | ``` 159 | 160 | ## Contributors 161 | 162 | Thank you for these awesome contributors 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 |
Budi Irawan
Budi Irawan

💻 📖
Dima Granetchi
Dima Granetchi

💻 📖
Logan Saso
Logan Saso

💻 📖
Zhongren Shao
Zhongren Shao

💻 📖
dingweifeng
dingweifeng

📖
Seth Bromberger
Seth Bromberger

💻 📖
br1anchen
br1anchen

💻
Won Kim
Won Kim

💻
Cuyler Stuwe
Cuyler Stuwe

💻
Cahya Pribadi
Cahya Pribadi

💻
Marko Kajzer
Marko Kajzer

💻
akdir
akdir

💻
185 | 186 | 187 | 188 | 189 | 190 | 191 | ## License 192 | 193 | MIT © [Budi Irawan](https://budiirawan.com) 194 | --------------------------------------------------------------------------------