mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-19 16:16:11 +00:00
Make all types reachable through annotations documentable in the REPL
Facades now discover all user-defined classes reachable through the annotations of their methods and of the members of reachable types (transitively) and make them documentable via s.info, without the types having to be declared. Explicit ReferencedType declarations serve curation only (member whitelists, flags). TypedDicts are documented with their keys (e.g. the JetBrains symbol DTOs and the LSP diagnostic structures), enums with their members. SymbolKind no longer needs declaring.
This commit is contained in:
1 parent
8d1fb7424c
commit
44a283ee99
5 files changed
+110
-23
No files matched your search
@@ -73,9 +73,13 @@ class TestReplExecution:
|
||||
assert "get_name_path() -> str" in type_info and "iter_children()" in type_info
|
||||
assert "to_dict" not in type_info # not among the curated members
|
||||
|
||||
# types referenced by parameters are documented as well; enums are documented with their members
|
||||
assert "enum SymbolKind" in type_info and "SymbolKind.Class = 5" in type_info # via iter_ancestors(up_to_symbol_kind)
|
||||
# types reachable through annotations are documented without being declared: SymbolKind (a parameter type of
|
||||
# iter_ancestors) is documented as an enum with its members, both transitively and on request
|
||||
assert "enum SymbolKind" in type_info and "SymbolKind.Class = 5" in type_info
|
||||
assert "enum SymbolKind" in repl.execute('s.info("SymbolKind")')
|
||||
|
||||
# TypedDicts reachable through annotations are documented with their keys
|
||||
assert "keys:" in repl.execute('s.info("Diagnostic")') and "severity" in repl.execute('s.info("Diagnostic")')
|
||||
assert "represent()" not in repl.execute('s.info("LspSymbolCollection")') # the representation mechanism is not exposed
|
||||
|
||||
def test_contained_types_are_documented_once_per_session(self, repl: SerenaRepl) -> None:
|
||||
|
||||
Reference in new issue
Block a user