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

Completion #165

Merged
merged 27 commits into from
Nov 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
44d26ba
Add support for method/property completion
felixfbecker Nov 19, 2016
5125fa7
Move completion fixtures into directory
felixfbecker Nov 19, 2016
59670af
Add support for variable suggestions
felixfbecker Nov 20, 2016
49b526d
Allow getTypeFromNode() to take Variable nodes
felixfbecker Nov 20, 2016
4365fac
Use property and constant values
felixfbecker Nov 20, 2016
e6a4103
Fix using @var tag for variables
felixfbecker Nov 21, 2016
06636de
Improve completion
felixfbecker Nov 22, 2016
151dea6
Make FQNs more distinct
felixfbecker Nov 22, 2016
51de0b5
Add tests for static access
felixfbecker Nov 22, 2016
d66cc76
Properly filter completion on empty property
felixfbecker Nov 22, 2016
8f30819
Fix existing tests
felixfbecker Nov 22, 2016
635e6b3
Add support for static access without prefix
felixfbecker Nov 22, 2016
e376ef1
Fix testFullyQualifiedClass
felixfbecker Nov 22, 2016
c4323c6
Add missing fixtures
felixfbecker Nov 22, 2016
e4e4e3f
Correct file number in init test
felixfbecker Nov 22, 2016
6adb3f4
Only insert backslash if not typed yet
felixfbecker Nov 22, 2016
f6a7ce1
Completion for keywords and bug fixes
felixfbecker Nov 24, 2016
6fb2181
Correct variable insertion
felixfbecker Nov 24, 2016
5f085a3
Support completion for namespaces
felixfbecker Nov 24, 2016
38383fc
Use CompletionList
felixfbecker Nov 28, 2016
04a517c
Always set isIncomplete to true
felixfbecker Nov 29, 2016
128f1be
Update PHPCodeSniffer
felixfbecker Nov 29, 2016
c91a573
Remove unused method
felixfbecker Nov 29, 2016
03faea5
And the call
felixfbecker Nov 29, 2016
471d470
Merge branch 'master' into completion
felixfbecker Nov 30, 2016
cc8365d
Handle case where FQN could not be resolved
felixfbecker Nov 30, 2016
90297f2
Merge branch 'master' into completion
felixfbecker Nov 30, 2016
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 .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ indent_size = 2
[composer.json]
indent_size = 4

[*.md]
[{*.md,fixtures/**}]
trim_trailing_whitespace = false
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"bin": ["bin/php-language-server.php"],
"require": {
"php": ">=7.0",
"nikic/php-parser": "^3.0.0beta2",
"nikic/php-parser": "dev-master#e52ffc4447e034514339a03b450aab9cd625e37c",
"phpdocumentor/reflection-docblock": "^3.0",
"sabre/event": "^5.0",
"felixfbecker/advanced-json-rpc": "^2.0",
"squizlabs/php_codesniffer" : "3.0.0RC1",
"squizlabs/php_codesniffer" : "3.0.x-dev#e8acf8e029301b0e3ea7e7c9eef0aee914db78bf",
"netresearch/jsonmapper": "^1.0",
"webmozart/path-util": "^2.3",
"webmozart/glob": "^4.1",
Expand Down
3 changes: 3 additions & 0 deletions fixtures/completion/class_const_with_prefix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

TestClass::TE
9 changes: 9 additions & 0 deletions fixtures/completion/fully_qualified_class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Whatever;

use TestNamespace\{TestClass, TestInterface};

\TestC

class OtherClass {}
Empty file added fixtures/completion/html.php
Empty file.
1 change: 1 addition & 0 deletions fixtures/completion/html_with_prefix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<
3 changes: 3 additions & 0 deletions fixtures/completion/keywords.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

cl
5 changes: 5 additions & 0 deletions fixtures/completion/namespace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

namespace SomeNamespace {}

SomeNa
4 changes: 4 additions & 0 deletions fixtures/completion/property.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

$obj = new TestClass;
$obj->
4 changes: 4 additions & 0 deletions fixtures/completion/property_with_prefix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

$obj = new TestClass;
$obj->t
3 changes: 3 additions & 0 deletions fixtures/completion/static.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

TestClass::
3 changes: 3 additions & 0 deletions fixtures/completion/static_method_with_prefix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

TestClass::st
3 changes: 3 additions & 0 deletions fixtures/completion/static_property_with_prefix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

TestClass::$st
9 changes: 9 additions & 0 deletions fixtures/completion/used_class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Whatever;

use TestNamespace\{TestClass, TestInterface};

TestC

class OtherClass {}
7 changes: 7 additions & 0 deletions fixtures/completion/used_new.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Whatever;

use TestNamespace\{TestClass, TestInterface};

$obj = new
10 changes: 10 additions & 0 deletions fixtures/completion/variable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

/**
* @param string|null $param A parameter
*/
function test(string $param = null)
{
$var = 123;
$
}
10 changes: 10 additions & 0 deletions fixtures/completion/variable_with_prefix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

/**
* @param string|null $param A parameter
*/
function test(string $param = null)
{
$var = 123;
$p
}
Loading