├── .gitattributes ├── .github ├── CONTRIBUTING.md └── ISSUE_TEMPLATE.md ├── .gitignore ├── JavaScriptSnippetPack.sln ├── LICENSE ├── README.md ├── appveyor.yml ├── art ├── javascript-snippet-pack.gif └── snippet-manager.png └── src ├── JavaScriptSnippetPack.csproj ├── Resources └── Icon.png ├── Snippets ├── JavaScriptSnippetPack │ ├── ac.snippet │ ├── ae.snippet │ ├── afn.snippet │ ├── al.snippet │ ├── apply.snippet │ ├── ca.snippet │ ├── call.snippet │ ├── cd.snippet │ ├── cdf.snippet │ ├── ce.snippet │ ├── cel.snippet │ ├── ci.snippet │ ├── co.snippet │ ├── cr.snippet │ ├── ct.snippet │ ├── cw.snippet │ ├── de.snippet │ ├── fe.snippet │ ├── ga.snippet │ ├── gc.snippet │ ├── gi.snippet │ ├── gt.snippet │ ├── ih.snippet │ ├── jp.snippet │ ├── js.snippet │ ├── ofn.snippet │ ├── pm.snippet │ ├── pr.snippet │ ├── qs.snippet │ ├── qsa.snippet │ ├── ra.snippet │ ├── rc.snippet │ ├── sa.snippet │ ├── si.snippet │ ├── st.snippet │ ├── tc.snippet │ └── us.snippet └── snippets.pkgdef └── source.extension.vsixmanifest /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Looking to contribute something? **Here's how you can help.** 4 | 5 | Please take a moment to review this document in order to make the contribution 6 | process easy and effective for everyone involved. 7 | 8 | Following these guidelines helps to communicate that you respect the time of 9 | the developers managing and developing this open source project. In return, 10 | they should reciprocate that respect in addressing your issue or assessing 11 | patches and features. 12 | 13 | 14 | ## Using the issue tracker 15 | 16 | The issue tracker is the preferred channel for [bug reports](#bug-reports), 17 | [features requests](#feature-requests) and 18 | [submitting pull requests](#pull-requests), but please respect the 19 | following restrictions: 20 | 21 | * Please **do not** use the issue tracker for personal support requests. Stack 22 | Overflow is a better place to get help. 23 | 24 | * Please **do not** derail or troll issues. Keep the discussion on topic and 25 | respect the opinions of others. 26 | 27 | * Please **do not** open issues or pull requests which *belongs to* third party 28 | components. 29 | 30 | 31 | ## Bug reports 32 | 33 | A bug is a _demonstrable problem_ that is caused by the code in the repository. 34 | Good bug reports are extremely helpful, so thanks! 35 | 36 | Guidelines for bug reports: 37 | 38 | 1. **Use the GitHub issue search** — check if the issue has already been 39 | reported. 40 | 41 | 2. **Check if the issue has been fixed** — try to reproduce it using the 42 | latest `master` or development branch in the repository. 43 | 44 | 3. **Isolate the problem** — ideally create an 45 | [SSCCE](http://www.sscce.org/) and a live example. 46 | Uploading the project on cloud storage (OneDrive, DropBox, et el.) 47 | or creating a sample GitHub repository is also helpful. 48 | 49 | 50 | A good bug report shouldn't leave others needing to chase you up for more 51 | information. Please try to be as detailed as possible in your report. What is 52 | your environment? What steps will reproduce the issue? What browser(s) and OS 53 | experience the problem? Do other browsers show the bug differently? What 54 | would you expect to be the outcome? All these details will help people to fix 55 | any potential bugs. 56 | 57 | Example: 58 | 59 | > Short and descriptive example bug report title 60 | > 61 | > A summary of the issue and the Visual Studio, browser, OS environments 62 | > in which it occurs. If suitable, include the steps required to reproduce the bug. 63 | > 64 | > 1. This is the first step 65 | > 2. This is the second step 66 | > 3. Further steps, etc. 67 | > 68 | > `` - a link to the project/file uploaded on cloud storage or other publicly accessible medium. 69 | > 70 | > Any other information you want to share that is relevant to the issue being 71 | > reported. This might include the lines of code that you have identified as 72 | > causing the bug, and potential solutions (and your opinions on their 73 | > merits). 74 | 75 | 76 | ## Feature requests 77 | 78 | Feature requests are welcome. But take a moment to find out whether your idea 79 | fits with the scope and aims of the project. It's up to *you* to make a strong 80 | case to convince the project's developers of the merits of this feature. Please 81 | provide as much detail and context as possible. 82 | 83 | 84 | ## Pull requests 85 | 86 | Good pull requests, patches, improvements and new features are a fantastic 87 | help. They should remain focused in scope and avoid containing unrelated 88 | commits. 89 | 90 | **Please ask first** before embarking on any significant pull request (e.g. 91 | implementing features, refactoring code, porting to a different language), 92 | otherwise you risk spending a lot of time working on something that the 93 | project's developers might not want to merge into the project. 94 | 95 | Please adhere to the [coding guidelines](#code-guidelines) used throughout the 96 | project (indentation, accurate comments, etc.) and any other requirements 97 | (such as test coverage). 98 | 99 | Adhering to the following process is the best way to get your work 100 | included in the project: 101 | 102 | 1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, 103 | and configure the remotes: 104 | 105 | ```bash 106 | # Clone your fork of the repo into the current directory 107 | git clone https://github.com//.git 108 | # Navigate to the newly cloned directory 109 | cd 110 | # Assign the original repo to a remote called "upstream" 111 | git remote add upstream https://github.com/madskristensen/.git 112 | ``` 113 | 114 | 2. If you cloned a while ago, get the latest changes from upstream: 115 | 116 | ```bash 117 | git checkout master 118 | git pull upstream master 119 | ``` 120 | 121 | 3. Create a new topic branch (off the main project development branch) to 122 | contain your feature, change, or fix: 123 | 124 | ```bash 125 | git checkout -b 126 | ``` 127 | 128 | 4. Commit your changes in logical chunks. Please adhere to these [git commit 129 | message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) 130 | or your code is unlikely be merged into the main project. Use Git's 131 | [interactive rebase](https://help.github.com/articles/interactive-rebase) 132 | feature to tidy up your commits before making them public. Also, prepend name of the feature 133 | to the commit message. For instance: "SCSS: Fixes compiler results for IFileListener.\nFixes `#123`" 134 | 135 | 5. Locally merge (or rebase) the upstream development branch into your topic branch: 136 | 137 | ```bash 138 | git pull [--rebase] upstream master 139 | ``` 140 | 141 | 6. Push your topic branch up to your fork: 142 | 143 | ```bash 144 | git push origin 145 | ``` 146 | 147 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) 148 | with a clear title and description against the `master` branch. 149 | 150 | 151 | ## Code guidelines 152 | 153 | - Always use proper indentation. 154 | - In Visual Studio under `Tools > Options > Text Editor > C# > Advanced`, make sure 155 | `Place 'System' directives first when sorting usings` option is enabled (checked). 156 | - Before committing, organize usings for each updated C# source file. Either you can 157 | right-click editor and select `Organize Usings > Remove and sort` OR use extension 158 | like [BatchFormat](http://visualstudiogallery.msdn.microsoft.com/a7f75c34-82b4-4357-9c66-c18e32b9393e). 159 | - Before committing, run Code Analysis in `Debug` configuration and follow the guidelines 160 | to fix CA issues. Code Analysis commits can be made separately. 161 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Installed product versions 2 | - Visual Studio: [example 2015 Professional] 3 | - This extension: [example 1.1.21] 4 | 5 | ### Description 6 | Replace this text with a short description 7 | 8 | ### Steps to recreate 9 | 1. Replace this 10 | 2. text with 11 | 3. the steps 12 | 4. to recreate 13 | 14 | ### Current behavior 15 | Explain what it's doing and why it's wrong 16 | 17 | ### Expected behavior 18 | Explain what it should be doing after it's fixed. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.user 3 | 4 | .vs 5 | bin 6 | obj -------------------------------------------------------------------------------- /JavaScriptSnippetPack.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.25921.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JavaScriptSnippetPack", "src\JavaScriptSnippetPack.csproj", "{5C843AF8-1088-4655-A572-0729269E8A98}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6F24CC8F-8D9C-4384-A39D-2248CC465F03}" 9 | ProjectSection(SolutionItems) = preProject 10 | appveyor.yml = appveyor.yml 11 | README.md = README.md 12 | EndProjectSection 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {5C843AF8-1088-4655-A572-0729269E8A98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {5C843AF8-1088-4655-A572-0729269E8A98}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {5C843AF8-1088-4655-A572-0729269E8A98}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {5C843AF8-1088-4655-A572-0729269E8A98}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2016 Mads Kristensen 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## JavaScript Snippet Pack for Visual Studio 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/qogg94i8nry0g0j7?svg=true)](https://ci.appveyor.com/project/madskristensen/javascriptsnippetpack) 4 | 5 | Download this extension from the 6 | [VS Gallery](https://visualstudiogallery.msdn.microsoft.com/423eb4a3-215f-4a8f-9287-1512618ffda3) 7 | or get the 8 | [nightly build](http://vsixgallery.com/extension/2a20580c-7be4-4440-bcd6-8dcf5aa2004e/). 9 | 10 | ----------------------------------------- 11 | 12 | A snippet pack to make you more productive working with JavaScript. 13 | Based on the [Atom snippets](https://atom.io/packages/javascript-snippets). 14 | 15 | ![Snippet manager](art/javascript-snippet-pack.gif) 16 | 17 | This extension ships a bunch of useful code snippets for 18 | the JavaScript editor. Get an overview from the 19 | **Code Snippet Manager** in Visual Studio located under 20 | the **Tools** top level menu. 21 | 22 | ![Snippet manager](art/snippet-manager.png) 23 | 24 | Here's the full list of all the snippets: 25 | 26 | ## Console 27 | 28 | ### [cd] console.dir 29 | 30 | ```javascript 31 | console.dir(${1:obj}); 32 | ``` 33 | 34 | ### [ce] console.error 35 | 36 | ```javascript 37 | console.error($end$); 38 | ``` 39 | 40 | ### [ci] console.info 41 | 42 | ```javascript 43 | console.info($end$); 44 | ``` 45 | 46 | ### [cl] console.log 47 | 48 | ```javascript 49 | console.log($end$); 50 | ``` 51 | 52 | ### [cw] console.warn 53 | 54 | ```javascript 55 | console.warn($end$); 56 | ``` 57 | 58 | ### [de] debugger 59 | 60 | ```javascript 61 | debugger; 62 | ``` 63 | 64 | ## DOM 65 | 66 | ### [ae] addEventListener 67 | 68 | ```javascript 69 | $document$.addEventListener('$event$', function(e) { 70 | $end$ 71 | }); 72 | ``` 73 | 74 | ### [ac] appendChild 75 | 76 | ```javascript 77 | $document$.appendChild($elem$); 78 | ``` 79 | 80 | ### [rc] removeChild 81 | 82 | ```javascript 83 | $document$.removeChild($elem$); 84 | ``` 85 | 86 | ### [cel] createElement 87 | 88 | ```javascript 89 | $document$.createElement($elem$); 90 | ``` 91 | 92 | ### [cdf] createDocumentFragment 93 | 94 | ```javascript 95 | $document$.createDocumentFragment($elem$); 96 | ``` 97 | 98 | ### [ca] classList.add 99 | 100 | ```javascript 101 | $document$.classList.add('$class$'); 102 | ``` 103 | 104 | ### [ct] classList.toggle 105 | 106 | ```javascript 107 | $document$.classList.toggle('$class$'); 108 | ``` 109 | 110 | ### [cr] classList.remove 111 | 112 | ```javascript 113 | $document$.classList.remove('$class$'); 114 | ``` 115 | 116 | ### [gi] getElementById 117 | 118 | ```javascript 119 | $document$.getElementById('$id$'); 120 | ``` 121 | 122 | ### [gc] getElementsByClassName 123 | 124 | ```javascript 125 | $document$.getElementsByClassName('$class$'); 126 | ``` 127 | 128 | ### [gt] getElementsByTagName 129 | 130 | ```javascript 131 | $document$.getElementsByTagName('$tag$'); 132 | ``` 133 | 134 | ### [ga] getAttribute 135 | 136 | ```javascript 137 | $document$.getAttribute('$attr$'); 138 | ``` 139 | 140 | ### [sa] setAttribute 141 | 142 | ```javascript 143 | $document$.setAttribute('$attr$', $value$); 144 | ``` 145 | 146 | ### [ra] removeAttribute 147 | 148 | ```javascript 149 | $document$.removeAttribute('$attr$'); 150 | ``` 151 | 152 | ### [ih] innerHTML 153 | 154 | ```javascript 155 | $document$.innerHTML = '$elem$'; 156 | ``` 157 | 158 | ### [tc] textContent 159 | 160 | ```javascript 161 | $document$.textContent = '$content$'; 162 | ``` 163 | 164 | ### [qs] querySelector 165 | 166 | ```javascript 167 | $document$.querySelector('$selector$'); 168 | ``` 169 | 170 | ### [qsa] querySelectorAll 171 | 172 | ```javascript 173 | $document$.querySelectorAll('$selector$'); 174 | ``` 175 | 176 | ## Loop 177 | 178 | ### [fe] forEach 179 | 180 | ```javascript 181 | $myArray$.forEach(function($item$) { 182 | $end$ 183 | }); 184 | ``` 185 | 186 | ## Function 187 | 188 | ### [afn] anonymous function 189 | 190 | ```javascript 191 | function($arguments$) { 192 | $end$ 193 | } 194 | ``` 195 | 196 | ### [pr] prototype 197 | 198 | ```javascript 199 | $object$.prototype.$methodName$ = function($arguments$) { 200 | $end$ 201 | } 202 | ``` 203 | 204 | ### [call] function call 205 | 206 | ```javascript 207 | $methodName$.call($context$, $arguments$) 208 | ``` 209 | 210 | ### [apply] function apply 211 | 212 | ```javascript 213 | $methodName$.apply($context$, [$arguments$]) 214 | ``` 215 | 216 | ### [ofn] function as a property of an object 217 | 218 | ```javascript 219 | $functionName$: function($arguments$) { 220 | $end$ 221 | } 222 | ``` 223 | 224 | ## JSON 225 | 226 | ### [jp] JSON.parse 227 | 228 | ```javascript 229 | JSON.parse($object$); 230 | ``` 231 | 232 | ### [js] JSON.stringify 233 | 234 | ```javascript 235 | JSON.stringify($object$); 236 | ``` 237 | 238 | ## Timer 239 | 240 | ### [si] setInterval 241 | 242 | ```javascript 243 | setInterval(function() { 244 | $end$ 245 | }, $delay$); 246 | ``` 247 | 248 | ### [st] setTimeout 249 | 250 | ```javascript 251 | setTimeout(function() { 252 | $end$ 253 | }, $delay$); 254 | ``` 255 | 256 | ## Misc 257 | 258 | ### [us] use strict 259 | 260 | ```javascript 261 | 'use strict'; 262 | ``` 263 | 264 | ### [al] alert 265 | 266 | ```javascript 267 | alert('$message$'); 268 | ``` 269 | 270 | ### [co] confirm 271 | 272 | ```javascript 273 | confirm('$message$'); 274 | ``` 275 | 276 | ### [pm] prompt 277 | 278 | ```javascript 279 | prompt('$message$'); 280 | ``` 281 | 282 | ## Contribute 283 | Check out the [contribution guidelines](.github/CONTRIBUTING.md) 284 | if you want to contribute to this project. 285 | 286 | For cloning and building this project yourself, make sure 287 | to install the 288 | [Extensibility Tools 2015](https://visualstudiogallery.msdn.microsoft.com/ab39a092-1343-46e2-b0f1-6a3f91155aa6) 289 | extension for Visual Studio which enables some features 290 | used by this project. 291 | 292 | ## License 293 | [Apache 2.0](LICENSE) -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2019 2 | 3 | install: 4 | - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex 5 | 6 | before_build: 7 | - ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion 8 | 9 | build_script: 10 | - nuget restore -Verbosity quiet 11 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m 12 | 13 | after_test: 14 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery 15 | -------------------------------------------------------------------------------- /art/javascript-snippet-pack.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/JavaScriptSnippetPack/d889b5d771107c514b323d0c04445ce23535e564/art/javascript-snippet-pack.gif -------------------------------------------------------------------------------- /art/snippet-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/JavaScriptSnippetPack/d889b5d771107c514b323d0c04445ce23535e564/art/snippet-manager.png -------------------------------------------------------------------------------- /src/JavaScriptSnippetPack.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(VisualStudioVersion) 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | Debug 10 | AnyCPU 11 | 2.0 12 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 13 | {5C843AF8-1088-4655-A572-0729269E8A98} 14 | Library 15 | JavaScriptSnippetPack 16 | JavaScriptSnippetPack 17 | v4.5 18 | false 19 | false 20 | false 21 | false 22 | false 23 | false 24 | Program 25 | $(DevEnvDir)\devenv.exe 26 | /rootsuffix Exp 27 | Normal 28 | 29 | 30 | true 31 | full 32 | false 33 | bin\Debug\ 34 | DEBUG;TRACE 35 | prompt 36 | 4 37 | 38 | 39 | pdbonly 40 | true 41 | bin\Release\ 42 | TRACE 43 | prompt 44 | 4 45 | 46 | 47 | 48 | true 49 | 50 | 51 | true 52 | 53 | 54 | Resources\LICENSE 55 | true 56 | 57 | 58 | true 59 | 60 | 61 | true 62 | 63 | 64 | true 65 | 66 | 67 | true 68 | 69 | 70 | true 71 | 72 | 73 | true 74 | 75 | 76 | true 77 | 78 | 79 | true 80 | 81 | 82 | true 83 | 84 | 85 | true 86 | 87 | 88 | true 89 | 90 | 91 | true 92 | 93 | 94 | true 95 | 96 | 97 | true 98 | 99 | 100 | true 101 | 102 | 103 | true 104 | 105 | 106 | true 107 | 108 | 109 | true 110 | 111 | 112 | true 113 | 114 | 115 | true 116 | 117 | 118 | true 119 | 120 | 121 | true 122 | 123 | 124 | true 125 | 126 | 127 | true 128 | 129 | 130 | true 131 | 132 | 133 | true 134 | 135 | 136 | true 137 | 138 | 139 | true 140 | 141 | 142 | true 143 | 144 | 145 | true 146 | 147 | 148 | true 149 | 150 | 151 | true 152 | 153 | 154 | true 155 | 156 | 157 | true 158 | 159 | 160 | true 161 | 162 | 163 | true 164 | 165 | 166 | Designer 167 | 168 | 169 | 170 | 171 | true 172 | 173 | 174 | 175 | 176 | 17.0.2120-preview2 177 | runtime; build; native; contentfiles; analyzers; buildtransitive 178 | all 179 | 180 | 181 | 182 | 183 | 190 | -------------------------------------------------------------------------------- /src/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/JavaScriptSnippetPack/d889b5d771107c514b323d0c04445ce23535e564/src/Resources/Icon.png -------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ac.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | appendChild 4 | ac 5 | Mads Kristensen 6 | Code snippet for "appendChild" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | child 20 | The element to append 21 | elem 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ae.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | addEventListener 4 | ae 5 | Mads Kristensen 6 | Code snippet for "addEventListener" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Object to attach to 16 | window 17 | 18 | 19 | event 20 | Name of the event 21 | load 22 | 23 | 24 | body 25 | Body of event handler function 26 | // body 27 | 28 | 29 | 30 | 33 | 34 | 35 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/afn.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | anonymous function 4 | afn 5 | Mads Kristensen 6 | Code snippet for anonymous function 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | arguments 15 | The arguments of the function 16 | arguments 17 | 18 | 19 | body 20 | The body of the function 21 | // body 22 | 23 | 24 | 25 | 28 | 29 | 30 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/al.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | alert 4 | al 5 | Mads Kristensen 6 | Code snippet for "alert" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | message 15 | The message 16 | message 17 | 18 | 19 | 20 | 21 | 22 | 23 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/apply.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | function apply 4 | apply 5 | Mads Kristensen 6 | Code snippet for a function apply 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | method 15 | The name of the new prototype method 16 | method 17 | 18 | 19 | context 20 | The body of the function 21 | context 22 | 23 | 24 | arguments 25 | The arguments of the function 26 | arguments 27 | 28 | 29 | 30 | 31 | 32 | 33 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ca.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | classList.add 4 | ca 5 | Mads Kristensen 6 | Code snippet for "classList.add" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | class 20 | The name of the class to add 21 | class 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/call.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | function call 4 | call 5 | Mads Kristensen 6 | Code snippet for a function call 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | method 15 | The name of the new prototype method 16 | method 17 | 18 | 19 | context 20 | The body of the function 21 | context 22 | 23 | 24 | arguments 25 | The arguments of the function 26 | arguments 27 | 28 | 29 | 30 | 31 | 32 | 33 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/cd.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | console.dir 4 | cd 5 | Mads Kristensen 6 | Code snippet for "console.dir" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/cdf.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | createDocumentFragment 4 | cdf 5 | Mads Kristensen 6 | Code snippet for "createDocumentFragment" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | 20 | 21 | 22 | 23 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ce.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | console.error 4 | ce 5 | Mads Kristensen 6 | Code snippet for "console.error" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/cel.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | createElement 4 | cel 5 | Mads Kristensen 6 | Code snippet for "createElement" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | name 20 | The tagname of new element 21 | div 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ci.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | console.info 4 | ci 5 | Mads Kristensen 6 | Code snippet for "console.info" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/co.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | confirm 4 | co 5 | Mads Kristensen 6 | Code snippet for "confirm" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | message 15 | The message 16 | message 17 | 18 | 19 | 20 | 21 | 22 | 23 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/cr.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | classList.remove 4 | cr 5 | Mads Kristensen 6 | Code snippet for "classList.remove" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | class 20 | The name of the class to remove 21 | class 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ct.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | classList.toggle 4 | ct 5 | Mads Kristensen 6 | Code snippet for "classList.toggle" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | class 20 | The name of the class to toggle 21 | class 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/cw.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | console.warn 4 | cw 5 | Mads Kristensen 6 | Code snippet for "console.warn" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/de.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | debugger 4 | de 5 | Mads Kristensen 6 | Code snippet for "debugger" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/fe.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | forEach 4 | fe 5 | Mads Kristensen 6 | Code snippet for "forEach" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | array 15 | The array to loop through 16 | array 17 | 18 | 19 | body 20 | The body of the function 21 | // body 22 | 23 | 24 | 25 | 28 | 29 | 30 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ga.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | getAttribute 4 | ga 5 | Mads Kristensen 6 | Code snippet for "getAttribute" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | name 20 | The name of the attribute 21 | name 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/gc.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | getElementsByClassName 4 | gc 5 | Mads Kristensen 6 | Code snippet for "getElementsByClassName" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | class 20 | The class name of the elements 21 | class 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/gi.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | getElementById 4 | gi 5 | Mads Kristensen 6 | Code snippet for "getElementById" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | id 20 | The ID of the element 21 | id 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/gt.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | getElementsByTagName 4 | gt 5 | Mads Kristensen 6 | Code snippet for "getElementsByTagName" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | tag 20 | The tag name of the elements 21 | div 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ih.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | innerHTML 4 | ih 5 | Mads Kristensen 6 | Code snippet for "innerHTML" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | html 20 | The HTML to asign 21 | html 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/jp.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | JSON.parse 4 | jp 5 | Mads Kristensen 6 | Code snippet for "JSON.parse" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | The object to parse 16 | object 17 | 18 | 19 | 20 | 21 | 22 | 23 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/js.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | JSON.stringify 4 | js 5 | Mads Kristensen 6 | Code snippet for "JSON.stringify" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | The object to stringify 16 | object 17 | 18 | 19 | 20 | 21 | 22 | 23 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ofn.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | property function 4 | ofn 5 | Mads Kristensen 6 | Code snippet for function as a property of an object 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | function 15 | The name of the function 16 | functionName 17 | 18 | 19 | arguments 20 | The arguments of the function 21 | arguments 22 | 23 | 24 | body 25 | The body of the function 26 | // body 27 | 28 | 29 | 30 | 33 | 34 | 35 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/pm.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | prompt 4 | pm 5 | Mads Kristensen 6 | Code snippet for "prompt" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | message 15 | The message 16 | message 17 | 18 | 19 | 20 | 21 | 22 | 23 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/pr.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | prototype 4 | pr 5 | Mads Kristensen 6 | Code snippet for a prototype function 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | The object which prototype to modify 16 | object 17 | 18 | 19 | method 20 | The name of the new prototype method 21 | method 22 | 23 | 24 | arguments 25 | The arguments of the function 26 | arguments 27 | 28 | 29 | body 30 | The body of the function 31 | // body 32 | 33 | 34 | 35 | 38 | 39 | 40 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/qs.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | querySelector 4 | qs 5 | Mads Kristensen 6 | Code snippet for "querySelector" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | selector 20 | The selector 21 | selector 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/qsa.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | querySelectorAll 4 | qsa 5 | Mads Kristensen 6 | Code snippet for "querySelectorAll" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | selector 20 | The selector 21 | selector 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/ra.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | removeAttribute 4 | ra 5 | Mads Kristensen 6 | Code snippet for "removeAttribute" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | name 20 | The name of the attribute 21 | name 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/rc.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | removeChild 4 | rc 5 | Mads Kristensen 6 | Code snippet for "removeChild" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | child 20 | The element to remove 21 | elem 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/sa.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | setAttribute 4 | sa 5 | Mads Kristensen 6 | Code snippet for "setAttribute" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | attr 20 | The name of the attribute 21 | attr 22 | 23 | 24 | value 25 | The value of the attribute 26 | value 27 | 28 | 29 | 30 | 31 | 32 | 33 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/si.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | setInterval 4 | si 5 | Mads Kristensen 6 | Code snippet for "setInterval" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | body 15 | The body of the function 16 | // body... 17 | 18 | 19 | delay 20 | The delay in milliseconds 21 | 1000 22 | 23 | 24 | 25 | 28 | 29 | 30 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/st.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | setTimeout 4 | st 5 | Mads Kristensen 6 | Code snippet for "setTimeout" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | body 15 | The body of the function 16 | // body... 17 | 18 | 19 | delay 20 | The delay in milliseconds 21 | 1000 22 | 23 | 24 | 25 | 28 | 29 | 30 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/tc.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | textContent 4 | tc 5 | Mads Kristensen 6 | Code snippet for "textContent" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | object 15 | Parent element 16 | document 17 | 18 | 19 | text 20 | The text to asign 21 | text 22 | 23 | 24 | 25 | 26 | 27 | 28 |
-------------------------------------------------------------------------------- /src/Snippets/JavaScriptSnippetPack/us.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | use strict 4 | us 5 | Mads Kristensen 6 | Code snippet for "use strict" 7 | 8 | Expansion 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 |
-------------------------------------------------------------------------------- /src/Snippets/snippets.pkgdef: -------------------------------------------------------------------------------- 1 |  2 | [$RootKey$\Languages\CodeExpansions\JavaScript\Paths] 3 | "JavaScriptSnippetPack"="$PackageFolder$\JavaScriptSnippetPack" -------------------------------------------------------------------------------- /src/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Snippet Pack 6 | A snippet pack to make you more productive working with JavaScript. 7 | https://github.com/madskristensen/JavaScriptSnippetPack 8 | Resources\LICENSE 9 | Resources\Icon.png 10 | Resources\Icon.png 11 | JavaScript, snippets 12 | 13 | 14 | 15 | 16 | 17 | 18 | amd64 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | --------------------------------------------------------------------------------