Skip to content

Commit 869aebe

Browse files
committed
Expand Blade sprint with detailed tasks and update code action status
1 parent 15e8fc8 commit 869aebe

3 files changed

Lines changed: 33 additions & 27 deletions

File tree

docs/todo.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@ within the same impact tier.
6262

6363
## Sprint 8 — Blade support
6464

65-
| # | Item | Impact | Effort |
66-
| --- | ------------------------------------------------ | ------ | --------- |
67-
| | Clear [refactoring gate](todo/refactor.md) |||
68-
| BL1 | [Blade template language support](todo/blade.md) | High | Very High |
69-
70-
The Blade sprint is a placeholder. Scope will be refined after Sprint 7
71-
ships. The goal is to provide a single-binary PHP + Blade language
72-
server with Blade intelligence.
65+
| # | Item | Impact | Effort |
66+
| --- | -------------------------------------------------------------------------------------------------------------- | ------ | ------ |
67+
| | Clear [refactoring gate](todo/refactor.md) |||
68+
| BL1 | [Blade-aware code actions](todo/blade.md#8-blade-aware-code-actions) | Medium | Medium |
69+
| BL2 | [Template and component file discovery](todo/blade.md#9-template-and-component-file-discovery) | High | Medium |
70+
| BL3 | [Component tag parsing (`<x-...>`, `<livewire:...>`, `@props`)](todo/blade.md#10-x-component-tag-parsing-in-preprocessor) | High | High |
71+
| BL4 | [Component and view name completion](todo/blade.md#13-component-and-view-name-completion) | High | Medium |
72+
| BL5 | [Go-to-definition for view names and components](todo/blade.md#15-go-to-definition-for-view-names-and-components) | Medium | Medium |
73+
| BL6 | [`@extends` signature merging and component class typing](todo/blade.md#16-signature-merging-for-extends) | Medium | High |
74+
| BL7 | [Blade directive completion](todo/blade.md#19-directive-name-completion) | Medium | Low |
7375

7476
# Backlog
7577

docs/todo/blade.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,20 @@ Blade templates into virtual PHP line-by-line, with a source map for
5151
coordinate translation. The LSP pipeline (`with_file_content`,
5252
`update_ast`, `did_close`) transparently handles Blade files.
5353

54-
Known issues in the current implementation:
54+
---
5555

56-
### Code actions are not Blade-aware
56+
## Phase 2: Component Support
5757

58-
Code actions like "Import class" insert a `use` statement at the top
59-
of the file rather than inside a `@php` / `<?php` block. All code
60-
actions that produce text edits need their ranges translated, and
61-
actions that generate new code need to be aware of Blade structure.
58+
### 8. Blade-aware code actions
6259

63-
---
60+
Code actions are currently disabled for `.blade.php` files because
61+
text edits target virtual PHP coordinates and actions like "Import
62+
class" insert `use` statements at the top of the file rather than
63+
inside a `@php` / `<?php` block. Re-enable code actions with:
6464

65-
## Phase 2: Component Support
65+
- Range translation (virtual PHP → Blade) for all text edits.
66+
- Blade-aware code generation (e.g. insert `use` inside `@php`).
67+
- Filtering out actions that don't make sense in Blade context.
6668

6769
### 9. Template and component file discovery
6870

@@ -431,19 +433,14 @@ Extend `tests/completion_blade.rs`:
431433

432434
## Implementation Sequence
433435

434-
Steps 1-2 are complete. The remaining steps build on the existing
435-
preprocessor and LSP pipeline.
436-
437-
### Step 3: Remaining Phase 1 items
438-
439-
Inject `$loop` inside `@foreach` blocks. Handle `@session`/`@error`/
440-
`@context` implicit variables. Implement stub directives and verbatim
441-
regions. Add `languageId` check.
436+
Phase 1 is complete (steps 1-3): the preprocessor, LSP pipeline
437+
integration, source mapping, `$loop`/`@session`/`@error`/`@context`
438+
implicit variables, stub directives, verbatim regions, `languageId`
439+
check, and code action suppression are all shipped.
442440

443-
**Deliverable:** `$loop->first`, `$value` inside `@session` blocks,
444-
and `$message` inside `@error` blocks all produce completions.
441+
The remaining steps build on the existing preprocessor:
445442

446-
### Step 4: Discovery (item 9)
443+
### Step 4: Discovery (items 8-9)
447444

448445
Implement `src/blade/discovery.rs`. Scan `resources/views/`,
449446
`app/View/Components/`, `app/Livewire/` at init time. Add the three

src/server.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,13 @@ impl LanguageServer for Backend {
722722
async fn code_action(&self, params: CodeActionParams) -> Result<Option<CodeActionResponse>> {
723723
let uri = params.text_document.uri.to_string();
724724

725+
// Code actions are not yet Blade-aware (edits target virtual PHP
726+
// coordinates and may insert code outside valid PHP regions).
727+
// Disabled until Phase 2 component support lands.
728+
if self.is_blade_file(&uri) {
729+
return Ok(None);
730+
}
731+
725732
let backend = self.clone_for_blocking();
726733
let uri_clone = uri.clone();
727734
tokio::task::spawn_blocking(move || {

0 commit comments

Comments
 (0)