Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Support full sync
  • Loading branch information
dantleech committed Sep 19, 2026
commit 6b548038ae13e4fb5db8ea660be33f8ea5ea8fb3
20 changes: 17 additions & 3 deletions doc/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,19 @@ Kill the diagnostics or code action processes if they outlive this timeout
**Default**: ``5``


.. _param_language_server.text_document_sync_incremental:


``language_server.text_document_sync_incremental``
""""""""""""""""""""""""""""""""""""""""""""""""""


Request that clients send text document updates incrementally


**Default**: ``false``


.. _LanguageServerCompletionExtension:


Expand Down Expand Up @@ -1936,7 +1949,7 @@ When searching the index exclude records whose fully qualified names match any o
Type: integer


Number of child processes to parse files with while building the index. `0` picks a number based on the available CPU threads, `1` indexes everything in the main process
Number of child processes to parse files with while building the index. `0` picks a number based on the available CPUs, `1` indexes everything in the main process


**Default**: ``0``
Expand All @@ -1952,7 +1965,7 @@ Number of child processes to parse files with while building the index. `0` pick
Type: integer


Only index in parallel when at least this many files need indexing.
Only index in parallel when at least this many files need indexing - starting a pool of workers does not pay for itself on a handful of changed files


**Default**: ``500``
Expand All @@ -1968,7 +1981,7 @@ Only index in parallel when at least this many files need indexing.
Type: string


Internal use only. Path to the Phpactor binary used to spawn index workers
Internal use only - path to the Phpactor binary used to spawn index workers


**Default**: ``"%application_root%\/bin\/phpactor"``
Expand Down Expand Up @@ -2725,3 +2738,4 @@ Enable or disable this extension


**Default**: ``false``

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function getListenersForEvent(object $event): iterable
{
if (null === $this->aggregateProvider) {
$this->aggregateProvider = new ListenerProviderAggregate();

foreach ($this->serviceIds as $serviceId) {
/** @var object|null $listenerProvider */
$listenerProvider = $this->container->get($serviceId);
Expand Down
10 changes: 7 additions & 3 deletions lib/Extension/LanguageServer/LanguageServerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class LanguageServerExtension implements Extension
public const PARAM_DIAGNOSTIC_EXCLUDE_PATHS = 'language_server.diagnostic_exclude_paths';
public const PARAM_DIAGNOSTIC_IGNORE_CODES = 'language_server.diagnostic_ignore_codes';
public const PARAM_ENABLE_TRUST_CHECK = 'language_server.enable_trust_check';
public const PARAM_TEXT_DOCUMENT_SYNC = TextDocumentSyncKind::FULL;
public const PARAM_TEXT_DOCUMENT_SYNC_INCREMENTAL = 'language_server.text_document_sync_incremental';

public function configure(Resolver $schema): void
{
Expand All @@ -163,6 +163,7 @@ public function configure(Resolver $schema): void
self::PARAM_PHPACTOR_BIN => __DIR__ . '/../../../bin/phpactor',
self::PARAM_SELF_DESTRUCT_TIMEOUT => 2500,
self::PARAM_DIAGNOSTIC_OUTSOURCE_TIMEOUT => 5,
self::PARAM_TEXT_DOCUMENT_SYNC_INCREMENTAL => false,
]);
$schema->setDescriptions([
self::PARAM_ENABLE_TRUST_CHECK => 'Check to see if project path is trusted before loading configurations from it',
Expand All @@ -188,6 +189,7 @@ public function configure(Resolver $schema): void
self::PARAM_SHUTDOWN_GRACE_PERIOD => 'Amount of time (in milliseconds) to wait before responding to a shutdown notification',
self::PARAM_SELF_DESTRUCT_TIMEOUT => 'Wait this amount of time (in milliseconds) after a shutdown request before self-destructing',
self::PARAM_PHPACTOR_BIN => 'Internal use only - name path to Phpactor binary',
self::PARAM_TEXT_DOCUMENT_SYNC_INCREMENTAL => 'Request that clients send text document updates incrementally (experimental)',
]);
}

Expand Down Expand Up @@ -311,7 +313,7 @@ private function registerSession(ContainerBuilder $container): void
return null;
}

if ($container->parameter(self::PARAM_TEXT_DOCUMENT_SYNC) === TextDocumentSyncKind::INCREMENTAL) {
if ($container->parameter(self::PARAM_TEXT_DOCUMENT_SYNC_INCREMENTAL)->bool() === true) {
return new IncrementalUpdateListener(
$container->expect(self::SERVICE_SESSION_WORKSPACE, Workspace::class),
);
Expand Down Expand Up @@ -499,7 +501,9 @@ private function registerHandlers(ContainerBuilder $container): void
$container->register(TextDocumentHandler::class, function (Container $container) {
return new TextDocumentHandler(
$container->get(EventDispatcherInterface::class),
TextDocumentSyncKind::INCREMENTAL,
$container->parameter(
self::PARAM_TEXT_DOCUMENT_SYNC_INCREMENTAL
)->bool() ? TextDocumentSyncKind::INCREMENTAL : TextDocumentSyncKind::FULL,
);
}, [ self::TAG_METHOD_HANDLER => []]);

Expand Down
Loading