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

Function print_github_annotations

src/analyse.rs:783–806  ·  view source on GitHub ↗

Emit GitHub Actions workflow commands for all diagnostics. Each diagnostic is printed as a `::error` or `::warning` line so that GitHub Actions surfaces them as inline annotations on pull request diffs. See:

(file_diagnostics: &[(String, Vec<FileDiagnostic>)])

Source from the content-addressed store, hash-verified

781/// GitHub Actions surfaces them as inline annotations on pull request diffs.
782/// See: <https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions>
783fn print_github_annotations(file_diagnostics: &[(String, Vec<FileDiagnostic>)]) {
784 for (path, diagnostics) in file_diagnostics {
785 for diag in diagnostics {
786 let level = match diag.severity {
787 DiagnosticSeverity::ERROR => "error",
788 DiagnosticSeverity::WARNING => "warning",
789 _ => "notice",
790 };
791 let message = format_github_message(&diag.message);
792 let title = diag.identifier.as_deref().unwrap_or("");
793 if title.is_empty() {
794 println!(
795 "::{level} file={path},line={line},col=0::{message}",
796 line = diag.line,
797 );
798 } else {
799 println!(
800 "::{level} file={path},line={line},col=0,title={title}::{message}",
801 line = diag.line,
802 );
803 }
804 }
805 }
806}
807
808/// Format a message for GitHub Actions workflow commands.
809///

Callers 1

runFunction · 0.85

Calls 2

format_github_messageFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected