├── .gitattributes ├── .gitignore ├── JustMyCodeToggle.ruleset ├── JustMyCodeToggle.sln ├── LICENSE.txt ├── README.md ├── Tvl.VisualStudio.JustMyCodeToggle ├── JustMyCodeToggle.vsct ├── JustMyCodeToggleConstants.cs ├── JustMyCodeTogglePackage.cs ├── Properties │ ├── AssemblyInfo.cs │ └── launchSettings.json ├── SharedKey.snk ├── Tvl.VisualStudio.JustMyCodeToggle.csproj ├── VSPackage.resx └── source.extension.vsixmanifest ├── appveyor.yml ├── doc ├── callstack.png └── toolbar.png └── stylecop.json /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Per-user files 2 | *.csproj.user 3 | *.suo 4 | 5 | # Temporary files created by the IDE 6 | .vs/ 7 | 8 | # Build output 9 | bin/ 10 | obj/ 11 | -------------------------------------------------------------------------------- /JustMyCodeToggle.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /JustMyCodeToggle.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.12 5 | MinimumVisualStudioVersion = 15.0 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{05CB4485-3F59-4189-96D8-F046221EC9CE}" 7 | ProjectSection(SolutionItems) = preProject 8 | .gitattributes = .gitattributes 9 | .gitignore = .gitignore 10 | appveyor.yml = appveyor.yml 11 | LICENSE.txt = LICENSE.txt 12 | README.md = README.md 13 | EndProjectSection 14 | EndProject 15 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tvl.VisualStudio.JustMyCodeToggle", "Tvl.VisualStudio.JustMyCodeToggle\Tvl.VisualStudio.JustMyCodeToggle.csproj", "{10CAD392-E083-41EB-92C9-B5F3142FA9F8}" 16 | EndProject 17 | Global 18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 19 | Debug|Any CPU = Debug|Any CPU 20 | Release|Any CPU = Release|Any CPU 21 | EndGlobalSection 22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 23 | {10CAD392-E083-41EB-92C9-B5F3142FA9F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 24 | {10CAD392-E083-41EB-92C9-B5F3142FA9F8}.Debug|Any CPU.Build.0 = Debug|Any CPU 25 | {10CAD392-E083-41EB-92C9-B5F3142FA9F8}.Release|Any CPU.ActiveCfg = Release|Any CPU 26 | {10CAD392-E083-41EB-92C9-B5F3142FA9F8}.Release|Any CPU.Build.0 = Release|Any CPU 27 | EndGlobalSection 28 | GlobalSection(SolutionProperties) = preSolution 29 | HideSolutionNode = FALSE 30 | EndGlobalSection 31 | GlobalSection(ExtensibilityGlobals) = postSolution 32 | SolutionGuid = {4A4CDD95-3316-491E-8EC9-428E17C81D44} 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Tunnel Vision Laboratories, LLC 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Just My Code Toggle extension for Visual Studio 2015+ 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/dnxhxa3chg1dtpnt/branch/master?svg=true)](https://ci.appveyor.com/project/sharwell/justmycodetoggle/branch/master) 4 | 5 | This extension adds the **Debug.JustMyCodeToggle** command to Visual Studio. By default, the command appears in the **Debug** toolbar as well as in the context menu for the **Call Stack** window. 6 | 7 | ### Debug Toolbar 8 | 9 | ![Debug Toolbar](doc/toolbar.png) 10 | 11 | ### Call Stack Window 12 | 13 | ![Call Stack window context menu](doc/callstack.png) 14 | 15 | ### Keyboard 16 | 17 | By default, the new command is not bound to a keystroke. A key binding may be added manually by configuring a binding for the **Debug.JustMyCodeToggle** command. 18 | -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/JustMyCodeToggle.vsct: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/JustMyCodeToggleConstants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. 2 | // Licensed under the MIT License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Tvl.VisualStudio.JustMyCodeToggle 5 | { 6 | using Guid = System.Guid; 7 | 8 | internal static class JustMyCodeToggleConstants 9 | { 10 | public const string GuidJustMyCodeTogglePackageString = "73702199-D0C5-4863-8203-99D41B34DD2D"; 11 | 12 | public const string GuidJustMyCodeToggleCommandSetString = "B1317E30-CFDA-47CA-90A0-95E894B150A0"; 13 | public static readonly Guid GuidJustMyCodeToggleCommandSet = new Guid("{" + GuidJustMyCodeToggleCommandSetString + "}"); 14 | 15 | public static readonly int CmdidJustMyCodeToggle = 0x0100; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/JustMyCodeTogglePackage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. 2 | // Licensed under the MIT License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Tvl.VisualStudio.JustMyCodeToggle 5 | { 6 | using System; 7 | using System.ComponentModel.Design; 8 | using System.Runtime.InteropServices; 9 | using System.Threading; 10 | using Microsoft; 11 | using Microsoft.VisualStudio; 12 | using Microsoft.VisualStudio.Shell; 13 | using IMenuCommandService = System.ComponentModel.Design.IMenuCommandService; 14 | using Task = System.Threading.Tasks.Task; 15 | 16 | [Guid(JustMyCodeToggleConstants.GuidJustMyCodeTogglePackageString)] 17 | [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] 18 | [ProvideMenuResource(1000, 1)] 19 | [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string, PackageAutoLoadFlags.BackgroundLoad)] 20 | internal class JustMyCodeTogglePackage : AsyncPackage 21 | { 22 | private readonly OleMenuCommand _command; 23 | 24 | public JustMyCodeTogglePackage() 25 | { 26 | var id = new CommandID(JustMyCodeToggleConstants.GuidJustMyCodeToggleCommandSet, JustMyCodeToggleConstants.CmdidJustMyCodeToggle); 27 | EventHandler invokeHandler = HandleInvokeJustMyCodeToggle; 28 | EventHandler changeHandler = HandleChangeJustMyCodeToggle; 29 | EventHandler beforeQueryStatus = HandleBeforeQueryStatusJustMyCodeToggle; 30 | _command = new OleMenuCommand(invokeHandler, changeHandler, beforeQueryStatus, id); 31 | } 32 | 33 | public EnvDTE.DTE ApplicationObject 34 | { 35 | get 36 | { 37 | return GetService(typeof(EnvDTE._DTE)) as EnvDTE.DTE; 38 | } 39 | } 40 | 41 | protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) 42 | { 43 | await base.InitializeAsync(cancellationToken, progress); 44 | 45 | await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); 46 | 47 | var mcs = (IMenuCommandService)await GetServiceAsync(typeof(IMenuCommandService)); 48 | Assumes.Present(mcs); 49 | mcs.AddCommand(_command); 50 | } 51 | 52 | private void HandleInvokeJustMyCodeToggle(object sender, EventArgs e) 53 | { 54 | try 55 | { 56 | EnvDTE.Property enableJustMyCode = ApplicationObject.get_Properties("Debugging", "General").Item("EnableJustMyCode"); 57 | if (enableJustMyCode.Value is bool value) 58 | { 59 | enableJustMyCode.Value = !value; 60 | } 61 | } 62 | catch (Exception ex) when (!ErrorHandler.IsCriticalException(ex)) 63 | { 64 | } 65 | } 66 | 67 | private void HandleChangeJustMyCodeToggle(object sender, EventArgs e) 68 | { 69 | } 70 | 71 | private void HandleBeforeQueryStatusJustMyCodeToggle(object sender, EventArgs e) 72 | { 73 | try 74 | { 75 | _command.Supported = true; 76 | 77 | EnvDTE.Property enableJustMyCode = ApplicationObject.get_Properties("Debugging", "General").Item("EnableJustMyCode"); 78 | if (enableJustMyCode.Value is bool value) 79 | { 80 | _command.Checked = value; 81 | } 82 | 83 | _command.Enabled = true; 84 | } 85 | catch (Exception ex) when (!ErrorHandler.IsCriticalException(ex)) 86 | { 87 | _command.Supported = false; 88 | _command.Enabled = false; 89 | } 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. 2 | // Licensed under the MIT License. See LICENSE.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Runtime.InteropServices; 6 | 7 | [assembly: CLSCompliant(false)] 8 | 9 | // Setting ComVisible to false makes the types in this assembly not visible 10 | // to COM components. If you need to access a type in this assembly from 11 | // COM, set the ComVisible attribute to true on that type. 12 | [assembly: ComVisible(false)] 13 | -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Visual Studio Extension": { 4 | "executablePath": "$(DevEnvDir)devenv.exe", 5 | "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/SharedKey.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunnelvisionlabs/JustMyCodeToggle/fc76cc6f825b1c015c285bec09c464b5542b6ba3/Tvl.VisualStudio.JustMyCodeToggle/SharedKey.snk -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/Tvl.VisualStudio.JustMyCodeToggle.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net45 7 | 8 | Adds the Just My Code command button to Visual Studio. 9 | Tunnel Vision Laboratories, LLC 10 | Copyright © Sam Harwell 2017 11 | 1.3.0.0 12 | 1.3.0.0 13 | 1.3.0-dev 14 | 15 | true 16 | true 17 | true 18 | false 19 | false 20 | true 21 | false 22 | 23 | true 24 | SharedKey.snk 25 | 26 | 27 | 28 | 29 | False 30 | 31 | 32 | true 33 | 34 | 35 | 36 | full 37 | true 38 | 39 | 40 | 41 | pdbonly 42 | true 43 | 44 | 45 | 46 | 47 | true 48 | $(MSBuildThisFileDirectory)..\JustMyCodeToggle.ruleset 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | LICENSE.txt 72 | true 73 | 74 | 75 | 76 | 77 | 78 | 1000 79 | Designer 80 | 81 | 82 | 83 | 84 | 85 | VSPackage.resources 86 | true 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/VSPackage.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | text/microsoft-resx 91 | 92 | 93 | 1.3 94 | 95 | 96 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 97 | 98 | 99 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 100 | 101 | -------------------------------------------------------------------------------- /Tvl.VisualStudio.JustMyCodeToggle/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Just My Code Toggle 6 | Adds the Just My Code command button to Visual Studio. 7 | https://github.com/tunnelvisionlabs/JustMyCodeToggle 8 | LICENSE.txt 9 | 10 | 11 | https://github.com/tunnelvisionlabs/JustMyCodeToggle/releases/latest 12 | 13 | 14 | debugging, just my code 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | image: Visual Studio 2017 3 | configuration: Release 4 | platform: Any CPU 5 | init: 6 | - git config --global core.autocrlf true 7 | install: 8 | - nuget restore 9 | build: 10 | verbosity: minimal 11 | test: off 12 | artifacts: 13 | - path: '**\*.vsix' 14 | -------------------------------------------------------------------------------- /doc/callstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunnelvisionlabs/JustMyCodeToggle/fc76cc6f825b1c015c285bec09c464b5542b6ba3/doc/callstack.png -------------------------------------------------------------------------------- /doc/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunnelvisionlabs/JustMyCodeToggle/fc76cc6f825b1c015c285bec09c464b5542b6ba3/doc/toolbar.png -------------------------------------------------------------------------------- /stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "documentationRules": { 5 | "companyName": "Tunnel Vision Laboratories, LLC", 6 | "copyrightText": "Copyright (c) {companyName}. All Rights Reserved.\nLicensed under the MIT License. See LICENSE.txt in the project root for license information.", 7 | "xmlHeader": false, 8 | "fileNamingConvention": "metadata" 9 | }, 10 | "layoutRules": { 11 | "newlineAtEndOfFile": "require" 12 | } 13 | } 14 | } 15 | --------------------------------------------------------------------------------