-
Notifications
You must be signed in to change notification settings - Fork 187
Allow configurable file extension for indexing #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
cdb5b56
5f096c4
7dc4477
f7175bc
9433694
39cfbda
3c33e7f
d2e5048
b9d0d1b
9067b44
1e319c7
58c82e6
44a942e
940eb97
5b1b6bf
707c97f
1e73d08
1f90b4e
ca225ff
c4568bf
5308e7a
a06057b
23a40f0
f4f1067
9cc2736
09fbec2
a5417cd
e317e8c
a1c3845
a1e5654
a81bed9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,16 +216,38 @@ public function xdependencies(): array | |
} | ||
|
||
/** | ||
* @param Options|null $settings | ||
* Fires when client changes settings in the client | ||
* | ||
* The default paramter type is Options but it also accepts different types | ||
* which will be transformed on demand. | ||
* | ||
* Currently only the vscode format is supported | ||
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. What does this mean? Where is the problem in saying the PHP LS reads settings under the |
||
* | ||
* @param mixed|null $settings | ||
* @return void | ||
*/ | ||
public function didChangeConfiguration(Options $settings = null) | ||
public function didChangeConfiguration($settings = null) | ||
{ | ||
if ($settings === null) { | ||
return; | ||
} | ||
|
||
// VSC sends the settings with the config section as main key | ||
if ($settings instanceof \stdClass && $settings->phpIntelliSense) { | ||
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. Not happy with this part.
|
||
$mapper = new \JsonMapper(); | ||
$settings = $mapper->map($settings->phpIntelliSense, new Options); | ||
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. Can we just use 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. Sure we can. We only have to lookout for possible conflicts in the future when we use Possible config naming:
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.
|
||
} | ||
|
||
if (!($settings instanceof Options)) { | ||
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. Afaik JsonMapper will throw when the schema doesn't match 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. Do you have to tell him to that? 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. What case exactly did not throw an exception? It could be because you typed |
||
return; | ||
} | ||
|
||
$changedOptions = $this->getChangedOptions($settings); | ||
|
||
if (empty($changedOptions)) { | ||
return; | ||
} | ||
|
||
foreach (get_object_vars($settings) as $prop => $val) { | ||
$this->options->$prop = $val; | ||
} | ||
|
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.
Change this to the protocol wording:
https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#didchangeconfiguration-notification