Skip to content

Add docView and Lean4 Show All Abbreviations that displays the current list of abbreviations - #63

Merged
gebner merged 15 commits into
leanprover:masterfrom
lovettchris:clovett/abbrev_help
Nov 3, 2021
Merged

gebner merged 15 commits into
leanprover:masterfrom
lovettchris:clovett/abbrev_help

Conversation

@lovettchris

@lovettchris lovettchris commented Oct 30, 2021 •

Copy link
Copy Markdown

Add "Lean 4: Show All Abbreviations" command that writes to the docview and from there you can use the handy vscode search feature.

image

@Vtec234

Vtec234 commented Nov 1, 2021 •

Copy link
Copy Markdown
Member

I am very positive about the feature of displaying all abbreviations (sometimes I have to look them up in the .json file!), however I think a "fake" \help abbreviation is quite unexpected/non-discoverable UI. I would propose the following alternative.

  • We add a "Lean 4: Show all abbreviations" command to the command palette.
  • We point the user towards this command in the "Type .. using .." popup. For example, on hovering over ← the user would see a popup "Type ← using \l or \leftarrow or \l- or \gets or \<-. Click here to show all abbreviations." with the "here" being a link that executes the Lean 4: Show all abbreviations command if such a thing is possible. If not, we could instead write "Type ← using \l or \leftarrow or \l- or \gets or \<-. See also Lean 4: Show all abbreviations".

What do you think?

@gebner

gebner commented Nov 1, 2021

Copy link
Copy Markdown
Member

100% agreed with Wojciech. I would expect \help to input 🚑 (or maybe some other character), not perform an action and open something.

I wouldn't have put the table in the infoview either (in my mind, the infoview is for information about the current file, not for documentation). I'd prefer to put the table in a separate tab (i.e., another, separate webview). But I don't feel too strongly on this.

@Vtec234

Vtec234 commented Nov 1, 2021

Copy link
Copy Markdown
Member

I also agree regarding putting documentation in its own webview. It might fit quite naturally into the docview (#47).

@Kha

Kha commented Nov 1, 2021

Copy link
Copy Markdown
Member

Emacs actually shows the entire list as well, but it does so after \<TAB> - and analogously when completing any other ambiguous prefix.
image

@Vtec234

Vtec234 commented Nov 1, 2021

Copy link
Copy Markdown
Member

@Kha fwiw, I hate this feature in Emacs because every time I mispress Tab while trying to complete an abbreviation despite there being none to complete, that list will appear and I then have to go close it.

@lovettchris

lovettchris commented Nov 1, 2021 •

Copy link
Copy Markdown
Author

thanks for all the great feedback, I modified the PR to provide a new command "lean4.showAllAbbreviations" that shows the help in the docview.

@lovettchris lovettchris changed the title Add abbreviation "\help" that displays the current list of abbreviations Add Lean4 Show All Abbreviations that displays the current list of abbreviations in the docview. Nov 1, 2021
@lovettchris lovettchris changed the title Add Lean4 Show All Abbreviations that displays the current list of abbreviations in the docview. Add docView and Lean4 Show All Abbreviations that displays the current list of abbreviations Nov 1, 2021

@gebner gebner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styling-wise: I think single column was the right decision. I'm not sure if it's a good idea to increase the font size, the list is long and it's probably more useful to see more abbreviations per page (you can always ctrl-= to increase the font size). It might also make sense to use the same (monospace) font that is also used in the editor. I would also print \alpha instead of alpha (i.e. include with the leader character).

Comment thread lean4-infoview/src/infoview/main.tsx Resolved
@lovettchris

Copy link
Copy Markdown
Author

Styling-wise: I think single column was the right decision. I'm not sure if it's a good idea to increase the font size, the list is long and it's probably more useful to see more abbreviations per page (you can always ctrl-= to increase the font size). It might also make sense to use the same (monospace) font that is also used in the editor. I would also print \alpha instead of alpha (i.e. include with the leader character).

Fixed.

@gebner gebner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

@gebner
gebner merged commit 72f4a9e into leanprover:master Nov 3, 2021
@lovettchris
lovettchris deleted the clovett/abbrev_help branch November 3, 2021 09:42
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