This repository has been archived by the owner on Mar 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Allow to disable selected capabilities by the client #58
Open
przepompownia
wants to merge
20
commits into
phpactor:master
Choose a base branch
from
przepompownia:allow-disable-selected-capabilities-by-the-client
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d3213db
Allow to disable `textDocument/signatureHelp` and `textDocument/compl…
przepompownia c5f4d7b
Fix CompletionHandlerTest
przepompownia ec58d09
fixup! Fix CompletionHandlerTest
przepompownia 7248124
Fix SignatureHelpHandlerTest
przepompownia 94c2e59
Avoid cs-fixer deprecations
przepompownia 619ad40
Add test that should not pass
przepompownia c34bac9
Allow to disable the rest of method
przepompownia 06b3755
Merge branch 'allow-disable-selected-capabilities-by-the-client' of p…
przepompownia 5aa58fe
Move duplicated clientCapabilities() to AbstractExtension
przepompownia 9a097f3
Move $clientCapabilities to AbstractHandler
przepompownia 1ce025f
Fix unit tests
przepompownia d79cb93
fixup! Fix unit tests
przepompownia 937fdfe
Remove trailig comma
przepompownia 8e2f6ef
fixup! Remove trailig comma
przepompownia 5f7fdcb
Remove unused imports
przepompownia a633937
PSR
przepompownia e8433f6
Do not override setting signatureHelpProvider in CompletionHandler
przepompownia 479e4fa
Remove unused import
przepompownia da4abe5
Add tests for CompletionHandler
przepompownia 5fdc1e1
Merge branch 'master' into allow-disable-selected-capabilities-by-the…
przepompownia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Phpactor\Extension; | ||
|
||
use Phpactor\Container\Container; | ||
use Phpactor\LanguageServerProtocol\ClientCapabilities; | ||
|
||
abstract class AbstractExtension | ||
{ | ||
protected function clientCapabilities(Container $container): ClientCapabilities | ||
{ | ||
return $container->get(ClientCapabilities::class); | ||
} | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
use Amp\Promise; | ||
use Phpactor\Extension\LanguageServerBridge\Converter\PositionConverter; | ||
use Phpactor\LanguageServerProtocol\ClientCapabilities; | ||
use Phpactor\LanguageServerProtocol\DefinitionParams; | ||
use Phpactor\LanguageServerProtocol\ServerCapabilities; | ||
use Phpactor\Extension\LanguageServerBridge\Converter\LocationConverter; | ||
|
@@ -31,11 +32,21 @@ class GotoDefinitionHandler implements Handler, CanRegisterCapabilities | |
*/ | ||
private $locationConverter; | ||
|
||
public function __construct(Workspace $workspace, DefinitionLocator $definitionLocator, LocationConverter $locationConverter) | ||
{ | ||
/** | ||
* @var ClientCapabilities | ||
*/ | ||
private ClientCapabilities $clientCapabilities; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I forgotten that the whole project still depends on (unsupported) PHP 7.3 and typed properties are not allowed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, it would be good to bump it again. just a big PITA with 50 packages. |
||
|
||
public function __construct( | ||
Workspace $workspace, | ||
DefinitionLocator $definitionLocator, | ||
LocationConverter $locationConverter, | ||
ClientCapabilities $clientCapabilities | ||
) { | ||
$this->definitionLocator = $definitionLocator; | ||
$this->workspace = $workspace; | ||
$this->locationConverter = $locationConverter; | ||
$this->clientCapabilities = $clientCapabilities; | ||
} | ||
|
||
public function methods(): array | ||
|
@@ -70,6 +81,6 @@ public function definition( | |
|
||
public function registerCapabiltiies(ServerCapabilities $capabilities): void | ||
{ | ||
$capabilities->definitionProvider = true; | ||
$capabilities->definitionProvider = null !== $this->clientCapabilities->textDocument->definition; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as below, i'd rather avoid this...