GitHub integration in Visual Studio 2019

Just discovering VS 2019. It makes it easier to work with GitHub repo’s with GitHub integration.

Video here showing a quick run down of features.
another here showing some VS 2019 features.

I did not sign into github when the program was first installed (not sure where you sign in after that point) From the search function mentioned in the 2nd video you can search for “github” which will install a plugin which allows you sign in / authorise, you can push changes etc all within vs2019 then.

Will make life easier for me anyway as I had been uploading changes and creating branches etc manually from the browser, looks like you still have to merge PR’s from the browser.

The ‘compare changes’ is a nice feature, still exploring newer features but you can compare like this in VSCode. Might be worth a look for anyone using VS Code as an IDE and Rack development.

Another feature in vs2019 allows to open a project folder. To do so you go to file > open > folder

I’m currently trying to set this up to debug a Rack build with no success.

Trying to follow this blog post but i’m somewhat lost at “Build with MinGW” specifically “Right click your build script”

I wanted to debug / profile my own code but when the folder is added to VS it is missing folders “build”, “dep” and “plugins” (".git", “.vs”, also not in VS “open folder”)

Anyone with more experience with this able to show how to set this up?

While true I believe it is 3rd party in both and a little bit hard to set up. In 2019 it is 1st party Microsoft and very easy to use (GUI).

I was aware that with msys2 reads and writes to / from GitHub but I was never comfortable pushing from the console myself. Having everything where I can see it in VS makes it a lot easier, for me anyway.

Command line is good for managing things, but I’m addicted to a GUI that shows the state of all your files at a glance. I use SourceTree, but I assume the built in ones are very good, too.

Plugin or stand alone? There will be a lot more integration with GitHub in VS community I’d say as seen as MS own it now.

I use stand alone SourceTree, but just out of habit. I hear the git integration in VS code is really good. I switch between VS and VS code for most things.

I’ll use VScode for small edits or as a text editor but for new modules or plugin builds I hate the workflow with it. Just love the layout of community, it’s a work horse.

I’ve been using VS since it was called “Visual C++ 5.0”, but I’m using it less and less. VS code is so much better at navigating code that I use it for almost all my editing, then I build and debug in VS. I guess partly it’s because at work I need to do a lot of things that VS isn’t so great at (like mac development!).

My workflow is pretty strange, however. I do 95% of my work in a command line unit test program, and do all the debugging in there. Once I build a plugin (from the command line) I debug it with printf :wink:

Your missing folders are because they are in Rack’s .gitignore file, which is respected by Visual Studio’s Solution Explorer. Comment out anything you want to see, and it will magically appear. :slight_smile:

1 Like

Kind of off topic but can VCV modules be developed with Visual Studio, using the Microsoft C++ compiler?

I believe it’s possible, although I haven’t done it.

It is possible to integrate msys2 into Visual Studio community but any resources showing how to do it I’ve seen have fallen short, specifically for Rack it gets very confusing.

It would be ideal to be able to launch VS community and make run from there, also get to use break points etc from the editor. The above link I posted shows how to get IntelliSense to work with “open folder”. My first attempt failed, nothing but red in VS :expressionless:

not trying to preach my lifestyle, but the code intelligence in VS Code is pretty good. Took me maybe 20 minutes to figure out how to tell it where Rack’s headers are and now “goto declaration” works every time. Seems better than VS “intellisense”.

That is IntelliSense in VSCode also!

I’m sure getting it to work in both is the same!?

oh, you are right - it’s the MS plugin. I haven’t really kept up, but for many years I’ve thought that pressing “goto definition” works about 25% of the time, even if all the code is in your project. Maybe they made it better?

Compiling Rack and plugins with the Visual Studio compiler would be all-or-nothing, because it uses a different ABI from MinGW. So you’d need to compile all the dependencies, and Rack itself, and any plugin used in your patches, using MSVC.

Out of the box that can’t be done, because there is code in Rack that uses GCC extensions that MSVC doesn’t understand, like variable length arrays for instance.

The way plugins refer to the Rack API at runtime is a bit alien to MSVC-compiled DLLs as well - the plugin DLLs refer to symbols in the executable as though it were a DLL, which is the Unix shared object model rather than the Windows DLL model. Some monkeying about to create an import library for Rack.exe would be needed to make that work.

I have a working environment for debugging with Visual Studio. In the .vs directory within the directory I’m opening with Open Folder (which is the parent directory of my Rack checkout) I have this launch.vs.json:

{
    "version": "0.2.1",
    "defaults": {},
    "configurations": [
        {
            "type": "cppdbg",
            "name": "Rack.exe",
            "project": "Rack\\Rack.exe",
            "cwd": "${workspaceRoot}\\Rack",
            "program": "${workspaceRoot}\\Rack\\Rack.exe",
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
            "args": [ "-d" ],
            "externalConsole": true
        }
    ]
}

That was initially created by right-clicking Rack.exe in Solution Explorer (having first removed it from .gitignore so it appears!) and clicking “Debug and Launch settings”.

1 Like