Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved hover support: Structs, qualified calls/types, behaviours (#356
) FEATURES: * Include the range of resolved entities when responding to hover requests This allows editors to highlight the token that the hover content applies to. For instance, if you hovered `Baz` in the module `Foo.Bar.Baz`, the entire module will be highlighted, not just the hovered segment in the module. * Improve formatting and docs when hovering modules Behaviours (modules that have `@callback` attributes) will now show callback specs and below any module docs. * Don't show return content when hovering modules without docs This applies to modules that use `@moduledoc false` or modules that are missing a `@moduledoc` attribute and don't have other additional docs to show (e.g. behaviour callbacks). * Add support for hovering structs When hovering a module being used as a struct, e.g. `%MyStruct{}`, `MyStruct.t` types will now be shown before any additional module docs. * Add support for hovering qualified functions, macros, and types Qualified calls are those that begin with a module, e.g. `MyModule.my_fun()`. When hovering qualified functions or macros, the signatures of those calls will be shown followed by any specs and docs. When hovering qualified types, the type definition will be shown followed by any docs. For functions with multiple arities, the arity currently being used will try to be inferred and those definitions/docs shown first, followed by those for any higher arities. INTERNAL: * Add additional utilities to `Lexical.Ast`, including `path_at/2` and `contains_position?/2` * Add `Lexical.Test.CursorSupport.pop_range/2` * Add `Lexical.Test.RangeSupport.pop_range/1` * Update Sourceror to 0.14 This version bump includes more complete and resilient APIs for getting ranges, as well as a new `%Zipper{}` struct that replaces the old `{tree, meta}` tuple that previously was used to represent zippers.
- Loading branch information