https://github.com/gundermanc/vs-go
Hack and slash Go language service prototype for VS Win + VS Mac
https://github.com/gundermanc/vs-go
go golang visual-studio visual-studio-for-mac
Last synced: 4 months ago
JSON representation
Hack and slash Go language service prototype for VS Win + VS Mac
- Host: GitHub
- URL: https://github.com/gundermanc/vs-go
- Owner: gundermanc
- License: mit
- Created: 2019-06-19T02:52:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-07T08:58:26.000Z (about 6 years ago)
- Last Synced: 2025-06-02T17:23:41.369Z (about 1 year ago)
- Topics: go, golang, visual-studio, visual-studio-for-mac
- Language: C#
- Homepage:
- Size: 297 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go lang Support for Visual Studio for Windows and Mac
[](https://gunderman.visualstudio.com/vs-go/_build/latest?definitionId=1&branchName=master)
Hackathon project proof-of-concept for a x plat Go language service. Now abandoned.


## Done
### Planned Supported platforms:
- Visual Studio 2019 16.1 for Windows
- Visual Studio 2019 8.2.0 Preview for Mac
### How it does/will work
- Language service smarts are written in Go, using the token, parser, and types libraries
from the Go standard library to lex, parse, and type check the code.
- Editor features talk to this language service through a thin inteop layer built using a
a combination of PInvoke and a cgo c-shared library with C language bindings for Go.
### Historical Context
Screenshots are from an earlier build which was a full, from-scratch language service for
Go in C#. Since then, I have changed strategies to enable reuse of existing Go libraries.
We're starting at square one. The code seen here is a series of hacks meant to set the context.
### Editor Features
- Currently using TextMate for colorization and outlining and structure. Ideally we'll move
this to using the Go AST or tokens.
- Error squiggles are directly output by the go/parser and go/types libraries as a result of
parsing and type checking the code.
## Getting started
- Install the Go development SDK.
- Install gofmt and gogetdoc.
- Build in Visual Studio 2019 16.1+.
- Copy src/test-fodder to your GOPATH directory.
- Open the file in the experimental VS instance.
### Windows
- Install Visual Studio 2019 16.1
- Install Go SDK (expects C:\Go)
- Install MinGW32 GCC C/C++ compiler for Windows (expects C:\MinGW)
- Open Go.Windows.sln, rebuild and start 'Visual Studio Extension'
### Mac
- Install VS for Mac 8.2 Preview
- Install Go SDK
- Install XCode/Apple developer tools (needed for gcc).
### Debugging
- C# code is best debugged from Visual Studio.
- It's recommended that you debug Go Code by:
- Open the root of the repo in VS Code as a folder view
- Install the Go Extension for VS Code
- Test changes using the debugger in VS Code against the 'testapp.go' file.
- Native Go interop layer can only be debugged via GCC, so it's recommended
that you minimize additions to this layer.
Contributions and discussion are absolutely welcome :)