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

Function aligns_param_columns

src/code_actions/update_docblock.rs:1910–1947  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1908
1909 #[test]
1910 fn aligns_param_columns() {
1911 let php = r#"<?php
1912class Foo {
1913 /**
1914 * @param string $a
1915 */
1916 public function bar(string $a, int $b, array $items): void {}
1917}
1918"#;
1919 let pos = php.find("@param string").unwrap() as u32;
1920 let info = find_info(php, pos).unwrap();
1921 let cl = no_class_loader();
1922 let updated = build_updated_docblock(
1923 &info,
1924 php,
1925 &[],
1926 &cl,
1927 no_function_loader(),
1928 &HashMap::new(),
1929 &None,
1930 );
1931 // All $names should be aligned at the same column.
1932 assert!(
1933 updated.contains("@param string $a"),
1934 "Should have string padded: {}",
1935 updated
1936 );
1937 assert!(
1938 updated.contains("@param int $b"),
1939 "Should have int padded: {}",
1940 updated
1941 );
1942 assert!(
1943 updated.contains("@param array<mixed> $items"),
1944 "Should have array<mixed> padded: {}",
1945 updated
1946 );
1947 }
1948
1949 #[test]
1950 fn no_spurious_blank_line_after_open() {

Callers

nothing calls this directly

Calls 6

find_infoFunction · 0.85
no_class_loaderFunction · 0.85
build_updated_docblockFunction · 0.85
no_function_loaderFunction · 0.85
unwrapMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected