├── .gitattributes ├── .gitignore ├── AnyScriptCs.sln ├── AnyScriptCs ├── AnyScriptCs.csproj ├── CodeUnderstanding │ └── VsScriptCsDebugLaunchProvider.cs ├── Properties │ └── AssemblyInfo.cs ├── packages.config └── source.extension.vsixmanifest ├── LICENSE ├── README.md └── lib └── Microsoft.VisualStudio.Workspaces.Contracts.dll /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | # DNX 42 | project.lock.json 43 | artifacts/ 44 | 45 | *_i.c 46 | *_p.c 47 | *_i.h 48 | *.ilk 49 | *.meta 50 | *.obj 51 | *.pch 52 | *.pdb 53 | *.pgc 54 | *.pgd 55 | *.rsp 56 | *.sbr 57 | *.tlb 58 | *.tli 59 | *.tlh 60 | *.tmp 61 | *.tmp_proj 62 | *.log 63 | *.vspscc 64 | *.vssscc 65 | .builds 66 | *.pidb 67 | *.svclog 68 | *.scc 69 | 70 | # Chutzpah Test files 71 | _Chutzpah* 72 | 73 | # Visual C++ cache files 74 | ipch/ 75 | *.aps 76 | *.ncb 77 | *.opensdf 78 | *.sdf 79 | *.cachefile 80 | 81 | # Visual Studio profiler 82 | *.psess 83 | *.vsp 84 | *.vspx 85 | 86 | # TFS 2012 Local Workspace 87 | $tf/ 88 | 89 | # Guidance Automation Toolkit 90 | *.gpState 91 | 92 | # ReSharper is a .NET coding add-in 93 | _ReSharper*/ 94 | *.[Rr]e[Ss]harper 95 | *.DotSettings.user 96 | 97 | # JustCode is a .NET coding add-in 98 | .JustCode 99 | 100 | # TeamCity is a build add-in 101 | _TeamCity* 102 | 103 | # DotCover is a Code Coverage Tool 104 | *.dotCover 105 | 106 | # NCrunch 107 | _NCrunch_* 108 | .*crunch*.local.xml 109 | 110 | # MightyMoose 111 | *.mm.* 112 | AutoTest.Net/ 113 | 114 | # Web workbench (sass) 115 | .sass-cache/ 116 | 117 | # Installshield output folder 118 | [Ee]xpress/ 119 | 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | 130 | # Click-Once directory 131 | publish/ 132 | 133 | # Publish Web Output 134 | *.[Pp]ublish.xml 135 | *.azurePubxml 136 | ## TODO: Comment the next line if you want to checkin your 137 | ## web deploy settings but do note that will include unencrypted 138 | ## passwords 139 | #*.pubxml 140 | 141 | *.publishproj 142 | 143 | # NuGet Packages 144 | *.nupkg 145 | # The packages folder can be ignored because of Package Restore 146 | **/packages/* 147 | # except build/, which is used as an MSBuild target. 148 | !**/packages/build/ 149 | # Uncomment if necessary however generally it will be regenerated when needed 150 | #!**/packages/repositories.config 151 | 152 | # Windows Azure Build Output 153 | csx/ 154 | *.build.csdef 155 | 156 | # Windows Store app package directory 157 | AppPackages/ 158 | 159 | # Visual Studio cache files 160 | # files ending in .cache can be ignored 161 | *.[Cc]ache 162 | # but keep track of directories ending in .cache 163 | !*.[Cc]ache/ 164 | 165 | # Others 166 | ClientBin/ 167 | [Ss]tyle[Cc]op.* 168 | ~$* 169 | *~ 170 | *.dbmdl 171 | *.dbproj.schemaview 172 | *.pfx 173 | *.publishsettings 174 | node_modules/ 175 | orleans.codegen.cs 176 | 177 | # RIA/Silverlight projects 178 | Generated_Code/ 179 | 180 | # Backup & report files from converting an old project file 181 | # to a newer Visual Studio version. Backup files are not needed, 182 | # because we have git ;-) 183 | _UpgradeReport_Files/ 184 | Backup*/ 185 | UpgradeLog*.XML 186 | UpgradeLog*.htm 187 | 188 | # SQL Server files 189 | *.mdf 190 | *.ldf 191 | 192 | # Business Intelligence projects 193 | *.rdl.data 194 | *.bim.layout 195 | *.bim_*.settings 196 | 197 | # Microsoft Fakes 198 | FakesAssemblies/ 199 | 200 | # Node.js Tools for Visual Studio 201 | .ntvs_analysis.dat 202 | 203 | # Visual Studio 6 build log 204 | *.plg 205 | 206 | # Visual Studio 6 workspace options file 207 | *.opt 208 | 209 | # LightSwitch generated files 210 | GeneratedArtifacts/ 211 | _Pvt_Extensions/ 212 | ModelManifest.xml 213 | -------------------------------------------------------------------------------- /AnyScriptCs.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnyScriptCs", "AnyScriptCs\AnyScriptCs.csproj", "{6AA382EB-9B2C-4076-BB4E-5730176CDEF2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6AA382EB-9B2C-4076-BB4E-5730176CDEF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6AA382EB-9B2C-4076-BB4E-5730176CDEF2}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6AA382EB-9B2C-4076-BB4E-5730176CDEF2}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6AA382EB-9B2C-4076-BB4E-5730176CDEF2}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /AnyScriptCs/AnyScriptCs.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 14.0 6 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 7 | 8 | 9 | 10 | Debug 11 | AnyCPU 12 | 2.0 13 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | {6AA382EB-9B2C-4076-BB4E-5730176CDEF2} 15 | Library 16 | Properties 17 | AnyScriptCs 18 | AnyScriptCs 19 | v4.6 20 | false 21 | true 22 | false 23 | false 24 | false 25 | false 26 | Program 27 | $(DevEnvDir)\devenv.exe 28 | /rootsuffix Exp 29 | $(VisualStudioVersion) 30 | 31 | 32 | true 33 | full 34 | false 35 | bin\Debug\ 36 | DEBUG;TRACE 37 | prompt 38 | 4 39 | 40 | 41 | pdbonly 42 | true 43 | bin\Release\ 44 | TRACE 45 | prompt 46 | 4 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Designer 56 | source.extension.resx 57 | 58 | 59 | 60 | 61 | 62 | ..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll 63 | True 64 | 65 | 66 | ..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll 67 | True 68 | 69 | 70 | ..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll 71 | True 72 | 73 | 74 | ..\lib\Microsoft.VisualStudio.Workspaces.Contracts.dll 75 | False 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 86 | 87 | 88 | 89 | 90 | 91 | 92 | 99 | -------------------------------------------------------------------------------- /AnyScriptCs/CodeUnderstanding/VsScriptCsDebugLaunchProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio; 3 | using Microsoft.VisualStudio.Shell.Interop; 4 | using Microsoft.VisualStudio.Workspaces.CodeUnderstanding; 5 | using Microsoft.VisualStudio.Workspaces.CodeUnderstanding.Contexts; 6 | 7 | namespace AnyScriptCs.CodeUnderstanding 8 | { 9 | [ExportVsDebugLaunchTarget(TargetType, new[] { ".csx" }, ProviderPriority.Lowest, ProviderOptions.None)] 10 | public class VsScriptCsDebugLaunchProvider : IVsDebugLaunchTargetProvider 11 | { 12 | private const string TargetType = "EDB4E838-3876-4797-B7F7-6DB30632E486"; // random guid 13 | private static readonly Guid ManagedOnlyGuid = new Guid("{449EC4CC-30D2-4032-9256-EE18EB41B62B}"); // taken from VSConstants.DebugEnginesGuids.ManagedOnly_guid 14 | 15 | public object SetupDebugTargetInfo(object vsDebugTargetInfo, DebugLaunchActionContext debugLaunchContext) 16 | { 17 | if (!debugLaunchContext.LaunchConfiguration.ContainsKey("scriptcs_exe")) 18 | return vsDebugTargetInfo; 19 | 20 | var scriptcs = debugLaunchContext.LaunchConfiguration.GetValue("scriptcs_exe"); 21 | var debugInfo = (VsDebugTargetInfo)vsDebugTargetInfo; 22 | var csxFile = debugInfo.bstrExe; 23 | debugInfo.bstrExe = scriptcs; 24 | debugInfo.bstrArg = $"\"{csxFile}\" -debug"; 25 | debugInfo.clsidCustom = ManagedOnlyGuid; 26 | debugInfo.grfLaunch |= (uint)__VSDBGLAUNCHFLAGS.DBGLAUNCH_StopDebuggingOnEnd; 27 | return debugInfo; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /AnyScriptCs/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AnyScriptCs")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("AnyScriptCs")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the values or you can default the Build and Revision Numbers 30 | // by using the '*' as shown below: 31 | // [assembly: AssemblyVersion("1.0.*")] 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /AnyScriptCs/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AnyScriptCs/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AnyScriptCS 6 | Support debugging scriptcs (http://scriptcs.net/) files in Visual Studio 2016's "Open Folder" (File -> Open Folder) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Igal Tabachnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What's this? 2 | 3 | This is an extension for Visual Studio "15" (vNext), adding support for debugging [scriptcs](http://scriptcs.net) scripts, when opening them with "Open Folder". 4 | 5 | **Note**: this is a very early preview, and everything might change in the future. 6 | 7 | ## Information 8 | 9 | At [Build 2016](https://build.microsoft.com/), Microsoft announced a new [Visual Studio vNext](http://aka.ms/vsnext) feature called **Open Folder**: 10 | 11 | > Open Folder is a convenient way to navigate code bases without projects and solutions. The Solution Explorer has a new button to switch between Solution and Folder views. If MSBuild-based projects exist in the folder, the editor will provide IntelliSense for C# or Visual Basic files, and you can build or debug by using F5 and the file context menu in the Solution Explorer. Python and Node.js scripts can also be debugged after the respective Visual Studio tools are installed. Version control operations are available in the Solution Explorer for folders under Git version control. 12 | 13 | ![](https://i3-vso.sec.s-msft.com/dynimg/IC850198.png) 14 | 15 | ## Installation and configuration: 16 | 17 | Grab the latest vsix file from the [Releases](../../releases) page (or the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/9600779f-ee03-4b1b-9dfa-5bb9af85085b)), and double-click it to install in Visual Studio. 18 | 19 | Once installed, open Visual Studio "15", select **File > Open > Folder...**, and select a folder containing scriptcs (*.csx) files 20 | 21 | Right click on any .csx file, and select **Set as Startup Item**: 22 | 23 | ![image](https://cloud.githubusercontent.com/assets/601206/14170386/32a12268-f736-11e5-9d49-3aef4607ed52.png) 24 | 25 | Finally, click the dropdown arrow of the Debug button, and select **Customize**: 26 | 27 | ![image](https://cloud.githubusercontent.com/assets/601206/14170490/c1e802f2-f736-11e5-9a5b-75d70507c0e1.png) 28 | 29 | A file called **launch.json** will open. We need to specify the path to **scriptcs.exe** inside the file like this: 30 | 31 | ```json 32 | { 33 | "version": "0.2.0", 34 | "configurations": [ 35 | { 36 | "name": "HelloWorld.csx", 37 | "project": "HelloWorld.csx", 38 | "scriptcs_exe": "C:\\dev\\scriptcs\\src\\ScriptCs\\bin\\Release\\scriptcs.exe" 39 | } 40 | ] 41 | } 42 | ``` 43 | 44 | Save the file, and press F5! 45 | 46 | ![image](https://cloud.githubusercontent.com/assets/601206/14171166/3d7b216c-f73a-11e5-9be9-46aa49bed80b.png) 47 | -------------------------------------------------------------------------------- /lib/Microsoft.VisualStudio.Workspaces.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hmemcpy/AnyScriptCs/fe96129de2d1f336031bc67d984431dbf265ca0e/lib/Microsoft.VisualStudio.Workspaces.Contracts.dll --------------------------------------------------------------------------------