An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Go lang Support for Visual Studio for Windows and Mac
[![Build Status](https://gunderman.visualstudio.com/vs-go/_apis/build/status/gundermanc.vs-go?branchName=master)](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.

![image](https://user-images.githubusercontent.com/5387680/60867836-91a88f00-a1e0-11e9-9dfe-49d95c269a0c.png)

![image](https://user-images.githubusercontent.com/5387680/60389194-5e446280-9a72-11e9-9269-dfcaaf349514.png)

## 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 :)