-
Notifications
You must be signed in to change notification settings - Fork 0
PHP language server
Sergey Skorik edited this page Sep 11, 2018
·
5 revisions
- Create workspace from the PHP stack with web-php-simple project.
- Enable PHP language server in the Installers tab and start the workspace.
- Create "index.php" file with content:
<?php include 'lib.php';?>
<?php
echo sayHello("man");
?>
- Create "lib.php" file with content:
<?php
function sayHello($name) {
return "Hello, $name";
}
?>
- Language server initialization
- From the project open "index.php" file.
- Check
Finished language servers initialization, file path '/web-php-simple/index.php'
message in the dev-machine console.
- Autocomplete feature
- Open "index.php" file.
- Add a new line in line 5 and type
$color = "blue";
. - Press ENTER button, type "$" and than Ctrl+Space buttons. The
color
fragment should be offered. - Delete the added lines
- Find definition feature
- Open "index.php" file.
- Set cursor to 4:10 position and invoke Assistant -> Find Definition. The "lib.php" file should be opened and sayHello function should be selected.
- Close the "lib.php" file. Repeat previous step using F4 key instead of Assistant -> Find Definition invocation.
- Code validation feature, Comment line
- Open "index.php" file.
- Move cursor in 4:1 position.
- Type any symbol there and check that error marker is appeared. Click on error marker - the proposal widget should be show
; expected
message. - Restore content. Error marker should disappear.
- Move cursor in line 4 position and comment this line by Ctrl+/ buttons.
- Check that text in line 4 was changed from
echo sayHello("man");
to//echo sayHello("man");
. - Uncomment this line by Ctrl+/ buttons.
- Hover feature
- Open "index.php" file.
- Move mouse pointer on position 4:12(sayHello() function).
- Wait hover popup is appeared with text
<?php function sayHello($name) {
.
Find References
- Open "index.php" file.
- Move mouse pointer on position 4:12.
- Start Find References feature by pressing Alt+F7 buttons or from Assistant menu.
- Check that Find References panel is opened with
/web-php-simple/index.php From:4:6 To:4:14
result in it.
Signature Help
- Open "index.php" file.
- Add a new line in position 5 and type
sayHello
. - Type '(' symbol and wait for hover popup with
(mixed $name)
text. - Delete the added line
Go To Symbol
- Open "lib.php" file.
- Start Go To Symbol feature by Ctrl+F12 buttons or from Assistant menu.
- Wait for Go To Symbol form is opened with next line:
sayHello symbols(1)
- Click on it and check that it correctly selected in file.
Find Project Symbol
- Open "index.php" file.
- Start Find Project Symbol feature by Alt+N buttons or from Assistant menu.
- Type
say
in Find Project Symbol form input. - Wait for
sayHello /web-php-simple/lib.php
line. - Click on it and check that it correctly selected in file.