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

Function completions_no_duplicates

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

Source from the content-addressed store, hash-verified

1734
1735#[test]
1736fn completions_no_duplicates() {
1737 let content = "<?php\n/**\n * @\n */\n\n";
1738 let pos = Position {
1739 line: 2,
1740 character: 4,
1741 };
1742 let items = build_phpdoc_completions(
1743 content,
1744 "@",
1745 DocblockContext::Unknown,
1746 pos,
1747 &std::collections::HashMap::new(),
1748 &None,
1749 &SmartContext::EMPTY,
1750 );
1751 let filter_texts: Vec<&str> = items
1752 .iter()
1753 .filter_map(|i| i.filter_text.as_deref())
1754 .collect();
1755 let unique: std::collections::HashSet<&&str> = filter_texts.iter().collect();
1756 assert_eq!(
1757 filter_texts.len(),
1758 unique.len(),
1759 "Should not have duplicate tags. Got: {:?}",
1760 filter_texts
1761 );
1762}
1763
1764// ── Smart pre-fill tests ────────────────────────────────────────
1765

Callers

nothing calls this directly

Calls 2

build_phpdoc_completionsFunction · 0.85
iterMethod · 0.80

Tested by

no test coverage detected