forked from felixfbecker/php-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michal Niewrzal
committed
Sep 12, 2016
1 parent
4d5052b
commit 5d85e4d
Showing
6 changed files
with
176 additions
and
11 deletions.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
namespace LanguageServer\Server\Completion; | ||
|
||
class KeywordData | ||
{ | ||
|
||
private $label; | ||
|
||
private $insertText; | ||
|
||
public function __construct(string $label, string $insertText = null) | ||
{ | ||
$this->label = $label; | ||
if ($insertText == null) { | ||
$this->insertText = $label; | ||
} else { | ||
$this->insertText = $insertText; | ||
} | ||
} | ||
|
||
public function getLabel() | ||
{ | ||
return $this->label; | ||
} | ||
|
||
public function getInsertText() | ||
{ | ||
return $this->insertText; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?php | ||
namespace LanguageServer\Server\Completion; | ||
|
||
class PHPKeywords | ||
{ | ||
|
||
/** | ||
* | ||
* @var KeywordData[] | ||
*/ | ||
private $keywords; | ||
|
||
public function __construct() | ||
{ | ||
$this->keywords = [ | ||
new KeywordData("abstract"), | ||
new KeywordData("and"), | ||
new KeywordData("array"), | ||
new KeywordData("as"), | ||
new KeywordData("break"), | ||
new KeywordData("callable"), | ||
new KeywordData("case"), | ||
new KeywordData("catch"), | ||
new KeywordData("class"), | ||
new KeywordData("clone"), | ||
new KeywordData("const"), | ||
new KeywordData("continue"), | ||
new KeywordData("declare"), | ||
new KeywordData("default"), | ||
new KeywordData("die"), | ||
new KeywordData("do"), | ||
new KeywordData("echo"), | ||
new KeywordData("else"), | ||
new KeywordData("elseif"), | ||
new KeywordData("empty"), | ||
new KeywordData("enddeclare"), | ||
new KeywordData("endfor"), | ||
new KeywordData("endforeach"), | ||
new KeywordData("endif"), | ||
new KeywordData("endswitch"), | ||
new KeywordData("endwhile"), | ||
new KeywordData("eval"), | ||
new KeywordData("exit"), | ||
new KeywordData("extends"), | ||
new KeywordData("false"), | ||
new KeywordData("final"), | ||
new KeywordData("finally"), | ||
new KeywordData("for", "for ()"), | ||
new KeywordData("foreach", "foreach ()"), | ||
new KeywordData("function"), | ||
new KeywordData("global"), | ||
new KeywordData("goto"), | ||
new KeywordData("if", "if ()"), | ||
new KeywordData("implements"), | ||
new KeywordData("include"), | ||
new KeywordData("include_once"), | ||
new KeywordData("instanceof"), | ||
new KeywordData("insteadof"), | ||
new KeywordData("interface"), | ||
new KeywordData("isset"), | ||
new KeywordData("list"), | ||
new KeywordData("namespace"), | ||
new KeywordData("new"), | ||
new KeywordData("null"), | ||
new KeywordData("or"), | ||
new KeywordData("parent"), | ||
new KeywordData("print"), | ||
new KeywordData("private"), | ||
new KeywordData("protected"), | ||
new KeywordData("public"), | ||
new KeywordData("require"), | ||
new KeywordData("require_once"), | ||
new KeywordData("return"), | ||
new KeywordData("self"), | ||
new KeywordData("static"), | ||
new KeywordData("switch", "switch ()"), | ||
new KeywordData("throw"), | ||
new KeywordData("trait"), | ||
new KeywordData("true"), | ||
new KeywordData("try"), | ||
new KeywordData("unset"), | ||
new KeywordData("use"), | ||
new KeywordData("var"), | ||
new KeywordData("while"), | ||
new KeywordData("xor"), | ||
new KeywordData("yield") | ||
]; | ||
} | ||
|
||
/** | ||
* List of supported PHP keywords | ||
* | ||
* @return KeywordData[] | ||
*/ | ||
public function getKeywords() | ||
{ | ||
return $this->keywords; | ||
} | ||
} |
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