├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── VuePack2019.sln ├── appveyor.yml ├── art ├── file-icon.png ├── html-intellisense-component.png ├── html-intellisense-directives.png ├── html-intellisense-partial.png ├── html-intellisense.png └── snippets.png ├── lib ├── Microsoft.WebTools.Languages.Html.Editor.dll ├── Microsoft.WebTools.Languages.Html.VS.dll └── Microsoft.WebTools.Languages.Html.dll └── src ├── HTML ├── Completion │ ├── AttributeCompletion.cs │ ├── AttributeDirectiveCompletion.cs │ ├── BaseCompletion.cs │ ├── ElementCompletion.cs │ └── ElementDirectiveCompletion.cs ├── CompletionTypes.cs ├── ContentType │ └── VueContentTypeDefinition.cs ├── DirectivesCache.cs └── VueCreationListener.cs ├── Helpers └── ProjectHelpers.cs ├── Images.imagemanifest ├── Images.imagemanifest.cs ├── JavaScript └── Snippets │ ├── VuePack │ ├── vue.snippet │ ├── vued.snippet │ └── vuef.snippet │ └── snippets.pkgdef ├── Properties └── AssemblyInfo.cs ├── Resources ├── Preview.png ├── VueFile.png └── icon.png ├── VSPackage.cs ├── VuePack.csproj ├── registry.pkgdef ├── source.extension.cs └── 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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | packages 2 | 3 | # User files 4 | *.suo 5 | *.user 6 | *.sln.docstates 7 | .vs/ 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Rr]elease/ 12 | x64/ 13 | [Bb]in/ 14 | [Oo]bj/ 15 | 16 | # MSTest test Results 17 | [Tt]est[Rr]esult*/ 18 | [Bb]uild[Ll]og.* 19 | 20 | # NCrunch 21 | *.ncrunchsolution 22 | *.ncrunchproject 23 | _NCrunch_WebCompiler -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | # Vue Pack 2019 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/whhwh234ne1d06oi?svg=true)](https://ci.appveyor.com/project/madskristensen/vuepack2019) 4 | 5 | Download this extension from the [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VuejsPack2019) 6 | or get the [CI build](http://vsixgallery.com/extension/8a31a789-50bf-4e95-b4f9-b50877f2b523/). 7 | 8 | --------------------------------------- 9 | 10 | Contains HTML Intellisense and code snippets for the 11 | [Vue.js](http://vuejs.org) 12 | JavaScript library 13 | 14 | 15 | ## Features 16 | 17 | - **.vue** files are mapped to open in the HTML editor 18 | - HTML Intellisense for built-in directives 19 | - HTML Intellisense for custom directives and components 20 | - File icon for **.vue** files 21 | - JavaScript snippets 22 | 23 | ### Directives Intellisense 24 | Built in directives are shown in Intellisense to make it easier 25 | to write an to avoid typos. 26 | 27 | Any directive or component defined in any .vue or .js file in 28 | the project will be show up in Intellisense. 29 | 30 | #### Built in directives 31 | ![HTML Intellisense](art/html-intellisense.png) 32 | 33 | #### Special elements 34 | ![HTML Intellisense partial](art/html-intellisense-partial.png) 35 | 36 | #### Custom components/elementDirectives 37 | ![HTML Intellisense components](art/html-intellisense-component.png) 38 | 39 | #### Custom directives 40 | ![HTML Intellisense directives](art/html-intellisense-directives.png) 41 | 42 | ### File icon 43 | Solution Explorer correctly displays a file icon for .vue 44 | files. 45 | 46 | ![File icon](art/file-icon.png) 47 | 48 | ### JavaScript snippets 49 | A few handy snippets are available to speed up boilerplating 50 | of vew models, filters and directives. 51 | 52 | #### vue (view model) 53 | 54 | ```javascript 55 | var vm = new Vue({ 56 | 57 | el: "#app" 58 | 59 | }) 60 | ``` 61 | 62 | #### vued (directive) 63 | 64 | ```javascript 65 | Vue.directive('my-directive', { 66 | 67 | bind: function () { 68 | // content 69 | }, 70 | 71 | update: function (value) { 72 | // content 73 | }, 74 | 75 | unbind: function () { 76 | // content 77 | } 78 | }) 79 | ``` 80 | 81 | #### vuef (filter) 82 | 83 | ```javascript 84 | Vue.filter('my-filter', function (value) { 85 | 86 | $end$ 87 | 88 | }) 89 | ``` 90 | 91 | Here's what it looks like in the Code Snippets Manager. 92 | 93 | ![Snippets](art/snippets.png) 94 | 95 | ## Contribute 96 | Check out the [contribution guidelines](CONTRIBUTING.md) 97 | if you want to contribute to this project. 98 | 99 | For cloning and building this project yourself, make sure 100 | to install the 101 | [Extensibility Tools 2015](https://visualstudiogallery.msdn.microsoft.com/ab39a092-1343-46e2-b0f1-6a3f91155aa6) 102 | extension for Visual Studio which enables some features 103 | used by this project. 104 | 105 | ## License 106 | [Apache 2.0](LICENSE) -------------------------------------------------------------------------------- /VuePack2019.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28817.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VuePack", "src\VuePack.csproj", "{595E8BDD-792B-4554-940F-8760DA883A3B}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D166EEB4-832B-46C1-867F-CB589787D6BF}" 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 | {595E8BDD-792B-4554-940F-8760DA883A3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {595E8BDD-792B-4554-940F-8760DA883A3B}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {595E8BDD-792B-4554-940F-8760DA883A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {595E8BDD-792B-4554-940F-8760DA883A3B}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {933E7EBD-4B94-44CC-A448-AF72CB9E3950} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2019 Preview 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 | - ps: Vsix-TokenReplacement src\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' 9 | 10 | build_script: 11 | - nuget restore -Verbosity quiet 12 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m 13 | 14 | after_test: 15 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery -------------------------------------------------------------------------------- /art/file-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/art/file-icon.png -------------------------------------------------------------------------------- /art/html-intellisense-component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/art/html-intellisense-component.png -------------------------------------------------------------------------------- /art/html-intellisense-directives.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/art/html-intellisense-directives.png -------------------------------------------------------------------------------- /art/html-intellisense-partial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/art/html-intellisense-partial.png -------------------------------------------------------------------------------- /art/html-intellisense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/art/html-intellisense.png -------------------------------------------------------------------------------- /art/snippets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/art/snippets.png -------------------------------------------------------------------------------- /lib/Microsoft.WebTools.Languages.Html.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/lib/Microsoft.WebTools.Languages.Html.Editor.dll -------------------------------------------------------------------------------- /lib/Microsoft.WebTools.Languages.Html.VS.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/lib/Microsoft.WebTools.Languages.Html.VS.dll -------------------------------------------------------------------------------- /lib/Microsoft.WebTools.Languages.Html.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VuePack2019/15349d8131f73390a5c32380d609f27073d6b25c/lib/Microsoft.WebTools.Languages.Html.dll -------------------------------------------------------------------------------- /src/HTML/Completion/AttributeCompletion.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.Utilities; 2 | using Microsoft.WebTools.Languages.Html.Editor.Completion; 3 | using Microsoft.WebTools.Languages.Html.Editor.Completion.Def; 4 | using System.Collections.Generic; 5 | 6 | namespace VuePack 7 | { 8 | [HtmlCompletionProvider(CompletionTypes.Attributes, "*")] 9 | [ContentType("htmlx")] 10 | internal class AttributeCompletion : BaseCompletion 11 | { 12 | private readonly Dictionary _attributes = new Dictionary 13 | { 14 | { "track-by", "" }, 15 | { "v-attr", "Updates the element’s given attribute (indicated by the argument)." }, 16 | { "v-bind", "Binds an HTML attribute or passes property values to a child component." }, 17 | { "v-class", "If no argument is provided, it will add the binding’s value to the element’s classList, and update the class as the value changes." }, 18 | { "v-cloak", "This property remains on the element until the associated ViewModel finishes compilation. Combined with CSS rules such as [v-cloak] { display: none }, this directive can be used to hide un-compiled mustache bindings until the ViewModel is ready." }, 19 | { "v-el", "Register a reference to a DOM element on its owner Vue instance for easier access. e.g.
will be accessible as vm.$$.hi." }, 20 | { "v-for", "We can use the v-for directive to render a list of items based on an Array. The v-for directive requires a special syntax in the form of item in items, where items is the source data Array and item is an alias for the Array element being iterated on" }, 21 | { "v-html", "Updates the element’s innerHTML." }, 22 | { "v-if", "Conditionally insert / remove the element based on the truthy-ness of the binding value. If the element is a