* When gotoSymbol.includeGoroot is set, also show symbols from GOROOT
Setting the option to true enables the user to include the standard
library located at GOROOT to be included in the results shown on
"Go To Symbol" - resolves#1567
* Add proper types to empty arrays
* Correctly lookup GOROOT by calling `go env`
* tests
* Move logic for retrieving symbols from goroot a level down
* Fix the goVersion to properly parse ver '1.10'
* Add go version 1.10 to travis config
* Define 1.10 as string on travis
* Exclude the 1.10 on linux
* Add g++4.9 for linux os
* Use default CC and CXX
* Fix the lint test
* Fix the lint test to compatible both golang 1.10 and previous version
* Fix lint test
* Try to make fill struct test result consistent
* With this commit:
1. Add new setting "go.blockImportsOnly"
2. Add parsing of package name for single import lines
3. When the user adds an import manually and there is already one or more single imports, collapse it all into a block if go.blockImportsOnly is true.
* WTC:
1. Fix linter issues
* Remove unused import
* With this commit:
1. Back out package name parsing
2. Remove setting from package.json (always use block imports)
3. Switch up how block import is created to preserve comments and special imports
* Post rebase cleanup
* Add tests
* Added commands "Go Lint Package" and "Go Lint Workspace"
* Fixed request changes
- Cleared goMain.ts, moved logic to lintCurrentPackage and lintWorkspace in goLint.ts
- Moved function handleDiagnosticErrors from goMain.ts to util.ts
- Fixed tests
* Fix on save diagnostics
* Lint cmd shouldnt clear build errors
* Removing the failing test as there is no workspace
* add playground command
enables the user to upload the current file or selection to the
go playground using package goplay - solves #1211
* separate tool execution from command logic, add test
* add tests for error case
* ensure better separation between tool calling and extension logic
* handle no active editor, clear output channel, check for tool availability by stat-ing binary location
* move all logic into function body
* Add tests back
* Fixing linting error
* Add command to fetch import on current line
This will allow users to easily fetch a dependency without having to
take their attention away from the code they're editing.
Microsoft/vscode-go#1189
* Rename goGetImports to goGetImport
The plugin only fetches one import so having the file name plural is
misleading to anybody reading the code.
Microsoft/vscode-go#1189
* Refactor getImportPath
This consolidates the functionality found in two commands into one place
so that if it ever needs to be changed or removed it can be done more
easily.
* Fix lint issues
* Make command title and description more intuitive
Microsoft/vscode-go#1189
* Make name `goGetPackage` consistent
Anybody else who comes along later and reads this is gonna have an
easier time if they only have to keep one name in their head vs. having
to keep two (goGetImport and goGetPackage).
Microsoft/vscode-go#1189
* Exit early if there's no import path to get
If there's no import path to pass to `go get` then there's no point in
spinning up a child process and waiting for it to finish to error out.
This also fixes a bug in `getImportPath` that would cause it to return
invalid input paths for things like comments and function definitions.
Microsoft/vscode-go#1189
* Fallback to selectedText for browsePackage feature
* Offload check for package to go get
`go get` won't download a package if it's already in `$GOPATH/src`.
There's no point in checking for the package to exist and then
downloading with `-u` because `go get -u` and `go get` are effectively
the same when a package hasn't been downloaded yet.
Microsoft/vscode-go#1189
* Use output pane for go get output
`go get -v` gives users more information on what's going on with the
command. This way a user can tell if the package was even downloaded,
because by default `go get` won't output anything.
`go get -v` will output nothing if the package isn't downloaded because
it already exists. To get around this, an information message is shown
saying that the package wasn't downloaded. This keeps the user informed
because they will be expecting feedback from the command.
In the event of an error (like if there's no internet connection), the
error gets shown to the output pane so the user knows what happened.
Microsoft/vscode-go#1189
* Cleanup
* Multi-root first draft
* Use toolsgopath of one of the folders for the rest in multi root
* Case of no workspace open
* Use language server only if all folders are using same GOPATH
* Update vsix
* Msg for when langserver is not applicable in multi root
* Missing tools support in multi root
* Convert remaining config calls to use resource uri
* Case when file is open but folder isnt
* Dont fallback to rootpath in multi root when resolving path
* Case when no workpsace is open
* Ensure not more than 1sec delivery on completion
* Lint warning: add whitespace
* Speed up listPackages test
* Do not wait importable packages ready for more than 1sec
* Remove unused variable
* Refactor getNonVendorPackages to getPackages and respect the 1.9 version behavior
* Inline the function test arguments building
* Test all packages for Go 1.9 use "./...", the lower still remain using the same way
* Fix autocomplete un-imported packages: show newly added package
* Use spawn to avoid maxBuffer exceeded
* Support large output by using spawn
* Completions shows result instantly, no longer need to pre-call to goListAll()
* Fix lint warning
* Expect proper gopkgs binary
* Change the gopkgs package
* Use spawn instead of execFile to support large output
* Use gopkgs from http://github.com/uudashr/gopkgs
* Update the go tools in .travis.yml
* Fix the gopkgs missing tools detection
* Cache the gopkgs tool invocation result
* Refresh gopkgs cache
* Drop the cache for gopkgs since it already fast enough
* Adapt with the changes of gopkgs by using -format
* trigger travis build: use array desctructuring assignment
* Install libsecret-1-0
* Fix the travis script
* Fix the travis script, install libsecret-1-0
* Use sudo apt-get install
* apt-get should buy some time
* Add go 1.9.x to the .travis.yml
* Prompt for missing tools when "gopkgs" not found
* Update the comment of goListAll
* Revert back the function name "goPackages" to "goNonVendorPackages"
* Rename "goListAll" to "getAllPackages"
* Use existing getImportablePackages
* Missing tool prompt will be handled by function caller
* Remove unused import
* Handle missing tool when browsing package
* Use cache if still used for less than 5s
* Ignore the stderr to avoid stuck
* Fix lint warning
* Prompt to update gopkgs if using old pkgs
* Cleanup
* Fix tests
* Sort pkgs before testing
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.
Fixes: #656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.