leanprover / leanprover/vscode-lean4

Better line wrapping of long snippets in the InfoView

Open
#107 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
313
Forks
104
Avg merge
1h 56m
Merged PRs (30d)
1

Description

The long horizontal scrolling in this example is annoying, we should line wrap:
image

In Lean 3 we had some fancy CSS that did the formatting (i.e., indenting and inserting newlines at the appropriate places). We also used it for the docs: https://leanprover-community.github.io/mathlib_docs/measure_theory/covering/besicovitch_vector_space.html#besicovitch.exists_good_%CE%B4 (try resizing the browser window).

This webpage is perfect, as it provides client side live resizing (rather than formatting to some fixed width in the LSP). Notice the block {τ : ℝ} wraps as a chunk, and even much bigger things wrap as a block like [normed_group E] and so on. We should copy this nice CSS implementation to the InfoView.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the InfoView implementation in this VS Code extension and inspect how displayed snippets are currently rendered. Compare its behavior with the linked mathlib documentation page, especially when resizing the browser window, and identify the existing CSS approach to reproduce. Done means long snippets wrap into readable blocks without horizontal scrolling while preserving grouped constructs such as {τ : ℝ} and [normed_group E].

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.