Repository: phpactor/phpactor (php)

Issue:
Hovering over usage of enum value produces an error
Happens with any enum value
```
[Error - 11:06:56 AM] Request textDocument/hover failed.
  Message: Exception [Twig\Error\RuntimeError] An exception has been thrown during the rendering of a template ("Could not render object "Phpactor\WorseReflection\Bridge\TolerantParser\Reflection\ReflectionEnumCase" using templates "Phpactor/WorseReflection/Bridge/TolerantParser/Reflection/ReflectionEnumCase.twig", "Phpactor/WorseReflection/Bridge/TolerantParser/Reflection/AbstractReflectionClassMember.twig", "Phpactor/WorseReflection/Bridge/TolerantParser/Reflection/AbstractReflectedNode.twig", "Phpactor/WorseReflection/Core/Reflection/ReflectionEnumCase.twig", "Phpactor/WorseReflection/Core/Reflection/ReflectionMember.twig""). at /root/.shared_extensions/phpactor2/templates/help/markdown/Phpactor/Extension/LanguageServerHover/Renderer/HoverInformation.twig#8
  Code: -32603 
#0 /root/.shared_extensions/phpactor2/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#1 /root/.shared_extensions/phpactor2/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#2 /root/.shared_extensions/phpactor2/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#3 /root/.shared_extensions/phpactor2/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#4 /root/.shared_extensions/phpactor2/vendor/dantleech/object-renderer/lib/Adapter/Twig/TwigObjectRenderer.php(39): Twig\Environment->render('Phpactor/Extens...', Array)
#5 /root/.shared_extensions/phpactor2/vendor/dantleech/object-renderer/lib/Model/ObjectRenderer/TolerantObjectRenderer.php(31): Phpactor\ObjectRenderer\Adapter\Twig\TwigObjectRenderer->render(Object(Phpactor\Extension\LanguageServerHover\Renderer\HoverInformation))
#6 /root/.shared_extensions/phpactor2/lib/Extension/LanguageServerHover/Handler/HoverHandler.php(168): Phpactor\ObjectRenderer\Model\ObjectRenderer\TolerantObjectRenderer->render(Object(Phpactor\Extension\LanguageServerHover\Renderer\HoverInformation))
#7 /root/.shared_extensions/phpactor2/lib/Extension/LanguageServerHover/Handler/HoverHandler.php(123): Phpactor\Extension\LanguageServerHover\Handler\HoverHandler->renderMember(Object(Phpactor\WorseReflection\Core\Inference\NodeContext))
#8 /root/.shared_extensions/phpactor2/lib/Extension/LanguageServerHover/Handler/HoverHandler.php(110): Phpactor\Extension\LanguageServerHover\Handler\HoverHandler->renderSymbolContext(Object(Phpactor\WorseReflection\Core\Inference\NodeContext))
#9 /root/.shared_extensions/phpactor2/lib/Extension/LanguageServerHover/Handler/HoverHandler.php(100): Phpactor\Extension\LanguageServerHover\Handler\HoverHandler->infoFromSymbolContext(Object(Phpactor\WorseReflection\Core\Inference\NodeContext))
#10 /root/.shared_extensions/phpactor2/lib/Extension/LanguageServerHover/Handler/HoverHandler.php(74): Phpactor\Extension\LanguageServerHover\Handler\HoverHandler->infoFromReflecionOffset(Object(Phpactor\WorseReflection\Bridge\TolerantParser\Reflection\ReflectionOffset))
#11 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/functions.php(90): Phpactor\Extension\LanguageServerHover\Handler\HoverHandler->Phpactor\Extension\LanguageServerHover\Handler\{closure}()
#12 /root/.shared_extensions/phpactor2/lib/Extension/LanguageServerHover/Handler/HoverHandler.php(88): Amp\call(Object(Closure))
#13 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Handler/HandlerMethodRunner.php(86): Phpactor\Extension\LanguageServerHover\Handler\HoverHandler->hover(Object(Phpactor\LanguageServerProtocol\TextDocumentIdentifier), Object(Phpactor\LanguageServerProtocol\Position), Object(Amp\CancellationToken@anonymous))
#14 [internal function]: Phpactor\LanguageServer\Core\Handler\HandlerMethodRunner->Phpactor\LanguageServer\Core\Handler\{closure}()
#15 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Coroutine.php(67): Generator->current()
#16 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/functions.php(96): Amp\Coroutine->__construct(Object(Generator))
#17 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Handler/HandlerMethodRunner.php(102): Amp\call(Object(Closure))
#18 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Middleware/HandlerMiddleware.php(38): Phpactor\LanguageServer\Core\Handler\HandlerMethodRunner->dispatch(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#19 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\HandlerMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#20 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Middleware/ResponseHandlingMiddleware.php(35): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#21 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\ResponseHandlingMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#22 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Middleware/MethodAliasMiddleware.php(37): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#23 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\MethodAliasMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#24 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Middleware/CancellationMiddleware.php(49): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#25 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\CancellationMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#26 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Middleware/ShutdownMiddleware.php(68): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#27 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\ShutdownMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#28 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Middleware/InitializeMiddleware.php(68): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#29 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\InitializeMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#30 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Middleware/ErrorHandlingMiddleware.php(39): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#31 [internal function]: Phpactor\LanguageServer\Middleware\ErrorHandlingMiddleware->Phpactor\LanguageServer\Middleware\{closure}()
#32 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Coroutine.php(67): Generator->current()
#33 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/functions.php(96): Amp\Coroutine->__construct(Object(Generator))
#34 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Middleware/ErrorHandlingMiddleware.php(64): Amp\call(Object(Closure))
#35 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Middleware/RequestHandler.php(37): Phpactor\LanguageServer\Middleware\ErrorHandlingMiddleware->process(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage), Object(Phpactor\LanguageServer\Core\Middleware\RequestHandler))
#36 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Dispatcher/Dispatcher/MiddlewareDispatcher.php(29): Phpactor\LanguageServer\Core\Middleware\RequestHandler->handle(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#37 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Server/LanguageServer.php(221): Phpactor\LanguageServer\Core\Dispatcher\Dispatcher\MiddlewareDispatcher->dispatch(Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#38 [internal function]: Phpactor\LanguageServer\Core\Server\LanguageServer->Phpactor\LanguageServer\Core\Server\{closure}()
#39 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Coroutine.php(67): Generator->current()
#40 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/functions.php(96): Amp\Coroutine->__construct(Object(Generator))
#41 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/functions.php(121): Amp\call(Object(Closure))
#42 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Server/LanguageServer.php(238): Amp\asyncCall(Object(Closure))
#43 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Server/LanguageServer.php(212): Phpactor\LanguageServer\Core\Server\LanguageServer->dispatchRequest(Object(Phpactor\LanguageServer\Core\Server\Transmitter\ConnectionMessageTransmitter), Object(Phpactor\LanguageServer\Core\Dispatcher\Dispatcher\MiddlewareDispatcher), Object(Phpactor\LanguageServer\Core\Server\StreamProvider\Connection), Object(Phpactor\LanguageServer\Core\Rpc\RequestMessage))
#44 [internal function]: Phpactor\LanguageServer\Core\Server\LanguageServer->Phpactor\LanguageServer\Core\Server\{closure}()
#45 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Coroutine.php(118): Generator->send(Object(Phpactor\LanguageServer\Core\Rpc\RawMessage))
#46 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Internal/Placeholder.php(149): Amp\Coroutine->Amp\{closure}(NULL, Object(Phpactor\LanguageServer\Core\Rpc\RawMessage))
#47 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Coroutine.php(123): Amp\Coroutine->resolve(Object(Phpactor\LanguageServer\Core\Rpc\RawMessage))
#48 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Internal/Placeholder.php(149): Amp\Coroutine->Amp\{closure}(NULL, 'Content-Length:...')
#49 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Deferred.php(53): Amp\Promise@anonymous->resolve('Content-Length:...')
#50 /root/.shared_extensions/phpactor2/vendor/amphp/byte-stream/lib/ResourceInputStream.php(101): Amp\Deferred->resolve('Content-Length:...')
#51 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Loop/NativeDriver.php(327): Amp\ByteStream\ResourceInputStream::Amp\ByteStream\{closure}('a', Resource id #1, NULL)
#52 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Loop/NativeDriver.php(127): Amp\Loop\NativeDriver->selectStreams(Array, Array, 0.1)
#53 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch(true)
#54 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#55 /root/.shared_extensions/phpactor2/vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()
#56 /root/.shared_extensions/phpactor2/vendor/phpactor/language-server/lib/Core/Server/LanguageServer.php(112): Amp\Loop::run(Object(Closure))
#57 /root/.shared_extensions/phpactor2/lib/Extension/LanguageServer/Command/StartCommand.php(54): Phpactor\LanguageServer\Core\Server\LanguageServer->run()
#58 /root/.shared_extensions/phpactor2/vendor/symfony/console/Command/Command.php(298): Phpactor\Extension\LanguageServer\Command\StartCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#59 /root/.shared_extensions/phpactor2/vendor/symfony/console/Application.php(1015): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#60 /root/.shared_extensions/phpactor2/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(Phpactor\Extension\LanguageServer\Command\StartCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#61 /root/.shared_extensions/phpactor2/lib/Application.php(48): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#62 /root/.shared_extensions/phpactor2/vendor/symfony/console/Application.php(171): Phpactor\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#63 /root/.shared_extensions/phpactor2/bin/phpactor(47): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#64 {main}
```

