Using the Go extension for Visual Studio Code, you get features like IntelliSense, code navigation, symbol search, testing, debugging, and many more that will help you in Go development.
Enjoy millions of the latest Android apps, games, music, movies, TV, books, magazines & more. Anytime, anywhere, across your devices. However, Visual Studio 15.7+ is recommended as this enables local undo/redo support. Getting going is simple: For Visual Studio 2019. Install any edition of Visual Studio 2019. Install a supported workload. ASP.NET,.NET Core, C, Python, and/or Node.js) Visual Studio Live Share is installed by default with these workloads.
You can install the Go extension from the VS Code Marketplace.
Watch 'Getting started with VS Code Go' for an explanation of how to build your first Go application using VS Code Go.
This article describes only a subset of the features the Go extension provides. See the extension's documentation for the full, up-to-date list of supported features.
IntelliSense
IntelliSense features are provided by the Go language server, gopls, maintained by the Go team. You can configure the behavior of gopls
using the gopls
settings.
Auto completions
As you type in a Go file, you can see IntelliSense providing you with suggested completions. This even works for members in current, imported, and not yet imported packages. Just type any package name followed by .
, and you will get suggestions for the corresponding package members.
Tip: Use ⌃Space (Windows, Linux Ctrl+Space) to trigger the suggestions manually.
Hover Information
Hovering on any variable, function, or struct will give you information on that item such as documentation, signature, etc.
Signature help
When you open the (
while calling a function, a pop-up provides signature help for the function. As you keep typing the parameters, the hint (underline) moves to the next parameter.
Tip: Use ⇧⌘Space (Windows, Linux Ctrl+Shift+Space) to manually trigger the signature help when the cursor is inside the ()
in the function call.
Code navigation
Code navigation features are available in the context menu in the editor.
- Go To DefinitionF12 - Go to the source code of the type definition.
- Peek Definition⌥F12 (Windows Alt+F12, Linux Ctrl+Shift+F10) - Bring up a Peek window with the type definition.
- Go to References⇧F12 (Windows, Linux Shift+F12) - Show all references for the type.
- Show Call Hierarchy⇧⌥H (Windows, Linux Shift+Alt+H) - Show all calls from or to a function.
You can navigate via symbol search using the Go to Symbol commands from the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)).
- Go to Symbol in File - ⇧⌘O (Windows, Linux Ctrl+Shift+O)
- Go to Symbol in Workspace - ⌘T (Windows, Linux Ctrl+T)
You can also navigate back and forth between a Go file and its test implementation using the Go: Toggle Test File command.
Build, test, and diagnose
The Go language server (gopls
) detects build and vet errors found on the workspace. The errors and warnings from running any/all of the above will be shown red/green squiggly lines in the editor. These diagnostics also show up in the Problems panel (View > Problems).
You can add additional lint checks using the go.lintOnSave
setting and configuring your choice of linting tool (staticcheck
, golangci-lint
, or revive
) using the go.lintTool
setting.
You can configure the extension to run tests and compute test coverage using:
go.testOnSave
go.coverOnSave
go.testFlags
Formatting
You can format your Go file using ⇧⌥F (Windows Shift+Alt+F, Linux Ctrl+Shift+I) or by running the Format Document command from the Command Palette or the context menu in the editor.
By default, formatting is run when you save your Go file. You can disable this behavior by setting editor.formatOnSave
to false
for the [go]
language identifier. You can change this using your JSON setting files.
When you have multiple formatters activated for Go files, you can select the Go extension as the default formatter.
Formatting is provided by gopls
. If you want gofumpt
-style formatting, you can configure gopls
to use gofumpt
.
Test
There are many test-related commands that you can explore by typing Go: test in the Command Palette.
The first three above can be used to generate test skeletons for the functions in the current package, file, or at the cursor using gotests
. The last few can be used to run tests in the current package, file, or at the cursor using go test
. There is also a command for getting test coverage.
Import packages
Run the command Go: Add Import to get a list of packages that can be imported to your Go file. Choose one and it will get added in the import block of your Go file.
Rename symbols
You can rename symbols using F2 or by running the Rename Symbol command in the context menu in the editor.
Debugging
The Go extension lets you debug Go code as well. You will need to install the Delve debugger manually as a prerequisite. Read Debug Go programs in VS Code for setup steps, information on remote debugging and a troubleshooting guide.
Next steps
This has been a brief overview showing the Go extension features within VS Code. For more information, see the details provided in the Go extension README.
Visual Studio Vlive App Free
To stay up to date on the latest features/bug fixes for the Go extension, see the CHANGELOG.
If you have any issues or feature requests, feel free to log them in the Go extension vscode-go repo.
If you'd like to learn more about VS Code, try these topics:
- Basic Editing - A quick introduction to the basics of the VS Code editor.
- Install an Extension - Learn about other extensions are available in the Marketplace.
- Code Navigation - Move quickly through your source code.
[I'm sorry but I'm super busy now. If you want to be a maintainer of the project, please feel free to contact me! You've to be passionate about programming]
Live Server loves 💘 your multi-root workspace
Live Server for server side pages like PHP. Check Here
[For 'command not found error' #78]
Visual Studio Vlive App
Launch a local development server with live reload feature for static & dynamic pages.
Shortcuts to Start/Stop Server
[NOTE: In case if you don't have any .html
or .htm
file in your workspace then you have to follow method no 4 & 5 to start server.]
Open a project and click to
Go Live
from the status bar to turn the server on/off.Right click on a
HTML
file from Explorer Window and click onOpen with Live Server
..Open a HTML file and right-click on the editor and click on
Open with Live Server
.Hit
(alt+L, alt+O)
to Open the Server and(alt+L, alt+C)
to Stop the server (You can change the shortcut form keybinding). [On MAC,cmd+L, cmd+O
andcmd+L, cmd+C
]Open the Command Pallete by pressing
F1
orctrl+shift+P
and typeLive Server: Open With Live Server
to start a server or typeLive Server: Stop Live Server
to stop a server.
Features
- A Quick Development Live Server with live browser reload.
- Start or Stop server by a single click from status bar.
- Open a HTML file to browser from Explorer menu.[Quick Gif Demo].
- Support for excluding files for change detection.
- Hot Key control.
- Customizable Port Number, Server Root, default browser.
- Support for any browser (Eg: Firefox Nightly) using advance Command Line.
- Support for Chrome Debugging Attachment (More Info). [Quick Gif Demo].
- Remote Connect through WLAN (E.g.: Connect with mobile) [Need Help? See FAQ Section]
- Use preferable host name (localhost or 127.0.0.1).
- Customizable Supporting Tag for Live Reload feature. (Default is
Body
orhead
) - SVG Support
https
Support.- Support for proxy.
- CORS Enabled
- Multi-root workspace supported.
- Support for any file even dynamic pages through Live Server Web Extension.
Installation
Open VSCode and type ctrl+P
, type ext install ritwickdey.liveserver
.
Settings
All settings are now listed here Settings Docs.
FAQs
All FAQs are now listed here FAQ Docs
What's new ?
Version 5.6.1 (17.04.19)
- [NEW] Fixing
Extension host terminated unexpectedly
*[#431
- [NEW] Fixing
Version 5.6.0 (17.04.19)
- [NEW] Intregation of
Browser Preview
withLive Server
[#352 - Thanks to Kenneth Auchenberg] - [NEW] Fallback to random port If given port is busy. [#330 - Thanks to Ali Almohaya ]
- [FIXES] Moved to
vscode-chokidar
lib for #285. - Doc Fixes [#388 - Thanks to Ted Silbernagel]
- [NEW] Intregation of
Version 5.5.1 (12.02.19)
- [Fixes] Fixed
Extension host terminated unexpectedly
for MacOS. [#285]
- [Fixes] Fixed
Version 5.5.0 (12.02.19)
- [Fixes] Fixed
ignoreFiles
settings [#255] - Attempt to fix
high cpu load
[#278]
- [Fixes] Fixed
Changelog
To check full changelog click here.
Special Thanks To Maintainers
A special thanks to Max Schmitt, Joydip Roy & Ayo Adesugba for contributing their valueable time on this project.
LICENSE
Visual Studio Vlive App Download
This extension is licensed under the MIT License