Skip to content

Commit

Permalink
Merge pull request #39 from goplus/goplus
Browse files Browse the repository at this point in the history
README
  • Loading branch information
xushiwei authored Nov 27, 2023
2 parents 882417a + e608dae commit d8e64b0
Showing 1 changed file with 50 additions and 77 deletions.
127 changes: 50 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
# Go for Visual Studio Code
# Go/Go+ for Visual Studio Code

[![Slack](https://img.shields.io/badge/slack-gophers-green.svg?style=flat)](https://gophers.slack.com/messages/vscode/)
[![GitHub release](https://img.shields.io/github/v/tag/goplus/vscode-gop.svg?label=release)](https://github.com/goplus/vscode-gop/releases)
[![Language](https://img.shields.io/badge/language-Go+-blue.svg)](https://github.com/goplus/gop)

<!--TODO: We should add a badge for the build status or link to the build dashboard.-->

[The VS Code Go extension](https://marketplace.visualstudio.com/items?itemName=golang.go)
[The VS Code Go/Go+ extension](https://marketplace.visualstudio.com/items?itemName=goplus.gop)
provides rich language support for the
[Go programming language](https://go.dev/).
[Go programming language](https://go.dev/) and the [Go+ programming language](https://gop.dev/).

📣
[Remote attach debugging](https://github.com/golang/vscode-go/wiki/debugging#connecting-to-headless-delve-with-target-specified-at-server-start-up) is now available via Delve's native DAP implementation with Delve v1.7.3 or newer. It enchances remote debugging with the same
[debugging features](https://github.com/golang/vscode-go/wiki/debugging) that are already in use for local debugging. It is now the default with the
[Go Nightly](https://github.com/golang/vscode-go/wiki/nightly) build of the extension and will become the default for the stable releases in mid 2022.
We recommend switching your remote attach configurations in `launch.json` to use
`"debugAdapter":"dlv-dap"` now to verify that this works for you.
Please [file a new issue](https://github.com/golang/vscode-go/issues/new/choose) if you encounter any problems.

📣📣 Watch [Debugging Treasure Hunt](https://youtu.be/ZPIPPRjwg7Q) from [GopherCon 2021](https://www.gophercon.com/) for a fun take on a debugging demo with VS Code Go and Delve DAP.
Please [file a new issue](https://github.com/goplus/vscode-gop/issues/new/choose) if you encounter any problems.


## Quick Start

Welcome! 👋🏻<br/>
Whether you are new to Go or an experienced Go developer, we hope this
Whether you are new to Go/Go+ or an experienced Go/Go+ developer, we hope this
extension fits your needs and enhances your development experience.

1. Install [Go](https://go.dev) 1.18 or newer if you haven't already.

1. Install the [VS Code Go extension].
1. Install [Go+](https://gop.dev) 1.1.13 or newer if you haven't already.

1. Install the [VS Code Go/Go+ extension].

1. Open any directory or workspace containing Go code to automatically activate
the extension. The
[Go status bar](https://github.com/golang/vscode-go/wiki/ui) appears in the
bottom left corner of the window and displays your Go version.
1. Open any directory or workspace containing Go code to automatically activate the
extension. The [Go/Go+ status bar](https://github.com/goplus/vscode-gop/wiki/ui)
appears in the bottom left corner of the window and displays your Go/Go+ version.

1. The extension depends on `go`, `gopls`, `dlv` and other optional tools. If
1. The extension depends on `go`, `gop`, `goxls`, `dlv` and other optional tools. If
any of the dependencies are missing, the ⚠️ `Analysis Tools Missing` warning
is displayed. Click on the warning to download dependencies.

See the
[tools documentation](https://github.com/golang/vscode-go/wiki/tools) for a
[tools documentation](https://github.com/goplus/vscode-gop/wiki/tools) for a
complete list of tools the extension depends on.

<p align="center">
Expand All @@ -52,28 +46,28 @@ You are ready to Go :-) &nbsp;&nbsp; 🎉🎉🎉

## What's next

* Explore more [features][full feature breakdown] of the VS Code Go extension.
* Explore more [features][full feature breakdown] of the VS Code Go/Go+ extension.
* View the
[settings documentation](https://github.com/golang/vscode-go/wiki/settings)
[settings documentation](https://github.com/goplus/vscode-gop/wiki/settings)
and [advanced topics](https://github.com/golang/vscode-go/wiki/advanced) to
customize the extension.
* View the [tools documentation](https://github.com/golang/vscode-go/wiki/tools)
* View the [tools documentation](https://github.com/goplus/vscode-gop/wiki/tools)
for a complete list of tools the VS Code Go extension depends on.
* Solve issues with the
[general troubleshooting](https://github.com/golang/vscode-go/wiki/troubleshooting)
and [debugging troubleshooting](https://github.com/golang/vscode-go/wiki/debugging#troubleshooting)
[general troubleshooting](https://github.com/goplus/vscode-gop/wiki/troubleshooting)
and [debugging troubleshooting](https://github.com/goplus/vscode-gop/wiki/debugging#troubleshooting)
guides.
* [file an issue](https://github.com/golang/vscode-go/issues/new/choose) for
* [file an issue](https://github.com/goplus/vscode-gop/issues/new/choose) for
problems with the extension.
* Start a [GitHub discussion](https://github.com/golang/vscode-go/discussions)
* Start a [GitHub discussion](https://github.com/goplus/vscode-gop/discussions)
or get help on [Stack Overflow].
* Explore Go language resources on [go.dev/learn](https://go.dev/learn) and
[golang.org/help](https://golang.org/help).
* Explore Go+ language resources on [Go+ Quick Start](https://github.com/goplus/gop/blob/main/doc/docs.md) and
[Go+ tutorial](https://tutorial.goplus.org/).

If you are new to Go, [this article](https://golang.org/doc/code.html) provides
the overview on Go code organization and basic `go` commands. Watch ["Getting
started with VS Code Go"] for an explanation of how to build your first Go
application using VS Code Go.
If you are new to Go/Go+, [this article](https://github.com/goplus/gop/blob/main/doc/docs.md) provides
the overview on Go+ code organization and basic `gop` commands. Watch ["Getting
started with VS Code Go/Go+"] for an explanation of how to build your first Go/Go+
application using VS Code Go/Go+.

## Feature highlights

Expand All @@ -96,84 +90,63 @@ In addition to integrated editing features, the extension provides several
commands for working with Go files. You can access any of these by opening the
Command Palette (`Ctrl+Shift+P` on Linux/Windows and `Cmd+Shift+P` on Mac), and
then typing in the command name. See the
[full list of commands](https://github.com/golang/vscode-go/wiki/commands#detailed-list) provided by this
[full list of commands](https://github.com/goplus/vscode-gop/wiki/commands#detailed-list) provided by this
extension.

<p align=center>
<img src="docs/images/toggletestfile.gif" width=75%>
<br/><em>(Toggle Test File)</em></p>

**⚠️ Note**: the default syntax highlighting for Go files is provided by a
[TextMate rule](https://github.com/jeff-hykin/better-go-syntax) embedded in VS
Code, not by this extension.

For better syntax highlighting, we recommend enabling
We recommend enabling
[semantic highlighting](https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide)
by turning on [Gopls' `ui.semanticTokens` setting](https://github.com/golang/vscode-go/wiki/settings#uisemantictokens).
by turning on [Goxls' `ui.semanticTokens` setting](https://github.com/goplus/vscode-gop/wiki/settings#uisemantictokens).
```
"gopls": { "ui.semanticTokens": true }
"goxls": { "ui.semanticTokens": true }
```

## Setting up your workspace

The VS Code Go extension supports both `GOPATH` and Go modules modes.
The VS Code Go/Go+ extension supports both `GOPATH` and Go/Go+ modules modes.

[Go modules](https://golang.org/ref/mod) are used to manage dependencies in
recent versions of Go. Modules replace the `GOPATH`-based approach to specifying
[Go/Go+ modules](https://golang.org/ref/mod) are used to manage dependencies in
recent versions of Go/Go+. Modules replace the `GOPATH`-based approach to specifying
which source files are used in a given build, and they are the default build
mode in go1.16+. We highly recommend Go development in module mode. If you are
working on existing projects, please consider migrating to modules.

Unlike the traditional `GOPATH` mode, module mode does not require the workspace
to be located under `GOPATH` nor to use a specific structure. A module is
defined by a directory tree of Go source files with a `go.mod` file in the
tree's root directory.
defined by a directory tree of Go/Go+ source files with a `go.mod` or `gop.mod` file
in the tree's root directory.

Your project may involve one or more modules. If you are working with multiple
modules or uncommon project layouts, you will need to configure your workspace
by using [Workspace Folders]. See the
[Supported workspace layouts documentation] for more information.

## Preview version

If you'd like to get early access to new features and bug fixes, you can use the
nightly build of this extension. Learn how to install it in by reading the
[Go Nightly documentation](https://github.com/golang/vscode-go/wiki/nightly).

## Contributing

We welcome your contributions and thank you for working to improve the Go
We welcome your contributions and thank you for working to improve the Go/Go+
development experience in VS Code. If you would like to help work on the VS Code
Go extension, see our
[contribution guide](https://github.com/golang/vscode-go/wiki/contributing) to
Go/Go+ extension, see our
[contribution guide](https://github.com/goplus/vscode-gop/wiki/contributing) to
learn how to build and run the VS Code Go extension locally and contribute to
the project.

## Code of Conduct

This project follows the
[Go Community Code of Conduct](https://golang.org/conduct). If you encounter a
conduct-related issue, please mail [email protected].

## License

[MIT](LICENSE)

[Stack Overflow]: https://stackoverflow.com/questions/tagged/go+visual-studio-code
[`gopls`]: https://golang.org/s/gopls
[`go`]: https://golang.org/cmd/go
[Managing extensions in VS Code]: https://code.visualstudio.com/docs/editor/extension-gallery
[VS Code Go extension]: https://marketplace.visualstudio.com/items?itemName=golang.go
[Go installation guide]: https://golang.org/doc/install
["Getting started with VS Code Go"]: https://youtu.be/1MXIGYrMk80
[IntelliSense]: https://github.com/golang/vscode-go/wiki/features#intellisense
[Code navigation]: https://github.com/golang/vscode-go/wiki/features#code-navigation
[Code editing]: https://github.com/golang/vscode-go/wiki/features#code-editing
[diagnostics]: https://github.com/golang/vscode-go/wiki/features#diagnostics
[testing]: https://github.com/golang/vscode-go/wiki/features#run-and-test-in-the-editor
[debugging]: https://github.com/golang/vscode-go/wiki/debugging#features
[full feature breakdown]: https://github.com/golang/vscode-go/wiki/features
[workspace documentation]: https://github.com/golang/tools/blob/master/gopls/doc/workspace.md
[`Go: Install/Update Tools` command]: https://github.com/golang/vscode-go/wiki/commands#go-installupdate-tools
[Supported workspace layouts documentation]: https://github.com/golang/tools/blob/master/gopls/doc/workspace.md
[VS Code Go/Go+ extension]: https://marketplace.visualstudio.com/items?itemName=goplus.gop
[IntelliSense]: https://github.com/goplus/vscode-gop/wiki/features#intellisense
[Code navigation]: https://github.com/goplus/vscode-gop/wiki/features#code-navigation
[Code editing]: https://github.com/goplus/vscode-gop/wiki/features#code-editing
[diagnostics]: https://github.com/goplus/vscode-gop/wiki/features#diagnostics
[testing]: https://github.com/goplus/vscode-gop/wiki/features#run-and-test-in-the-editor
[debugging]: https://github.com/goplus/vscode-gop/wiki/debugging#features
[full feature breakdown]: https://github.com/goplus/vscode-gop/wiki/features
[workspace documentation]: https://github.com/goplus/tools/blob/master/gopls/doc/workspace.md
[Supported workspace layouts documentation]: https://github.com/goplus/tools/blob/master/gopls/doc/workspace.md
[Workspace Folders]: https://code.visualstudio.com/docs/editor/multi-root-workspaces

0 comments on commit d8e64b0

Please sign in to comment.