Pull request:
Hover crashes
Fixes #1733, #1735, #1734, #1732

Patch:
diff --git a/lib/CodeTransform/Adapter/TolerantParser/ClassToFile/Transformer/ClassNameFixerTransformer.php b/lib/CodeTransform/Adapter/TolerantParser/ClassToFile/Transformer/ClassNameFixerTransformer.php
index aa383632..17c9ccdc 100644
--- a/lib/CodeTransform/Adapter/TolerantParser/ClassToFile/Transformer/ClassNameFixerTransformer.php
+++ b/lib/CodeTransform/Adapter/TolerantParser/ClassToFile/Transformer/ClassNameFixerTransformer.php
@@ -5,6 +5,7 @@ namespace Phpactor\CodeTransform\Adapter\TolerantParser\ClassToFile\Transformer;
 use Microsoft\PhpParser\ClassLike;
 use Microsoft\PhpParser\Node\SourceFileNode;
 use Microsoft\PhpParser\Node\Statement\ClassDeclaration;
+use Microsoft\PhpParser\Node\Statement\EnumDeclaration;
 use Microsoft\PhpParser\Node\Statement\InlineHtml;
 use Microsoft\PhpParser\Node\Statement\InterfaceDeclaration;
 use Microsoft\PhpParser\Node\Statement\NamespaceDefinition;
@@ -104,7 +105,7 @@ class ClassNameFixerTransformer implements Transformer
             return null;
         }
         
-        assert($classLike instanceof ClassDeclaration || $classLike instanceof InterfaceDeclaration || $classLike instanceof TraitDeclaration);
+        assert($classLike instanceof EnumDeclaration || $classLike instanceof ClassDeclaration || $classLike instanceof InterfaceDeclaration || $classLike instanceof TraitDeclaration);
         
         $name = $classLike->name->getText($rootNode->getFileContents());
 
diff --git a/lib/CodeTransform/Adapter/TolerantParser/Refactor/TolerantExtractExpression.php b/lib/CodeTransform/Adapter/TolerantParser/Refactor/TolerantExtractExpression.php
index 119cc280..2193aa67 100644
--- a/lib/CodeTransform/Adapter/TolerantParser/Refactor/TolerantExtractExpression.php
+++ b/lib/CodeTransform/Adapter/TolerantParser/Refactor/TolerantExtractExpression.php
@@ -93,7 +93,7 @@ class TolerantExtractExpression implements ExtractExpression
     
     private function getCommonExpression(Node $node1, Node $node2): ?Expression
     {
-        if ($node1 == $node2 && $node1 instanceof Expression) {
+        if ($node1 === $node2 && $node1 instanceof Expression) {
             return $node1;
         }
         $ancestor = $node1;
diff --git a/templates/help/markdown/Phpactor/WorseReflection/Core/Reflection/ReflectionEnumCase.twig b/templates/help/markdown/Phpactor/WorseReflection/Core/Reflection/ReflectionEnumCase.twig
new file mode 100644
index 00000000..b9d980ef
--- /dev/null
+++ b/templates/help/markdown/Phpactor/WorseReflection/Core/Reflection/ReflectionEnumCase.twig
@@ -0,0 +1,3 @@
+{% if object.deprecation.isDefined %}{{ render(object.deprecation) }}{% endif %}
+case {{ object.name }}{% if object.value %} = {{ object.value|json_encode(constant('JSON_UNESCAPED_SLASHES')) }}{% endif %}{{ ';' -}}
+
diff --git a/templates/help/markdown/Phpactor/WorseReflection/Core/Reflection/ReflectionMethod.twig b/templates/help/markdown/Phpactor/WorseReflection/Core/Reflection/ReflectionMethod.twig
index b435d3ca..0461e068 100644
--- a/templates/help/markdown/Phpactor/WorseReflection/Core/Reflection/ReflectionMethod.twig
+++ b/templates/help/markdown/Phpactor/WorseReflection/Core/Reflection/ReflectionMethod.twig
@@ -1,5 +1,5 @@
 {% if object.deprecation.isDefined %}{{ render(object.deprecation) }}    {% endif %}
-{%- if object.declaringClass.isClass -%}
+{%- if object.declaringClass.isClass and object.class.isClass -%}
     {%- if object.deprecation.isDefined %}⚠ {% endif -%}
     {%- if object.declaringClass.parent -%}
         {%- set parent = object.class.parent -%}


Test patch:
diff --git a/lib/Extension/LanguageServerCompletion/Tests/Integration/MarkdownObjectRendererTest.php b/lib/Extension/LanguageServerCompletion/Tests/Integration/MarkdownObjectRendererTest.php
index da9c2704..46ec9032 100644
--- a/lib/Extension/LanguageServerCompletion/Tests/Integration/MarkdownObjectRendererTest.php
+++ b/lib/Extension/LanguageServerCompletion/Tests/Integration/MarkdownObjectRendererTest.php
@@ -55,6 +55,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
      * @dataProvider provideMethod
      * @dataProvider provideProperty
      * @dataProvider provideConstant
+     * @dataProvider provideEnumCase
      * @dataProvider provideTrait
      * @dataProvider provideFunction
      * @dataProvider provideSymbolOffset
@@ -212,7 +213,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideInterface()
+    public function provideInterface(): Generator
     {
         yield 'complex interface' => [
             '',
@@ -246,7 +247,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideTrait()
+    public function provideTrait(): Generator
     {
         yield 'simple trait' => [
             '',
@@ -269,7 +270,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideMethod()
+    public function provideMethod(): Generator
     {
         yield 'simple' => [
             '',
@@ -445,7 +446,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideProperty()
+    public function provideProperty(): Generator
     {
         yield 'simple property' => [
             '',
@@ -544,7 +545,51 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideConstant()
+    public function provideEnumCase(): Generator
+    {
+        if (!defined('T_ENUM')) {
+            return;
+        }
+
+        yield 'enum case' => [
+            '',
+            function (Reflector $reflector) {
+                return $reflector->reflectClassesIn(
+                    <<<'EOT'
+                        <?php
+
+                        enum Foobar
+                        {
+                            case FOOBAR;
+                        }
+                        EOT
+                )->first()->cases()->get('FOOBAR');
+            },
+            'enum_case1.md',
+        ];
+
+        yield 'backed enum case' => [
+            '',
+            function (Reflector $reflector) {
+                return $reflector->reflectClassesIn(
+                    <<<'EOT'
+                        <?php
+
+                        enum Foobar: string
+                        {
+                            case FOOBAR = 'foo';
+                        }
+                        EOT
+                )->first()->cases()->get('FOOBAR');
+            },
+            'enum_backed_case1.md',
+        ];
+    }
+
+    /**
+     * @return Generator<mixed>
+     */
+    public function provideConstant(): Generator
     {
         yield 'simple constant' => [
             '',
@@ -584,7 +629,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideFunction()
+    public function provideFunction(): Generator
     {
         yield 'simple function' => [
             '',
@@ -616,7 +661,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideSymbolOffset()
+    public function provideSymbolOffset(): Generator
     {
         yield 'whitespace' => [
             '',
@@ -655,7 +700,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideType()
+    public function provideType(): Generator
     {
         yield 'mixed' => [
             '',
@@ -698,7 +743,7 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
     /**
      * @return Generator<mixed>
      */
-    public function provideMemberDocblock()
+    public function provideMemberDocblock(): Generator
     {
         yield 'single member with no doc' => [
             '',
@@ -736,7 +781,6 @@ class MarkdownObjectRendererTest extends IntegrationTestCase
             },
             'member_docblock2.md',
         ];
-
         yield 'member with concrete parent doc' => [
             '',
             function (Reflector $reflector) {
diff --git a/lib/Extension/LanguageServerCompletion/Tests/Integration/expected/enum_backed_case1.md b/lib/Extension/LanguageServerCompletion/Tests/Integration/expected/enum_backed_case1.md
new file mode 100644
index 00000000..1b5bba07
--- /dev/null
+++ b/lib/Extension/LanguageServerCompletion/Tests/Integration/expected/enum_backed_case1.md
@@ -0,0 +1,2 @@
+case FOOBAR = "foo";
+
diff --git a/lib/Extension/LanguageServerCompletion/Tests/Integration/expected/enum_case1.md b/lib/Extension/LanguageServerCompletion/Tests/Integration/expected/enum_case1.md
new file mode 100644
index 00000000..41712fc6
--- /dev/null
+++ b/lib/Extension/LanguageServerCompletion/Tests/Integration/expected/enum_case1.md
@@ -0,0 +1,1 @@
+case FOOBAR;