├── UpgradeLog.htm ├── art └── top-menu.png ├── src ├── Resources │ ├── Icon.png │ └── Preview.png ├── Properties │ └── AssemblyInfo.cs ├── source.extension.cs ├── VSPackage.cs ├── source.extension.vsixmanifest ├── VSCommandTable.cs ├── Commands │ ├── RemoveXmlDocComments.cs │ ├── RemoveRegions.cs │ ├── RemoveTasks.cs │ ├── RemoveAllComment.cs │ ├── RemoveAllSelectedComments.cs │ ├── RemoveAllExceptXmlDocComments.cs │ ├── RemoveAllExceptTaskComments.cs │ └── BaseCommand.cs ├── Helpers │ └── ProjectHelpers.cs ├── CommentRemover.csproj └── VSCommandTable.vsct ├── .gitignore ├── .github ├── ISSUE_TEMPLATE.md └── CONTRIBUTING.md ├── .gitattributes ├── LICENSE ├── appveyor.yml ├── CHANGELOG.md ├── CommentRemover.sln └── README.md /UpgradeLog.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/CommentRemover/master/UpgradeLog.htm -------------------------------------------------------------------------------- /art/top-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/CommentRemover/master/art/top-menu.png -------------------------------------------------------------------------------- /src/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/CommentRemover/master/src/Resources/Icon.png -------------------------------------------------------------------------------- /src/Resources/Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/CommentRemover/master/src/Resources/Preview.png -------------------------------------------------------------------------------- /.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 -------------------------------------------------------------------------------- /.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. -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using CommentRemover; 4 | 5 | [assembly: AssemblyTitle(Vsix.Name)] 6 | [assembly: AssemblyDescription(Vsix.Description)] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany(Vsix.Author)] 9 | [assembly: AssemblyProduct(Vsix.Name)] 10 | [assembly: AssemblyCopyright(Vsix.Author)] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | [assembly: ComVisible(false)] 14 | 15 | [assembly: AssemblyVersion(Vsix.Version)] 16 | [assembly: AssemblyFileVersion(Vsix.Version)] 17 | -------------------------------------------------------------------------------- /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 | - 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 -------------------------------------------------------------------------------- /src/source.extension.cs: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ 2 | // 3 | // This file was generated by VSIX Synchronizer 4 | // 5 | // ------------------------------------------------------------------------------ 6 | namespace CommentRemover 7 | { 8 | internal sealed partial class Vsix 9 | { 10 | public const string Id = "d7c3f904-cc5a-4d47-aa25-81fb7c36df89"; 11 | public const string Name = "Comment Remover"; 12 | public const string Description = @"Remove all comments in any file with a click of a button. Can also remove #regions and preserve XML Doc comments."; 13 | public const string Language = "en-US"; 14 | public const string Version = "1.3"; 15 | public const string Author = "Mads Kristensen"; 16 | public const string Tags = "comment, cleanup, delete, region, XMLDoc"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/VSPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Threading; 4 | using Microsoft.VisualStudio.Shell; 5 | using task = System.Threading.Tasks.Task; 6 | 7 | namespace CommentRemover 8 | { 9 | [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] 10 | [InstalledProductRegistration("#110", "#112", Vsix.Version, IconResourceID = 400)] 11 | [ProvideMenuResource("Menus.ctmenu", 1)] 12 | [Guid(PackageGuids.guidPackageString)] 13 | public sealed class CommentRemoverPackage : AsyncPackage 14 | { 15 | protected override async task InitializeAsync(CancellationToken cancellationToken, IProgress progress) 16 | { 17 | await RemoveAllCommentsCommand.InitializeAsync(this); 18 | await RemoveAllSelectedComments.InitializeAsync(this); 19 | await RemoveRegionsCommand.InitializeAsync(this); 20 | await RemoveXmlDocComments.InitializeAsync(this); 21 | await RemoveAllExceptXmlDocComments.InitializeAsync(this); 22 | await RemoveTasksCommand.InitializeAsync(this); 23 | await RemoveAllExceptTaskComments.InitializeAsync(this); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | - [ ] Test in more file types (help wanted) 4 | - [ ] Razor files - _both .cshtml and .vbhtml_ 5 | - [ ] F# files 6 | - [ ] PowerShell files 7 | - [ ] SQL files 8 | - [x] ASPX files 9 | - [ ] XAML filesS 10 | - ...and others 11 | 12 | Features that have a checkmark are complete and available for 13 | download in the 14 | [CI build](http://vsixgallery.com/extension/d7c3f904-cc5a-4d47-aa25-81fb7c36df89/). 15 | 16 | # Changelog 17 | 18 | These are the changes to each version that has been released 19 | on the official Visual Studio extension gallery. 20 | 21 | ## 1.2 22 | 23 | **2016-03-17** 24 | 25 | - [x] Remove task comments 26 | - [x] Remove all except task comments 27 | - [x] Separated commands into groups 28 | - [x] Fixes issue with XML doc commments 29 | 30 | ## 1.1 31 | 32 | **2016-03-16** 33 | 34 | - [x] Option to delete only specific types of comments 35 | - [x] Regions 36 | - [x] XML doc comments 37 | - [x] Everything but XML doc comments 38 | - [x] Add commands to their own menu 39 | - [ ] Moved menu down in the language info group 40 | 41 | ## 1.0 42 | 43 | **2016-03-15** 44 | 45 | - [x] Initial release 46 | - [x] Remove all comments in file 47 | - [x] Correct handling of multi-line comments -------------------------------------------------------------------------------- /CommentRemover.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28012.3001 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommentRemover", "src\CommentRemover.csproj", "{54B4B640-D71B-493D-80CF-DD37B17F1E75}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{21DFC4C7-A50F-4129-ABFD-841CC37A0848}" 9 | ProjectSection(SolutionItems) = preProject 10 | appveyor.yml = appveyor.yml 11 | CHANGELOG.md = CHANGELOG.md 12 | README.md = README.md 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {54B4B640-D71B-493D-80CF-DD37B17F1E75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {54B4B640-D71B-493D-80CF-DD37B17F1E75}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {54B4B640-D71B-493D-80CF-DD37B17F1E75}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {54B4B640-D71B-493D-80CF-DD37B17F1E75}.Release|Any CPU.Build.0 = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | GlobalSection(ExtensibilityGlobals) = postSolution 30 | SolutionGuid = {E59C05D7-6652-41A5-BB6A-A48420CA6C8E} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /src/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Comment Remover 6 | Remove all comments in any file with a click of a button. Can also remove #regions and preserve XML Doc comments. 7 | https://github.com/madskristensen/CommentRemover 8 | Resources\LICENSE 9 | https://github.com/madskristensen/CommentRemover/blob/master/CHANGELOG.md 10 | Resources\Icon.png 11 | Resources\Preview.png 12 | comment, cleanup, delete, region, XMLDoc 13 | 14 | 15 | 16 | 17 | amd64 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/VSCommandTable.cs: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ 2 | // 3 | // This file was generated by VSIX Synchronizer 4 | // 5 | // ------------------------------------------------------------------------------ 6 | namespace CommentRemover 7 | { 8 | using System; 9 | 10 | /// 11 | /// Helper class that exposes all GUIDs used across VS Package. 12 | /// 13 | internal sealed partial class PackageGuids 14 | { 15 | public const string guidPackageString = "34f42dd5-2285-4902-bdfa-6d721e867b57"; 16 | public static Guid guidPackage = new Guid(guidPackageString); 17 | 18 | public const string guidXmlUiCmdsString = "fb87333b-16c8-400e-bc8f-f6b890410582"; 19 | public static Guid guidXmlUiCmds = new Guid(guidXmlUiCmdsString); 20 | 21 | public const string guidPackageCmdSetString = "d7952971-879b-431d-b743-70ad7e99e846"; 22 | public static Guid guidPackageCmdSet = new Guid(guidPackageCmdSetString); 23 | } 24 | /// 25 | /// Helper class that encapsulates all CommandIDs uses across VS Package. 26 | /// 27 | internal sealed partial class PackageIds 28 | { 29 | public const int MyMenu = 0x1000; 30 | public const int CommentsGroup = 0x1020; 31 | public const int XmlDocGroup = 0x1030; 32 | public const int RegionGroup = 0x1040; 33 | public const int TaskGroup = 0x1050; 34 | public const int RemoveAllComments = 0x0100; 35 | public const int RemoveAllSelectedComments = 0x0110; 36 | public const int RemoveRegions = 0x0200; 37 | public const int RemoveXmlDocComments = 0x0300; 38 | public const int RemoveAllExceptXmlDocComments = 0x0400; 39 | public const int RemoveTaskComments = 0x0500; 40 | public const int RemoveAllExceptTaskComments = 0x0600; 41 | } 42 | } -------------------------------------------------------------------------------- /src/Commands/RemoveXmlDocComments.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Microsoft.VisualStudio.Shell; 5 | using Microsoft.VisualStudio.Text; 6 | using Microsoft.VisualStudio.Text.Editor; 7 | 8 | namespace CommentRemover 9 | { 10 | internal sealed class RemoveXmlDocComments : BaseCommand 11 | { 12 | protected override void SetupCommands() 13 | { 14 | RegisterCommand(PackageGuids.guidPackageCmdSet, PackageIds.RemoveXmlDocComments); 15 | } 16 | 17 | protected override void Execute(OleMenuCommand button) 18 | { 19 | var view = ProjectHelpers.GetCurentTextView(); 20 | var mappingSpans = GetClassificationSpans(view, "xml doc comment"); 21 | 22 | if (!mappingSpans.Any()) 23 | return; 24 | 25 | try 26 | { 27 | DTE.UndoContext.Open(button.Text); 28 | 29 | RemoveCommentsFromBuffer(view, mappingSpans); 30 | } 31 | catch (Exception ex) 32 | { 33 | System.Diagnostics.Debug.Write(ex); 34 | } 35 | finally 36 | { 37 | DTE.UndoContext.Close(); 38 | } 39 | } 40 | 41 | private void RemoveCommentsFromBuffer(IWpfTextView view, IEnumerable mappingSpans) 42 | { 43 | var affectedLines = new List(); 44 | 45 | foreach (var mappingSpan in mappingSpans) 46 | { 47 | var start = mappingSpan.Start.GetPoint(view.TextBuffer, PositionAffinity.Predecessor).Value; 48 | var end = mappingSpan.End.GetPoint(view.TextBuffer, PositionAffinity.Successor).Value; 49 | 50 | var span = new Span(start, end - start); 51 | var line = view.TextBuffer.CurrentSnapshot.Lines.First(l => l.Extent.IntersectsWith(span)); 52 | 53 | if (!affectedLines.Contains(line.LineNumber)) 54 | affectedLines.Add(line.LineNumber); 55 | } 56 | 57 | using (var edit = view.TextBuffer.CreateEdit()) 58 | { 59 | foreach (var lineNumber in affectedLines) 60 | { 61 | var line = view.TextBuffer.CurrentSnapshot.GetLineFromLineNumber(lineNumber); 62 | edit.Delete(line.Start, line.LengthIncludingLineBreak); 63 | } 64 | 65 | edit.Apply(); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Commands/RemoveRegions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Microsoft.VisualStudio.Shell; 4 | using Microsoft.VisualStudio.Text.Editor; 5 | 6 | namespace CommentRemover 7 | { 8 | internal sealed class RemoveRegionsCommand : BaseCommand 9 | { 10 | protected override void SetupCommands() 11 | { 12 | RegisterCommand(PackageGuids.guidPackageCmdSet, PackageIds.RemoveRegions); 13 | } 14 | 15 | protected override void Execute(OleMenuCommand button) 16 | { 17 | var view = ProjectHelpers.GetCurentTextView(); 18 | 19 | try 20 | { 21 | DTE.UndoContext.Open(button.Text); 22 | 23 | RemoveRegionsFromBuffer(view); 24 | } 25 | catch (Exception ex) 26 | { 27 | System.Diagnostics.Debug.Write(ex); 28 | } 29 | finally 30 | { 31 | DTE.UndoContext.Close(); 32 | } 33 | } 34 | 35 | private void RemoveRegionsFromBuffer(IWpfTextView view) 36 | { 37 | using (var edit = view.TextBuffer.CreateEdit()) 38 | { 39 | foreach (var line in view.TextBuffer.CurrentSnapshot.Lines.Reverse()) 40 | { 41 | if (line.Extent.IsEmpty) 42 | continue; 43 | 44 | string text = line.GetText() 45 | .TrimStart('/', '*') 46 | .Replace(" 129 | -------------------------------------------------------------------------------- /src/Commands/BaseCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Design; 4 | using System.Linq; 5 | using System.Text.RegularExpressions; 6 | using EnvDTE; 7 | using EnvDTE80; 8 | using Microsoft; 9 | using Microsoft.VisualStudio.Shell; 10 | using Microsoft.VisualStudio.Text; 11 | using Microsoft.VisualStudio.Text.Editor; 12 | using Microsoft.VisualStudio.Text.Tagging; 13 | 14 | namespace CommentRemover 15 | { 16 | internal abstract class BaseCommand where T : BaseCommand, new() 17 | { 18 | public static async System.Threading.Tasks.Task InitializeAsync(AsyncPackage package) 19 | { 20 | Instance = new T 21 | { 22 | DTE = await package.GetServiceAsync(typeof(DTE)) as DTE2, 23 | CommandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService 24 | }; 25 | 26 | Assumes.Present(Instance.CommandService); 27 | Instance.SetupCommands(); 28 | } 29 | 30 | protected abstract void SetupCommands(); 31 | 32 | protected void RegisterCommand(Guid commandGuid, int commandId) 33 | { 34 | var id = new CommandID(commandGuid, commandId); 35 | var command = new OleMenuCommand(Callback, id); 36 | CommandService.AddCommand(command); 37 | } 38 | 39 | protected DTE2 DTE { get; private set; } 40 | 41 | private OleMenuCommandService CommandService { get; set; } 42 | 43 | public static T Instance { get; protected set; } 44 | 45 | private void Callback(object sender, EventArgs e) 46 | { 47 | var button = (OleMenuCommand)sender; 48 | Execute(button); 49 | } 50 | 51 | protected abstract void Execute(OleMenuCommand button); 52 | 53 | protected static IEnumerable GetClassificationSpans(IWpfTextView view, string classificationName) 54 | { 55 | if (view == null) 56 | { 57 | return Enumerable.Empty(); 58 | } 59 | 60 | Microsoft.VisualStudio.ComponentModelHost.IComponentModel componentModel = ProjectHelpers.GetComponentModel(); 61 | IBufferTagAggregatorFactoryService service = componentModel.GetService(); 62 | ITagAggregator classifier = service.CreateTagAggregator(view.TextBuffer); 63 | SnapshotSpan snapshot = new SnapshotSpan(view.TextBuffer.CurrentSnapshot, 0, view.TextBuffer.CurrentSnapshot.Length); 64 | 65 | IEnumerable mappingSpans = 66 | from s in classifier.GetTags(snapshot).Reverse() 67 | where s.Tag.ClassificationType.Classification.IndexOf(classificationName, StringComparison.OrdinalIgnoreCase) > -1 68 | select s.Span; 69 | if (mappingSpans.Any()) 70 | { 71 | return mappingSpans; 72 | } 73 | 74 | IViewTagAggregatorFactoryService serviceViewTag = componentModel.GetService(); 75 | ITagAggregator classifierViewTag = serviceViewTag.CreateTagAggregator(view); 76 | return from s in classifierViewTag.GetTags(snapshot).Reverse() 77 | where s.Tag.ClassificationType.Classification.IndexOf(classificationName, StringComparison.OrdinalIgnoreCase) > -1 78 | select s.Span; 79 | } 80 | 81 | protected static IEnumerable GetSelectionClassificationSpans(IWpfTextView view, string classificationName) 82 | { 83 | if (view == null) 84 | { 85 | return Enumerable.Empty(); 86 | } 87 | 88 | Microsoft.VisualStudio.ComponentModelHost.IComponentModel componentModel = ProjectHelpers.GetComponentModel(); 89 | IBufferTagAggregatorFactoryService service = componentModel.GetService(); 90 | ITagAggregator classifier = service.CreateTagAggregator(view.TextBuffer); 91 | IEnumerable mappingSpans = 92 | from s in classifier.GetTags(view.Selection.SelectedSpans).Reverse() 93 | where s.Tag.ClassificationType.Classification.IndexOf(classificationName, StringComparison.OrdinalIgnoreCase) > -1 94 | select s.Span; 95 | if (mappingSpans.Any()) 96 | { 97 | return mappingSpans; 98 | } 99 | 100 | 101 | IViewTagAggregatorFactoryService serviceViewTag = componentModel.GetService(); 102 | ITagAggregator classifierViewTag = serviceViewTag.CreateTagAggregator(view); 103 | return from s in classifierViewTag.GetTags(view.Selection.SelectedSpans).Reverse() 104 | where s.Tag.ClassificationType.Classification.IndexOf(classificationName, StringComparison.OrdinalIgnoreCase) > -1 105 | select s.Span; 106 | } 107 | 108 | protected static bool IsLineEmpty(ITextSnapshotLine line) 109 | { 110 | var text = line.GetText().Trim(); 111 | 112 | return (string.IsNullOrWhiteSpace(text) 113 | || text == "" 115 | || text == "<%%>" 116 | || text == "<%" 117 | || text == "%>" 118 | || Regex.IsMatch(text, @"")); 119 | } 120 | 121 | protected static bool IsXmlDocComment(ITextSnapshotLine line) 122 | { 123 | var text = line.GetText().Trim(); 124 | Microsoft.VisualStudio.Utilities.IContentType contentType = line.Snapshot.TextBuffer.ContentType; 125 | 126 | if (contentType.IsOfType("CSharp") && text.StartsWith("///")) 127 | { 128 | return true; 129 | } 130 | 131 | if (contentType.IsOfType("FSharp") && text.StartsWith("///")) 132 | { 133 | return true; 134 | } 135 | 136 | if (contentType.IsOfType("Basic") && text.StartsWith("'''")) 137 | { 138 | return true; 139 | } 140 | 141 | return false; 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /src/VSCommandTable.vsct: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Comments 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 43 | 44 | 54 | 55 | 65 | 66 | 76 | 77 | 87 | 88 | 98 | 99 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | --------------------------------------------------------------------------------