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

Function make_issue_json

src/mago.rs:1123–1161  ·  view source on GitHub ↗
(
        level: &str,
        code: &str,
        message: &str,
        path: &str,
        start_offset: u64,
        end_offset: u64,
    )

Source from the content-addressed store, hash-verified

1121 }
1122
1123 fn make_issue_json(
1124 level: &str,
1125 code: &str,
1126 message: &str,
1127 path: &str,
1128 start_offset: u64,
1129 end_offset: u64,
1130 ) -> String {
1131 format!(
1132 r#"{{
1133 "issues": [
1134 {{
1135 "level": "{}",
1136 "code": "{}",
1137 "message": "{}",
1138 "notes": [],
1139 "help": "",
1140 "annotations": [
1141 {{
1142 "message": "",
1143 "kind": "Primary",
1144 "span": {{
1145 "file_id": {{
1146 "name": "test.php",
1147 "path": "{}",
1148 "size": 100,
1149 "file_type": "Host"
1150 }},
1151 "start": {{ "offset": {}, "line": 1 }},
1152 "end": {{ "offset": {}, "line": 1 }}
1153 }}
1154 }}
1155 ]
1156 }}
1157 ]
1158 }}"#,
1159 level, code, message, path, start_offset, end_offset
1160 )
1161 }
1162}

Callers 5

severity_mapping_errorFunction · 0.85
severity_mapping_warningFunction · 0.85
severity_mapping_noteFunction · 0.85
severity_mapping_helpFunction · 0.85

Calls

no outgoing calls

Tested by 5

severity_mapping_errorFunction · 0.68
severity_mapping_warningFunction · 0.68
severity_mapping_noteFunction · 0.68
severity_mapping_helpFunction · 0.68