Giter Club home page Giter Club logo

openinvscode's Introduction

Open in Visual Studio Code

A Visual Studio extension that adds a menu command that lets you open any solution, project, folder or file in Visual Studio Code.

Build status

Download the extension at the VS Gallery or get the nightly build


This extension is for those times where you have a project open in Visual Studio and you want to be able to quickly open it in Visual Studio Code.

Prerequisite

In order to use this extension, you must have Visual Studio 2015/2017/2019 as well as Visual Studio Code installed.

You can download Visual Studio Code for free.

Solution Explorer

You can open any solution, project, folder or file in Visual Studio Code by simply right-clicking it in Solution Explorer and select Open in Visual Studio Code.

Context menu

Open current file

You can also open the current file in Visual Studio Code by clicking onto Extensions->Open in Visual Studio Code.

grafik

The default key binding is Ctrl+Shift+Y.

Path to Code.exe

If you installed Visual Studio Code at a non-default location, a prompt will ask for the path to Code.exe.

You can always change the location in Tools -> Options -> Web -> Open In Visual Studio Code.

Options

License

Apache 2.0

openinvscode's People

Contributors

cblech avatar coliff avatar jums avatar karpovv-boris avatar madskristensen avatar metasong avatar nhammadi avatar proudust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

openinvscode's Issues

Keyboard shortcut?

Hi - This is great. How can I assign it to a keyboard shortcut? From editing a file, I currently I need to do the "Ctrl+[, S", F10, Down, Down, Down, Enter :)

Fails in Visual Studio 2022 Preview 6

Right-Click on a file in the Solution Explorer and choose "Open in Visual Studio Code" and an error dialog is displayed:

image

At first I thought it might be an issue with my install location of VS Code, but I've updated the setting to exactly where my VS Code exe is, and the issues persists.

Would appreciate help figuring out what's going on. Thanks!

Love this extension in VS 2019

Error message on using the addin. code is not opened

Describe the bug
A clear and concise description of what the bug is.
The addon did not work (Code is not opened)

To Reproduce
Steps to reproduce the behavior:

  1. Open a project
  2. right click on Folder
  3. Click Open in Code

Error Message in Output Window
19.10.2022 11:25:45: System.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at OpenInVsCode.OpenVsCodeCommand.OpenFolderInVs(Object sender, EventArgs e) in C:\projects\openinvscode\src\Commands\OpenVsCodeCommand.cs:line 58

Fails to open files with spaces in the path

Describe the bug
Fails to open files that have spaces in the path.
Instead opens a bunch of nonexistent files broken up on the spaces

C:/Path
C://With
C:/Spaces/Subfolder/TestFile.txt

or sometimes there isn't a sln directory, just
C:/Path
C:/With
C:/Spaces/Subfolder/TestFile.txt

To Reproduce
Steps to reproduce the behavior:

  1. Create a file under C:\Test\Path With Spaces\SubFolder\TestFile.txt
  2. Open the file in Visual Studio
  3. Press Ctrl+Shift+Y or press the Extensions menu item

Expected behavior
Opens the file in VS Code

Additional context
Microsoft Visual Studio Professional 2022 (64-bit) - Current - Version 17.8.5
Open in Visual Studio Code - Version 1.4.58
Windows 11 Enterprise - 23H2 - 22631.3155
Visual Studio Code - Version 1.86.2

Doesn't work when main window on "Website:Publish"

To Reproduce
Steps to reproduce the behavior:

  1. Create a website project in Visual Studio and publish it to an Azure App Service
  2. "Website:Publish" should be the only open tab in main window.
  3. Right click on any folder in Solution Explorer.
  4. Click "Open with Visual Studio Code"
  5. Nothing happens

Expected behavior
VS Code should open

Output from Open in Visual Studio Code

7/30/2023 10:13:10 AM: System.ArgumentException: Value does not fall within the expected range. at EnvDTE80.DTE2.get_ActiveDocument() at OpenInVsCode.OpenVsCodeCommand.OpenFolderInVs(Object sender, EventArgs e) in C:\projects\openinvscode\src\Commands\OpenVsCodeCommand.cs:line 58

Stopped Working in 2019 (Version 16.8.3)

It's been working great in Visual Studio 2019 until its most recent update. After right clicking on the web project and selecting "Open in Visual Studio Code", nothing happens.

Not Installable on Windows 11 VM ARM64 VM on MackBook Pro M2

I recently purchased a Mac Book Pro M2 and am running Parallels install of Windows 11 on ARM64. Running Visual Studio 2022 Professional. I tried to install the OpenInVSCode extension and I get the attached error.

To Reproduce
Steps to reproduce the behavior:

  1. Download VSIX and run it.
  2. Install fails

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

Untitled 2

Install Log

