implements PLN-0134
Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 63.37% (18783/29640)
* Branch Coverage: 53.99% (7369/13648)
* Lines of Code: 29640
* Cyclomatic Complexity: 11938
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 674
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 63.37% (18783/29640)
* Branch Coverage: 53.99% (7369/13648)
* Lines of Code: 29640
* Cyclomatic Complexity: 11938
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 674
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
Add PBS workspace symbols as a physical flatten of the outline named-declaration set on FrontendLanguageService. Regular files only; virtual stdlib, barrels, imports, locals, and compile-only frontends stay empty. Advertise workspaceSymbolProvider with flat SymbolInformation. workspace/symbol does not require an open document. Housekeep DSC-0042 with LSN-0071.
This commit is contained in:
+47
@@ -526,6 +526,51 @@ final class PbsEditorialSupportServiceTest {
|
||||
assertEquals(List.of("tick"), names(implementsSymbol.children()));
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldFlattenOutlineMembersForWorkspaceSearchAndFilterByName() {
|
||||
final var source = """
|
||||
import { Log } from @sdk:log;
|
||||
|
||||
declare struct Vec(x: int) {
|
||||
ctor make(x: int) { return; }
|
||||
fn blend(dx: int, dy: int) -> int { return dx; }
|
||||
}
|
||||
|
||||
fn helper() -> int { return 42; }
|
||||
fn helper(value: int) -> int { return value; }
|
||||
|
||||
fn frame() -> void {
|
||||
let local = 1;
|
||||
helper(local);
|
||||
}
|
||||
""";
|
||||
final var ast = parseOrdinary(source);
|
||||
final var all = service.workspaceSymbols(ast, "");
|
||||
assertEquals(List.of(
|
||||
"Vec",
|
||||
"x",
|
||||
"make",
|
||||
"blend",
|
||||
"helper",
|
||||
"helper",
|
||||
"frame"), all.stream().map(PbsEditorialWorkspaceSymbol::name).toList());
|
||||
assertEquals("", all.getFirst().containerName());
|
||||
assertEquals("Vec", all.stream().filter(symbol -> symbol.name().equals("blend")).findFirst().orElseThrow().containerName());
|
||||
assertEquals("Vec", all.stream().filter(symbol -> symbol.name().equals("x")).findFirst().orElseThrow().containerName());
|
||||
assertTrue(all.stream().noneMatch(symbol -> symbol.name().equals("Log") || symbol.name().equals("local")));
|
||||
|
||||
final var blendHits = service.workspaceSymbols(ast, "BLEND");
|
||||
assertEquals(List.of("blend"), blendHits.stream().map(PbsEditorialWorkspaceSymbol::name).toList());
|
||||
assertEquals("Vec", blendHits.getFirst().containerName());
|
||||
|
||||
final var helperHits = service.workspaceSymbols(ast, "helper");
|
||||
assertEquals(2, helperHits.size());
|
||||
assertNotEquals(helperHits.getFirst().detail(), helperHits.get(1).detail());
|
||||
|
||||
final var qualifiedMiss = service.workspaceSymbols(ast, "Vec.blend");
|
||||
assertTrue(qualifiedMiss.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldOmitInvalidDeclarationsAndKeepNamedDeclsFromRecoveredAst() {
|
||||
final var source = """
|
||||
@@ -536,6 +581,8 @@ final class PbsEditorialSupportServiceTest {
|
||||
final var symbols = service.documentSymbols(ast);
|
||||
assertEquals(List.of("ok"), names(symbols));
|
||||
assertEquals(PbsEditorialSymbolKind.FUNCTION, symbols.getFirst().kind());
|
||||
final var workspaceSymbols = service.workspaceSymbols(ast, "");
|
||||
assertEquals(List.of("ok"), workspaceSymbols.stream().map(PbsEditorialWorkspaceSymbol::name).toList());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user