Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete speedup vol. 2 #599

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2d91ee8
speedup autocomplete with ReadableIndex::getDefinitionsForNamespace
nicolasmure Aug 6, 2017
b7c7128
update tests
nicolasmure Aug 6, 2017
6d725a2
speedup static access autocomplete
nicolasmure Aug 6, 2017
18f2f4c
cleanup
nicolasmure Aug 6, 2017
17602aa
globalDefinitions cache to speedup autocomplete
nicolasmure Aug 6, 2017
6d30035
also remove empty namespace index
nicolasmure Aug 8, 2017
ca0caf1
store definitions under the namespaceDefinitions cache key directly
nicolasmure Aug 9, 2017
8768b69
use Generators to get definitions without wasting memory
nicolasmure Aug 9, 2017
8801edb
also yield URIs to save memory
nicolasmure Aug 9, 2017
6a41a7f
add example of indexed definitions
nicolasmure Aug 10, 2017
6a36828
avoid useless array
nicolasmure Aug 10, 2017
e34d8e1
use of null coalescing operator
nicolasmure Aug 10, 2017
14f840b
use correct terminology
nicolasmure Oct 5, 2017
e9fd572
consider the merge of #511
nicolasmure Nov 13, 2017
d1f85f1
use tree representation index
nicolasmure Nov 13, 2017
188a5df
fix definitions storage collision (member / non member)
nicolasmure Nov 14, 2017
cacde1e
use a single array to store definitions
nicolasmure Nov 14, 2017
e162d94
cleanup
nicolasmure Nov 14, 2017
7437d30
Fix formatting
felixfbecker Nov 15, 2017
b118c77
Correct some docblocks
felixfbecker Nov 15, 2017
b3f30f3
cache is backward compatible
nicolasmure Nov 15, 2017
7511e25
Merge branch 'master' into feature/autocomplete-speedup
felixfbecker Nov 15, 2017
fcdf791
use string concatenation instead of sprintf
nicolasmure Nov 16, 2017
3bda390
Merge branch 'master' into feature/autocomplete-speedup
felixfbecker Nov 19, 2017
b03950c
Cleanup
felixfbecker Nov 18, 2017
97ec127
fix definition removal
nicolasmure Nov 19, 2017
48bbbb5
differenciate member and non member definitions
nicolasmure Nov 19, 2017
67dd980
Merge branch 'master' into feature/autocomplete-speedup
felixfbecker Nov 19, 2017
91ca99a
Revert "differenciate member and non member definitions"
felixfbecker Nov 23, 2017
fa67f84
perf: get direct children
felixfbecker Nov 23, 2017
81c40f2
chore: add completion benchmark
felixfbecker Nov 23, 2017
8617948
Merge remote-tracking branch 'origin/master' into autocomplet-speedup
Declspeck Feb 3, 2018
439cebe
fix(tests): fix require in parsing.php benchmark after file move
Declspeck Feb 3, 2018
e589f9e
refactor(completion): make completion of global symbols use Index mor…
Declspeck Feb 3, 2018
6858bd3
tests(completion): add completion of new| ParameterBag to completion …
Declspeck Feb 3, 2018
d6b4e79
feat(completion): complete for used namespaces
Declspeck Feb 9, 2018
98ac9ff
Merge branch 'master' into autocomplet-speedup
Declspeck Feb 9, 2018
d1933b8
refactor(completion): rewrite global name completion with generators
Declspeck Feb 15, 2018
0bc5b81
fix(completion): Return type hint
Declspeck Feb 15, 2018
334683a
Merge branch 'master' into autocomplet-speedup
Declspeck Mar 1, 2018
5921fd3
Address feedback
Declspeck Mar 10, 2018
3d5f0ca
Merge branch 'master' into autocomplet-speedup
Declspeck Mar 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CompletionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function provideCompletion(
foreach ($list->items as $item) {
// Remove ()
if (is_string($item->insertText) && substr($item->insertText, strlen($item->insertText) - 2) === '()') {
Copy link
Contributor

@jens1o jens1o Mar 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line can be simplified too
if (is_string($item->insertText) && substr($item->insertText, -2) === '()') {

$item->insertText = substr($item->insertText, 0, strlen($item->insertText) - 2);
$item->insertText = substr($item->insertText, 0, -2);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Index/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function unserialize($serialized)
public function serialize()
{
return serialize([
'definitions' => iterator_to_array($this->getDefinitions(), true),
'definitions' => iterator_to_array($this->getDefinitions()),
'references' => $this->references,
'complete' => $this->complete,
'staticComplete' => $this->staticComplete
Expand Down