3/15/2023 5:25:25 PM - Microsoft VSIX Installer
3/15/2023 5:25:25 PM - -------------------------------------------
3/15/2023 5:25:25 PM - vsixinstaller.exe version:
3/15/2023 5:25:25 PM - 17.5.4065+gbda5f544dc
3/15/2023 5:25:25 PM - -------------------------------------------
3/15/2023 5:25:25 PM - Command line parameters:
3/15/2023 5:25:25 PM - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,\Mac\Home\Downloads\Open_in_Visual_Studio_Code_v1.4.50 (1).vsix
3/15/2023 5:25:25 PM - -------------------------------------------
3/15/2023 5:25:25 PM - Microsoft VSIX Installer
3/15/2023 5:25:25 PM - -------------------------------------------
3/15/2023 5:25:29 PM - Initializing Install...
3/15/2023 5:25:30 PM - Extension Details...
3/15/2023 5:25:30 PM - Identifier : e99dde0e-e023-410d-bc5d-3f76db71e3f0
3/15/2023 5:25:30 PM - Name : Open in Visual Studio Code
3/15/2023 5:25:30 PM - Author : Mads Kristensen
3/15/2023 5:25:30 PM - Version : 1.4.50
3/15/2023 5:25:30 PM - Description : Adds a menu command that lets you open any solution, project, folder and file in Visual Studio Code.
3/15/2023 5:25:30 PM - Locale : en-US
3/15/2023 5:25:30 PM - MoreInfoURL : https://github.com/madskristensen/OpenInVsCode/
3/15/2023 5:25:30 PM - InstalledByMSI : False
3/15/2023 5:25:30 PM - SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
3/15/2023 5:25:30 PM - SignatureState : Unsigned
3/15/2023 5:25:30 PM - Supported Products :
3/15/2023 5:25:30 PM - Microsoft.VisualStudio.Pro
3/15/2023 5:25:30 PM - Version : [15.0,17.0)
3/15/2023 5:25:30 PM - ProductArchitecture : x86
3/15/2023 5:25:30 PM - Microsoft.VisualStudio.Pro
3/15/2023 5:25:30 PM - Version : [17.0,18.0)
3/15/2023 5:25:30 PM - ProductArchitecture : amd64
3/15/2023 5:25:30 PM - References :
3/15/2023 5:25:30 PM - Prerequisites :
3/15/2023 5:25:30 PM - -------------------------------------------------------
3/15/2023 5:25:30 PM - Identifier : Microsoft.VisualStudio.Component.CoreEditor
3/15/2023 5:25:30 PM - Name : Visual Studio core editor
3/15/2023 5:25:30 PM - Version : [15.0,)
3/15/2023 5:25:30 PM - Signature Details...
3/15/2023 5:25:30 PM - Extension is not signed.
3/15/2023 5:25:30 PM - Searching for applicable products...
3/15/2023 5:25:30 PM - Found installed product - Visual Studio Professional 2022
3/15/2023 5:25:30 PM - Found installed product - Global Location
3/15/2023 5:25:30 PM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
at VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable1& skuData) at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable1& skuData)
at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
at VSIXInstaller.App.Initialize()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

Visual Studio Info

Microsoft Visual Studio Professional 2022
Version 17.5.2
VisualStudio.17.Release/17.5.2+33502.453
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Professional

ASP.NET and Web Tools 17.5.317.37931
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.5.317.37931
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 17.5.317.37931
Azure Functions and Web Jobs Tools

C# Tools 4.5.0-6.23128.14+651d32d8017cfcc60fcbd67383601fa9a3deb145
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Node.js Tools 1.5.50105.3 Commit Hash:882de61a7c99ae988d4c62029301292a3e0b1d56
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 6.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core) 17.5.2.2312702+323f505b8fab392bd096ccc384321ca7f26f2633
Provides languages services for ASP.NET Core Razor.

Redgate SQL Prompt 1.0.0.0
Write, format, and refactor SQL effortlessly

SQL Server Data Tools 17.2.40118.0
Microsoft SQL Server Data Tools

TypeScript Tools 17.0.20105.2003
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.5.0-6.23128.14+651d32d8017cfcc60fcbd67383601fa9a3deb145
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.5.0-beta.23053.5+794b7c259d9646a7eb685dad865aa27da7940a21
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

Device Info

Device name MURPHYSMIND001
Processor Apple Silicon 3.20 GHz (4 processors)
Installed RAM 8.00 GB
Device ID 6BDBDEA9-7B6C-4D65-BC32-6EA6B9205A2E
Product ID 00330-80144-55340-AA669
System type 64-bit operating system, ARM-based processor
Pen and touch Pen support

Windows Info

Edition Windows 11 Pro
Version 22H2
Installed on ‎3/‎14/‎2023
OS build 22621.525
Experience Windows Feature Experience Pack 1000.22634.1000.0

`ArgumentOutOfRangeException` is thrown

Describe the bug
'Open in Visual Studio Code' fails with ArgumentOutOfRangeException.

To Reproduce
Steps to reproduce the behavior:

  1. Set PATH to VSCode path in all lower case.
  2. Click on 'Open in Visual Studio Code'.
  3. The output shows the following exception:
System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at OpenInVsCode.VsCodeDetect.InEnvVarPath() in C:\projects\openinvscode\src\Commands\OpenVsCodeCommand.cs:line 211
   at OpenInVsCode.OpenVsCodeCommand.EnsurePathExist() in C:\projects\openinvscode\src\Commands\OpenVsCodeCommand.cs:line 116
   at OpenInVsCode.OpenVsCodeCommand.OpenVsCode(String path, Int32 line) in C:\projects\openinvscode\src\Commands\OpenVsCodeCommand.cs:line 78
   at OpenInVsCode.OpenVsCodeCommand.OpenFolderInVs(Object sender, EventArgs e) in C:\projects\openinvscode\src\Commands\OpenVsCodeCommand.cs:line 63

Expected behavior
Opens VSCode.

Selecting multiple files and opening them actually opens the first file only

Installed product versions

Visual Studio: 2017 Professional
This extension: 1.4.29

Description
Selecting multiple files and opening them actually opens the first file only.

Steps to recreate

  • Select multiple files
  • Right click -> open in visual studio code

Current behavior
Only the first file is opened.

Expected behavior
All files must be opened.

New option for opening solution and project files as normal files

Installed product versions

Visual Studio: 2017 Professional
This extension: 1.4.29

Description
There is no option to open *.sln, *.csproj, *.vbproj as regular files

Expected behavior
We should be able to open solutions and projects files as regular files and control this behavior from the options screen

[FeatureRequest] Open edited file

Can you extend this awesome tool to open the currently opened file?
This would be my use case:

  1. edit a file in Visual Studio (not the one highlighted in the Solution Explorer!)
  2. press a keyboard shortcut
  3. open the same file in Visual Studio Code - without modifying what is selected in the Solution Explorer
    Preferably with passing the $CurrentLine and the $CurrentColumn as arguments so you end up at the exact same location as you were in Visual Studio before.

Fails to launch new VS Code 64 bit

Version info:

Microsoft Visual Studio Community 2017 Preview (vs2017c)
Version 15.3.1 Preview 1.0
VisualStudio.15.Preview/15.3.1-pre.1.0+26730.8
Microsoft .NET Framework
Version 4.7.02046

Open in Visual Studio Code 1.3.21

Even though I installed this in the VS2017Preview, I don't think that's the issue, because it worked just before I upgrade Visual Studio Code to the new 64 bit version.

Here's the error dialog that shows after I click the "Open in Visual Studio Code" command on a file:
2017-08-19

Does not work on vscode system setup

Describe the bug
I have a Visual Studio 2022 17.6.5, when I have vscode setup by user, if I right click on Solution and click Open in Visual Studio Code, vscode open correctly, but after I install vscode system wide, this button does not work correctly, and vscode does not open.

I try to remove and install again this extension, but my problem does not resolve

To Reproduce
Steps to reproduce the behavior:

  1. Right click on solution
  2. Click on 'Open in Visual Studio Code'
  3. vscode does not open

Expected behavior
Open vscode

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
vscode version: 1.81.0 (system setup)

Visual Studio Code "UserSetup" breaks opening of Visual Studio projects and solution files (in Administrator mode)

Hi there,

after I was prompted by Installation Wizzard to reinstall Visual Studio Code (v1.26.1), as new recommended "UserSetup", next time I run "Open In Visual Studio Code" on *.csproj file, it prompted me to provide new code.exe location. Now that it is setup to:

C:\users\{username}\AppData\Local\Programs\Microsoft VS Code\Code.exe

Now, when I righ-click on *.sln or *.csproj files, Visual Studio Code opens folder:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\

This happens only when I use Visual Studio in Administrator mode (which is almost 100% of time).

When I open folders inside of the project (ex: Controllers) path is correct. Option Open solution/project as regular file is set to False and Command line arguments are empty.

Feature request - Open in Visual Studio

Instead of open a folder/file in Visual Studio Code, I would like to open in another Visual Studio instance.
If implemented, should that be in this extension or create a new, dedicated extension?

Open from solution does not work

I get this stack trace when I try to open the full solution in VS Code.

06.11.2018 14.06.58: System.ArgumentException: Value does not fall within the expected range.
   at EnvDTE80.DTE2.get_ActiveDocument()
   at OpenInVsCode.OpenVsCodeCommand.OpenFolderInVs(Object sender, EventArgs e) in C:\projects\openinvscode\src\Commands\OpenVsCodeCommand.cs:line 54

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.