Improve handling of abstract classes (#391)
parent
7f427a1215
commit
42d0c7b714
|
@ -114,7 +114,7 @@ class DefinitionResolver
|
||||||
// For everything else, get the doc block summary corresponding to the current node.
|
// For everything else, get the doc block summary corresponding to the current node.
|
||||||
$docBlock = $this->getDocBlock($node);
|
$docBlock = $this->getDocBlock($node);
|
||||||
if ($docBlock !== null) {
|
if ($docBlock !== null) {
|
||||||
// check wether we have a description, when true, add a new paragraph
|
// check whether we have a description, when true, add a new paragraph
|
||||||
// with the description
|
// with the description
|
||||||
$description = $docBlock->getDescription()->render();
|
$description = $docBlock->getDescription()->render();
|
||||||
|
|
||||||
|
@ -174,7 +174,11 @@ class DefinitionResolver
|
||||||
$def->fqn = $fqn;
|
$def->fqn = $fqn;
|
||||||
|
|
||||||
// Determines whether the suggestion will show after "new"
|
// Determines whether the suggestion will show after "new"
|
||||||
$def->canBeInstantiated = $node instanceof Node\Statement\ClassDeclaration;
|
$def->canBeInstantiated = (
|
||||||
|
$node instanceof Node\Statement\ClassDeclaration &&
|
||||||
|
// check whether it is not an abstract class
|
||||||
|
($node->abstractOrFinalModifier === null || $node->abstractOrFinalModifier->kind !== PhpParser\TokenKind::AbstractKeyword)
|
||||||
|
);
|
||||||
|
|
||||||
// Interfaces, classes, traits, namespaces, functions, and global const elements
|
// Interfaces, classes, traits, namespaces, functions, and global const elements
|
||||||
$def->isGlobal = (
|
$def->isGlobal = (
|
||||||
|
|
|
@ -106,7 +106,7 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
|
||||||
protected $definitionResolver;
|
protected $definitionResolver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param PotocolReader $reader
|
* @param ProtocolReader $reader
|
||||||
* @param ProtocolWriter $writer
|
* @param ProtocolWriter $writer
|
||||||
*/
|
*/
|
||||||
public function __construct(ProtocolReader $reader, ProtocolWriter $writer)
|
public function __construct(ProtocolReader $reader, ProtocolWriter $writer)
|
||||||
|
@ -132,7 +132,7 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
|
||||||
// If a ResponseError is thrown, send it back in the Response
|
// If a ResponseError is thrown, send it back in the Response
|
||||||
$error = $e;
|
$error = $e;
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
// If an unexpected error occured, send back an INTERNAL_ERROR error response
|
// If an unexpected error occurred, send back an INTERNAL_ERROR error response
|
||||||
$error = new AdvancedJsonRpc\Error(
|
$error = new AdvancedJsonRpc\Error(
|
||||||
(string)$e,
|
(string)$e,
|
||||||
AdvancedJsonRpc\ErrorCode::INTERNAL_ERROR,
|
AdvancedJsonRpc\ErrorCode::INTERNAL_ERROR,
|
||||||
|
|
Loading…
Reference in New Issue