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

Function build_eol_comment

src/code_actions/phpstan/ignore.rs:295–310  ·  view source on GitHub ↗

Build a `TextEdit` that appends `// @phpstan-ignore ` at the end of a line.

(_content: &str, line: u32, line_text: &str, identifier: &str)

Source from the content-addressed store, hash-verified

293/// Build a `TextEdit` that appends `// @phpstan-ignore <id>` at the end
294/// of a line.
295fn build_eol_comment(_content: &str, line: u32, line_text: &str, identifier: &str) -> TextEdit {
296 let end_col = line_text.len() as u32;
297 TextEdit {
298 range: Range {
299 start: Position {
300 line,
301 character: end_col,
302 },
303 end: Position {
304 line,
305 character: end_col,
306 },
307 },
308 new_text: format!(" // @phpstan-ignore {}", identifier),
309 }
310}
311
312/// Build a `TextEdit` that removes a `@phpstan-ignore` comment or a
313/// specific identifier from it.

Callers 1

build_add_ignore_editFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected