Skip to content

Commit

Permalink
gh-1599: Reduce the grace period (#1600)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantleech committed May 16, 2022
1 parent 45207d9 commit ad43a19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Extension/LanguageServer/LanguageServerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class LanguageServerExtension implements Extension
public const PARAM_PROFILE = 'language_server.profile';
public const PARAM_TRACE = 'language_server.trace';
public const LOG_CHANNEL = 'LSP';
public const PARAM_SHUTDOWN_GRACE_PERIOD = 'language_server.shutdown_grace_period';

public function configure(Resolver $schema): void
{
Expand All @@ -105,6 +106,7 @@ public function configure(Resolver $schema): void
self::PARAM_FILE_EVENT_GLOBS => ['**/*.php'],
self::PARAM_PROFILE => false,
self::PARAM_TRACE => false,
self::PARAM_SHUTDOWN_GRACE_PERIOD => 50,
]);
$schema->setDescriptions([
self::PARAM_TRACE => 'Log incoming and outgoing messages (needs log formatter to be set to ``json``)',
Expand All @@ -120,6 +122,7 @@ public function configure(Resolver $schema): void
self::PARAM_DIAGNOSTIC_ON_SAVE => 'Perform diagnostics when the text document is saved',
self::PARAM_DIAGNOSTIC_PROVIDERS => 'Specify which diagnostic providers should be active (default to all)',
self::PARAM_FILE_EVENTS => 'Register to recieve file events',
self::PARAM_SHUTDOWN_GRACE_PERIOD => 'Amount of time to wait before responding to a shutdown notification',
]);
}

Expand Down Expand Up @@ -318,7 +321,7 @@ private function registerMiddleware(ContainerBuilder $container): void
$this->serverInfo()
);

$stack[] = new ShutdownMiddleware($container->get(EventDispatcherInterface::class));
$stack[] = new ShutdownMiddleware($container->get(EventDispatcherInterface::class), $container->getParameter(self::PARAM_SHUTDOWN_GRACE_PERIOD));
$stack[] = new CancellationMiddleware($container->get(MethodRunner::class));

$stack[] = new MethodAliasMiddleware($container->getParameter(self::PARAM_METHOD_ALIAS_MAP));
Expand Down

0 comments on commit ad43a19

Please sign in to comment.