This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 646
Show completion for newly created package. #1191
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
6d098d6
Refactor getNonVendorPackages to getPackages and respect the 1.9 vers…
uudashr ab7465f
Inline the function test arguments building
uudashr a500a42
Test all packages for Go 1.9 use "./...", the lower still remain usin…
uudashr ddc4d02
Merge remote-tracking branch 'upstream/master' into faster-go-list-all
uudashr 730874a
Fix autocomplete un-imported packages: show newly added package
uudashr e265725
Use spawn to avoid maxBuffer exceeded
uudashr 75c19a3
Support large output by using spawn
uudashr 9dadbca
Completions shows result instantly, no longer need to pre-call to goL…
uudashr 1a4c748
Fix lint warning
uudashr f7a75d0
Expect proper gopkgs binary
uudashr c7e0f4f
Change the gopkgs package
uudashr 9583a0b
Use spawn instead of execFile to support large output
uudashr 6ab865b
Use gopkgs from http://github.com/uudashr/gopkgs
uudashr 41b1fa5
Merge branch 'master' into faster-go-list-all
uudashr 40b2efd
Update the go tools in .travis.yml
uudashr 95638f7
Fix the gopkgs missing tools detection
uudashr 805ac03
Cache the gopkgs tool invocation result
uudashr 6febef2
Refresh gopkgs cache
uudashr a2a1334
Drop the cache for gopkgs since it already fast enough
uudashr 93379bc
Adapt with the changes of gopkgs by using -format
uudashr fe23338
trigger travis build: use array desctructuring assignment
uudashr c60374a
Install libsecret-1-0
uudashr 780b744
Fix the travis script
uudashr d36aaeb
Fix the travis script, install libsecret-1-0
uudashr 085d48f
Use sudo apt-get install
uudashr e1faec1
apt-get should buy some time
uudashr 2c273e6
Add go 1.9.x to the .travis.yml
uudashr 7d91dd8
Prompt for missing tools when "gopkgs" not found
uudashr 6533a93
Update the comment of goListAll
uudashr 8fb142e
Revert back the function name "goPackages" to "goNonVendorPackages"
uudashr ffcb0ef
Rename "goListAll" to "getAllPackages"
uudashr 819c3db
Use existing getImportablePackages
uudashr 636efa5
Missing tool prompt will be handled by function caller
uudashr f57805c
Remove unused import
uudashr e6a39ae
Handle missing tool when browsing package
uudashr a62c95c
Use cache if still used for less than 5s
uudashr e6f9454
Ignore the stderr to avoid stuck
uudashr e2ef816
Fix lint warning
uudashr 2119ec1
Prompt to update gopkgs if using old pkgs
ramya-rao-a 18cbcf8
Cleanup
ramya-rao-a 2a898f0
Fix tests
ramya-rao-a 7a5c9db
Sort pkgs before testing
ramya-rao-a File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the
-format
option I am guessing thatgopkgs
is a bit slower than when you made the comparison betweengo list all
andgopkgs
in the description of this PR.What are your current numbers?
Every new word typed triggers completion. So you can imagine that
gopkgs
will be run for every word typed.Some users have a whole lot of packages that
go list all
took over 10 seconds to finish. How doesgopkgs -format
fare?I still believe we should use cache and have the cache updated at a regular interval instead of running
gopkgs
for every word.What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gpkgs -format
faster thango list all
For 3382 packages packages:
6.36s vs 0.5s, big difference.
This gopkgs using fastwalk, faster than golang standard
fs.Walk()
.Not every word typed, it only invoked on only when completion triggered. Typing "strings" 7 words typed will only cost single
gopkgs
invocation. So this is quite cheap and fast enough.Cache will be much better of course.
If we cache for 10 or 20 second, user probably can create new file in new folder with new package faster than cache expiry time. So new package will not provided by completion. The workaround crossed in my mind is we need to some kind of file system watcher and check if there is changed file, then invalidate the cache or run
gopkgs
immediately to refresh the cache, etc. My suggestion is we can do this cache things on another PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed my mind... let's try to use 5s cache expiry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completion is triggered for every word typed. I think you misunderstood my statement as every "letter" typed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh... yup..