Граф коммитов

88 Коммитов

Автор SHA1 Сообщение Дата
Ramya Achutha Rao d589d3978c 0.6.79-beta.1 2018-04-08 17:36:23 -07:00
Ramya Achutha Rao be30dfc597 Allow non string values in settings for envvars Fixes #1608 2018-04-08 13:40:41 -07:00
Frederik Ring c0a489f5c5 When gotoSymbol.includeGoroot is set, also show symbols from GOROOT (#1604)
* 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
2018-04-04 17:03:22 -07:00
Ramya Achutha Rao 17d902b300 Remove flaky tests 2018-03-19 11:25:48 -07:00
Luis GG 64104a19af Make linter tests more lax (#1558) 2018-03-05 20:30:48 -08:00
Ramya Achutha Rao 91d73c8626 Add note on not able to run tests without GOPATH 2018-03-05 18:41:34 -08:00
Ramya Achutha Rao 71d675af09 Removing test on goLint as the ones on goCheck already cover it 2018-03-03 20:48:46 -08:00
Ramya Achutha Rao b926dd3f66 Fix flaky fill struct test 2018-02-26 22:25:39 -08:00
Luis GG 6bfd4969cb Fix broken tests (#1538)
* Fix tests

* Remove unnecessary coalesce

* Change assert messages

* Review changes

* Restore source path

* Revert source path
2018-02-26 22:18:23 -08:00
Nuruddin Ashr d5e35fb049 Fix the goVersion to properly parse ver '1.10' (#1523)
* 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
2018-02-19 22:55:39 -08:00
Robin Bartholdson 4884626bc3 add fillstruct tool (#1506)
* add fillstruct tool

* Refactoring

* add tests and remove config

* Fix tests

* Use best guess of start line when selection spans multiple lines

* Remove unused code

* Fix linting errors
2018-02-18 19:27:02 -08:00
Ben Wood 3790d5f08a Proposal to implement collapsing (#500)
* 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
2018-01-07 22:41:21 -08:00
Ramya Achutha Rao 3f123c909b Simplifying tests 2017-12-18 22:26:59 -08:00
Ramya Rao a74c6ca5e9
Support multiple buildtags (#1359)
* Support multiple build tags #1355

* fix tests

* verbose test

* fix failing test
2017-11-21 20:11:08 -08:00
Ramya Achutha Rao a0a8a9d6ff Use CancellationToken to cancell symbol and rename requests 2017-11-10 14:04:33 -08:00
Ramya Achutha Rao b03d33be14 Fix failing test on tip 2017-11-09 17:09:18 -08:00
Andrew Nee 3c85b48263 Added commands "Go Lint Package" and "Go Lint Workspace" (#1258)
* 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
2017-11-08 16:29:16 -08:00
Frederik Ring f71af13762 add playground command (#1270)
* 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
2017-11-06 16:40:52 -08:00
Ramya Achutha Rao a7fab8aa3a Fix linting issues with Go tip 2017-11-06 14:05:46 -08:00
Andrew Nee 4d3f99f032 Fixed tests "Error checking" and "Gometalinter error checking" (#1255) 2017-09-30 19:08:06 -07:00
Hugo 2e2e3cda2b Add command to fetch import on current line (#1222)
* 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
2017-09-27 19:05:05 -07:00
Ramya Rao 192cd476d4 Multi root support (#1221)
* 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
2017-09-18 16:52:25 -07:00
Nuruddin Ashr 9618aa0406 Ensure completion to respond faster (#1209)
* 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
2017-09-13 22:44:55 -07:00
Nuruddin Ashr e5aa763567 Show completion for newly created package. (#1191)
* 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
2017-09-12 00:01:48 -07:00
Ramya Achutha Rao c58d58333f Move golist promise up to give travis more time 2017-07-25 10:31:11 -07:00
Ramya Rao 96026f5b9b Use go list all to get pkgname to use in completions (#1092)
* Use go list all to get pkgname to use in completions Fixes #647

* Check for version being null

* Wait for golist before testing
2017-07-16 21:39:32 -06:00
Ramya Achutha Rao 5d4611d70d Use go tool vet to use vetflags Fixes #1073 2017-07-09 19:14:51 -07:00
Pavel Chechetin 9496a03350 Fix #609 'Test Env Variables are passed to Tests' (#1050) 2017-06-24 17:30:38 -07:00
Ramya Rao a5700fa3f7 Fixes #922 Pass file contents to go-outline (#929)
* Fixes #922 Pass file contents to go-outline

* Use fork of go-outline

* Fixing broken test

* If test files are dirty, dont run tests
2017-04-17 15:54:07 -07:00
Ramya Rao a624a31bb0 dont run slow linters (#914)
* dont run slow linters

* remove commented checks
2017-04-03 15:46:26 -07:00
Ramya Rao d2489dc7d3 Option to Ignore folders while workspace symbol search (#795)
* Option to Ignore folders while workspace symbol search

* Use the right flag
2017-03-28 18:07:48 -07:00
Ramya Rao 829791f582 Fix failing metalinner tests (#867) 2017-03-16 11:52:49 -07:00
Ramya Achutha Rao 99056a6ad3 update tests for new linters 2017-03-15 15:12:31 -07:00
Ramya Rao ffacf14d32 No more reload when choice of tool is changed (#749) 2017-01-26 20:39:53 -08:00
Ramya Rao 2a93232b6c Use settings for separate location for installing Go tools (#737) 2017-01-21 15:05:52 -08:00
Matt Aimonetti 61968447fb compile non-main packages using -i for performance reasons (#718) 2017-01-19 00:37:11 -08:00
Ramya Rao 148c744c3a Do not get definition info if not identifier (#711) 2017-01-05 14:43:04 -08:00
Ramya Achutha Rao e73900fe45 Use TextMate snippet syntax supported in latest VSCode API 2017-01-05 10:55:00 -08:00
Ramya Achutha Rao 7ea8bb1f26 Fixing flaky unit tests 2016-12-29 16:49:54 -08:00
Cedric Lamoriniere 053dd86a64 Fix "gotests" when generates test for current function for type methods (#657)
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.
2016-11-28 17:37:49 -08:00
Ramya Achutha Rao 73dbfc43ac Fix signature for methods extending structs 2016-11-17 23:29:58 -08:00
Ramya Achutha Rao d0c6671a18 fix tests 2016-11-17 10:02:21 -08:00
Ramya Achutha Rao aa102a8daa Adding tests for definition provider 2016-11-16 18:25:05 -08:00
Ramya Achutha Rao 0020119fec Support both godef and gogetdoc 2016-11-16 17:38:15 -08:00
lixiaohui c5268dc752 Merge branch 'master' of https://github.com/Microsoft/vscode-go 2016-11-10 11:52:18 +08:00
Ramya Achutha Rao 6a5eb64852 Commenting failing test 2016-11-09 11:46:29 -08:00
Ramya Rao 6b5449fe4b Dont allow import on vendored pkg from another project (#605) 2016-11-09 11:44:54 -08:00
lixiaohui 58cc5dea6e vendor test case 2016-11-09 00:05:26 +08:00
lixiaohui 59463336f8 test cases 2016-11-08 21:06:15 +08:00
Ramya Rao c35b419585 Fix for when Go is used from source without release tag (#549)
* Fix for when Go is used from source without release tag

* vendoring can be disabled in 1.6
2016-10-26 00:54:18 -05:00