Skip to content

Conversation

@ChrisPenner
Copy link
Member

@ChrisPenner ChrisPenner commented Oct 14, 2025

Overview

@aryairani requested something like this today and it was super quick to hammer out;

Just implements the "Document Symbols" LSP endpoint so you get a scratch-file outline in supported editors.
Clicking the thing brings you there.

image

Shows definitions, types, abilities, and named watches.

Shows type signatures if the file typechecks, but still works if it just parses.

Implementation notes

Essentially just converts our unison file type into DocumentSymbols output, it was pretty straight-forward.

Test coverage

Nah, it's pretty simple, we should just dogfood it.

Loose ends

Future improvements:

  • Would be nice to fall-back to a previous typecheck/parse if the file is currently not parsing.
  • Would be nice to add a special icon for test watches

@ChrisPenner ChrisPenner requested a review from aryairani October 14, 2025 18:20
@ChrisPenner ChrisPenner changed the title Lsp/document symbols LSP scratch-file outline Oct 14, 2025
@pchiusano
Copy link
Member

Nice!

@ChrisPenner ChrisPenner merged commit d1c95cb into trunk Oct 14, 2025
32 checks passed
@ChrisPenner ChrisPenner deleted the lsp/document-symbols branch October 14, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants