Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show type of thing the cursor is currently on at the REPL #2255

Open
byorgey opened this issue Jan 1, 2025 · 1 comment
Open

Show type of thing the cursor is currently on at the REPL #2255

byorgey opened this issue Jan 1, 2025 · 1 comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. G-REPL An issue having to do with the REPL. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. T-UI Involves the user interface. Z-Feature A new feature to be added to the game. Z-User Experience This issue seeks to make the game more enjoyable to play.

Comments

@byorgey
Copy link
Member

byorgey commented Jan 1, 2025

How about showing the type of function the cursor is on?

Originally posted by @xsebek in #1955 (comment)

Concretely, I think the idea should be to show the type (in the UR corner of the REPL panel) of the most deeply nested part of the input AST that the cursor is on or after. For example (the cursor position is indicated by |):

  • build {give | } would display give : Actor -> Text -> Cmd Unit
  • foo ((2 + 3) | + 7) would display 2 + 3 : Int
@byorgey byorgey added Z-User Experience This issue seeks to make the game more enjoyable to play. Z-Feature A new feature to be added to the game. C-Low Hanging Fruit Ideal issue for new contributors. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. T-UI Involves the user interface. G-REPL An issue having to do with the REPL. labels Jan 2, 2025
@byorgey byorgey self-assigned this Jan 2, 2025
@byorgey
Copy link
Member Author

byorgey commented Jan 2, 2025

I played with this a bit, and the biggest hurdle is the fact that right now, either a term typechecks completely or not at all. If one part of a term does not typecheck, it is not possible to get type information about the other parts that did. Ideally this should come after addressing #1483 - we can return a term annotated with as much type information as possible, and type errors marked as well, which will allow us to still extract type information about some parts of the term.

@byorgey byorgey removed their assignment Jan 2, 2025
@kostmo kostmo changed the title Show type of thing the curser is currently on at the REPL Show type of thing the cursor is currently on at the REPL Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. G-REPL An issue having to do with the REPL. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. T-UI Involves the user interface. Z-Feature A new feature to be added to the game. Z-User Experience This issue seeks to make the game more enjoyable to play.
Projects
None yet
Development

No branches or pull requests

1 participant