Commit Graph

11 Commits

Author SHA1 Message Date
Piotr Osiewicz
910f668f4d
php/elixir: Bump extensions versions to 0.0.6 and 0.0.5 (#12636)
Includes:
- https://github.com/zed-industries/zed/pull/12526
- https://github.com/zed-industries/zed/pull/11879
- https://github.com/zed-industries/zed/pull/12467

Release Notes:

- N/A
2024-06-04 13:24:31 +02:00
Sean Washington
436a8fa0ce
php: Update Pest tree-sitter queries to capture single quotes (#12467)
Improved PHP Pest outline and runnables to support single quoted
arguments
([#12461](https://github.com/zed-industries/zed/issues/12461)).

Release Notes:

- N/A

| Before | After |
|--------|--------|
|
![image](https://github.com/zed-industries/zed/assets/428033/e0966510-da11-4a80-8901-7dba541ab721)
| ![CleanShot 2024-05-29 at 20 13
00@2x](https://github.com/zed-industries/zed/assets/428033/5f7ab492-2791-4a04-9ec3-f0adfa9b2986)
|
| ![CleanShot 2024-05-29 at 20 18
11@2x](https://github.com/zed-industries/zed/assets/428033/ac6bf58b-4e7d-410d-af51-328c41a76ba0)
| ![CleanShot 2024-05-29 at 20 14
35@2x](https://github.com/zed-industries/zed/assets/428033/1d226bb8-f102-4171-906d-e122ab8299cf)
|
2024-05-30 16:37:41 +02:00
Piotr Osiewicz
71451b59cd
php/ruby: bump version to 0.0.5 (#12330)
Includes: https://github.com/zed-industries/zed/pull/12237

Release Notes:

- N/A
2024-05-27 00:07:33 +02:00
Piotr Osiewicz
27229bba6b
tasks: Provide task variables from matching runnable ranges in task modal (#12237)
In #12003 we found ourselves in need for precise region tracking in
which a given runnable has an effect in order to grab variables from it.
This PR makes it so that in task modal all task variables from queries
overlapping current cursor position.
However, in the process of working on that I've found that we cannot
always use a top-level capture to represent the full match range of
runnable (which has been my assumption up to this point). Tree-sitter
captures cannot capture sibling groups; we did just that in Rust
queries.

Thankfully, none of the extensions are affected as in them, a capture is
always attached to single node. This PR adds annotations to them
nonetheless; we'll be able to get rid of top-level captures in extension
runnables.scm once this PR is in stable version of Zed.


Release Notes:

- N/A
2024-05-24 21:00:23 +02:00
Remco Smits
8af9fa6320
php: Bump to v0.0.4 (#12140)
This PR bumps the PHP extension to v0.0.4.

Changes:

- https://github.com/zed-industries/zed/pull/11514

Release Notes:

- N/A
2024-05-22 14:11:48 -04:00
Remco Smits
bfdd9d89a7
php: Add runnable tests (#11514)
### This pull request adds the following:
- Missing mapping for the `yield` keyword.
- Outline scheme for `describe`, `it` and `test`
function_call_expressions (to support Pest runnable)
- Pest runnable support
- PHPUnit runnable support
- Task for running selected PHP code.


## Queries explanations

#### Query 1 (PHPUnit: Run specific method test):
1. Class is not abstract (because you cannot run tests from an abstract
class)
2. Class has `Test` suffix
3. Method has public modifier(or no modifiers, default is public)
4. Method has `test` prefix

#### Query 2 (PHPUnit: Run specific method test with `@test`
annotation):
1. Class is not abstract (because you cannot run tests from an abstract
class)
2. Class has `Test` suffix
3. Method has public modifier(or no modifiers, default is public)
4. Method has `@test` annotation

#### Query 3 (PHPUnit: Run specific method test with `#[Test]`
attribute):
1. Class is not abstract (because you cannot run tests from an abstract
class)
2. Class has `Test` suffix
3. Method has public modifier(or no modifiers, default is public)
4. Method has `#[Test]` attribute

#### Query 4 (PHPUnit: Run all tests inside the class):
1. Class is not abstract (because you cannot run tests from an abstract
class)
2. Class has `Test` suffix

#### Query 5 (Pest: Run function test)
1. Function expression has one of the following names: `describe`, `it`
or `test`
2. Function expression first argument is a string

### **PHPUnit: Example for valid test class**
<img width="549" alt="Screenshot 2024-05-08 at 10 41 34"
src="https://github.com/zed-industries/zed/assets/62463826/e84269de-4f53-410b-b93b-713f9448dc79">


### **PHPUnit: Example for invalid test class**
All the methods should be ignored because you cannot run tests on an
abstract class.
<img width="608" alt="Screenshot 2024-05-07 at 22 28 57"
src="https://github.com/zed-industries/zed/assets/62463826/8c6b3921-5266-4d88-ada5-5cd827bcf242">

### **Pest: Example**

https://github.com/zed-industries/zed/assets/62463826/bce133eb-0a6f-4ca2-9739-12d9169bb9d6

You should now see all your **Pest** tests inside the buffer symbols
modal.
![Screenshot 2024-05-08 at 22 51
25](https://github.com/zed-industries/zed/assets/62463826/9c818b74-383c-45e5-9b41-8dec92759a14)

Release Notes:

- Added test runnable detection for PHP (PHPUnit & Pest).
- Added task for running selected PHP code.
- Added `describe`, `test` and `it` functions to buffer symbols, to
support Pest runnable.
- Added `yield` keyword to PHP keyword mapping.
2024-05-22 13:49:20 +02:00
Marshall Bowers
3df144c88a
php: Bump to v0.0.3 (#11832)
This PR bumps the PHP extension to v0.0.3.

Changes:

- #11695

Release Notes:

- N/A
2024-05-14 19:02:39 -04:00
claytonrcarter
748cd38d77
php: Highlight PHPDoc comments (#11695)
This adds highlighting of phpdoc tags and PHP types to phpdoc comments,
using
[tree-sitter-phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc)
(maintained by yours me, and also in use by neovim).

<table>
<tr>
<td>
<strong>Before</strong>
<img
src="https://github.com/zed-industries/zed/assets/1420419/bae4c502-8a2c-4399-893f-fcff4e5797b6">
</td>
<td>
<strong>After</strong>
<img
src="https://github.com/zed-industries/zed/assets/1420419/8848e9fb-61a0-4938-a118-7041da9589c0">
</td>
</tr>
</table>


Release Notes:

- N/A
2024-05-14 15:48:14 -04:00
Marshall Bowers
65c9e7d3d1
php: Bump to v0.0.2 (#10480)
This PR bumps the PHP extension to v0.0.2.

This version of the PHP extension adds the `language_ids` mappings from
#10053.

Release Notes:

- N/A
2024-04-12 12:19:01 -04:00
Marshall Bowers
39cc3c0778
Allow extensions to provide data for language_ids (#10053)
This PR makes it so extensions can provide values for the `language_ids`
method on the `LspAdapter` trait.

These are provided as data in the `language_servers` section of the
`extension.toml`, like so:

```toml
[language_servers.intelephense]
name = "Intelephense"
language = "PHP"
language_ids = { PHP = "php"}
```

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2024-04-01 17:01:11 -04:00
Marshall Bowers
e252f90e30
Extract PHP support into an extension (#9966)
This PR extracts PHP support into an extension and removes the built-in
PHP support from Zed.

There's a small workaround necessary in order for us to provide the
`language_ids` on the `LspAdapter` that are needed for the language
server to run properly. Eventually we'll want to build this into the
extension API, but for now we're just hard-coding it on the host side.

Release Notes:

- Removed built-in support for PHP, in favor of making it available as
an extension. The PHP extension will be suggested for download when you
open a `.php` file.
2024-03-29 14:51:54 -04:00