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

Function completions_case_insensitive

tests/unit/phpdoc_internals.rs:1683–1708  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1681
1682#[test]
1683fn completions_case_insensitive() {
1684 // Function needs a param so that @param is emitted.
1685 let content = "<?php\n/**\n * @PAR\n */\nfunction foo(int $n): void {}\n";
1686 let pos = Position {
1687 line: 2,
1688 character: 7,
1689 };
1690 let items = build_phpdoc_completions(
1691 content,
1692 "@PAR",
1693 DocblockContext::FunctionOrMethod,
1694 pos,
1695 &std::collections::HashMap::new(),
1696 &None,
1697 &SmartContext::EMPTY,
1698 );
1699 let filter_texts: Vec<&str> = items
1700 .iter()
1701 .filter_map(|i| i.filter_text.as_deref())
1702 .collect();
1703
1704 assert!(
1705 filter_texts.contains(&"@param"),
1706 "Should match case-insensitively"
1707 );
1708}
1709
1710#[test]
1711fn completions_have_keyword_kind() {

Callers

nothing calls this directly

Calls 2

build_phpdoc_completionsFunction · 0.85
iterMethod · 0.80

Tested by

no test coverage detected