MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / code_action

Method code_action

src/server.rs:763–787  ·  view source on GitHub ↗
(&self, params: CodeActionParams)

Source from the content-addressed store, hash-verified

761 }
762
763 async fn code_action(&self, params: CodeActionParams) -> Result<Option<CodeActionResponse>> {
764 let uri = params.text_document.uri.to_string();
765
766 // Code actions are not yet Blade-aware (edits target virtual PHP
767 // coordinates and may insert code outside valid PHP regions).
768 // Disabled until Phase 2 component support lands.
769 if self.is_blade_file(&uri) {
770 return Ok(None);
771 }
772
773 let backend = self.clone_for_blocking();
774 let uri_clone = uri.clone();
775 tokio::task::spawn_blocking(move || {
776 backend.handle_with_uri("code_action", &uri_clone, |content| {
777 let actions = backend.handle_code_action(&uri_clone, content, &params);
778 if actions.is_empty() {
779 None
780 } else {
781 Some(actions)
782 }
783 })
784 })
785 .await
786 .unwrap_or(Ok(None))
787 }
788
789 async fn code_action_resolve(&self, action: CodeAction) -> Result<CodeAction> {
790 let (resolved, republish_uri) = self.resolve_code_action(action);

Callers

nothing calls this directly

Calls 6

is_blade_fileMethod · 0.80
clone_for_blockingMethod · 0.80
cloneMethod · 0.80
handle_with_uriMethod · 0.80
handle_code_actionMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected