Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
40ad7fc
feat: refinements for 185 (#553)
mhuisi Dec 5, 2024
08f121b
Release 0.0.186
mhuisi Dec 5, 2024
1098740
refactor: replace require-style imports (#504)
abentkamp Dec 10, 2024
45c3616
fix: dispose webviewPanel in InfoProvider.dispose (#514)
abentkamp Dec 10, 2024
2a1241f
refactor: rewrite logger to be compatible with browser (#494)
abentkamp Dec 10, 2024
d8f8169
feat: support importing widget modules by hash (#557)
Vtec234 Dec 16, 2024
c5293e4
chore: better error when request is sent to inactive client (#560)
mhuisi Dec 18, 2024
9efc61b
feat: support for elan 4.0.0 (#554)
mhuisi Jan 8, 2025
62107a6
chore: bump infoview minor version (#563)
mhuisi Jan 8, 2025
a3b4a57
Release 0.0.187 (pre-release)
mhuisi Jan 8, 2025
9b2d75d
doc: minor adjustments to manual and setup guide (#564)
mhuisi Jan 8, 2025
0df0cb2
feat: add (un)select context menu options (#451)
Vtec234 Jan 13, 2025
a3c0d29
Release 0.0.188 (pre-release)
Vtec234 Jan 13, 2025
4a70fcc
fix: escape language client document selector glob (#566)
mhuisi Jan 13, 2025
dbd82c9
Release 0.0.189 (pre-release)
mhuisi Jan 13, 2025
8663c3b
fix: curly bracket glob escape (#569)
mhuisi Jan 13, 2025
d85f00a
Release 0.0.190 (pre-release)
mhuisi Jan 13, 2025
3f499d0
Release 0.0.191 (pre-release)
mhuisi Jan 13, 2025
d13d83e
fix: redundant line breaks in trace messages (#571)
mhuisi Jan 30, 2025
256a36c
Release 0.0.192
mhuisi Jan 30, 2025
c10f042
fix: confusing elan installation prompt (#576)
mhuisi Jan 30, 2025
2a9d538
Release 0.0.193
mhuisi Jan 30, 2025
9fbca4d
fix: do not suggest that installing elan also installs lean (#577)
mhuisi Jan 30, 2025
f95786d
Release 0.0.194
mhuisi Jan 30, 2025
5f3dc55
feat: simplex abbreviations (#579)
gio256 Feb 25, 2025
d1e89f3
chore: document white-space fix for firefox (#575)
jakobvase Feb 25, 2025
cc0ae6f
fix: only prevent default for `tab` if it replaces something (#572)
jakobvase Feb 25, 2025
bc6ed51
chore: bump unicode input versions (#581)
mhuisi Feb 25, 2025
8e56484
chore: revert #571 (#582)
mhuisi Feb 25, 2025
fa03bbc
Release 0.0.195
mhuisi Feb 25, 2025
c4d12fc
chore: bump unicode input versions again (#583)
mhuisi Feb 27, 2025
90eb615
feat: editor decorations (#585)
mhuisi Mar 7, 2025
fd8ad21
Release 0.0.196 (pre-release)
mhuisi Mar 7, 2025
5875bfa
fix: use 1ch unsolved goal padding instead of 1em (#587)
mhuisi Mar 8, 2025
ad0a17f
Release 0.0.197 (pre-release)
mhuisi Mar 8, 2025
96d35bd
feat: add abbreviation `xs` for `×ˢ`, denoting the product set (#588)
jhanschoo Mar 11, 2025
681200b
feat: expose client-side language server logging in config (#589)
mhuisi Mar 11, 2025
1bbb32f
chore: bump unicode input versions and add publish action for unicode…
mhuisi Mar 11, 2025
e844f6a
Release 0.0.198 (pre-release)
mhuisi Mar 11, 2025
a58d976
feat: adjust edit delay and make it configurable (#593)
mhuisi Mar 19, 2025
bdc7471
feat: add `\tiny` and `\miny` for `⧾` and `⧿` (#591)
vihdzp Mar 19, 2025
36b777d
Release 0.0.199 (pre-release)
mhuisi Mar 19, 2025
4a53e11
feat: theme colors in 'unsolved goals' decoration (#595)
mhuisi Mar 26, 2025
917858c
Release 0.0.200 (pre-release)
mhuisi Mar 26, 2025
82a347b
Release 0.0.201
mhuisi Mar 27, 2025
de1093a
feat: add uri handler for the setup-guide (#596)
algebraic-dev Mar 29, 2025
a56f7ea
chore: rename the unused "8<" abbreviation as "scissor" to fix subscr…
euprunin Apr 7, 2025
389bb4d
test: make tests more stable (#601)
mhuisi Apr 8, 2025
4c7cbdd
chore: bump unicode input version (#600)
mhuisi Apr 8, 2025
ccbfe24
feat: improve decoration computation performance (#604)
mhuisi Apr 8, 2025
c1d143d
feat: errors for nested projects (#607)
mhuisi Apr 15, 2025
6504d3c
Release 0.0.202
mhuisi Apr 15, 2025
17ffa26
feat: make lean files in `.lake` and `.elan` read-only (#608)
mhuisi Apr 17, 2025
9cf599c
feat: error when opening project that contains lakefile but no lean-t…
mhuisi Apr 17, 2025
ba0d7e4
Release 0.0.203
mhuisi Apr 17, 2025
0d094aa
feat: sorted installed toolchains (#611)
mhuisi Apr 18, 2025
d310b9c
feat: improve activation error when forked extension is installed (#613)
mhuisi Apr 23, 2025
8e34c2e
feat: revamp infoview options and actions (#606)
mhuisi Apr 23, 2025
44bf3e6
Release 0.0.204
mhuisi Apr 23, 2025
aca0e14
fix: don't display popups during mouse selection (#615)
mhuisi Apr 30, 2025
5a938ad
Release 0.0.205
mhuisi Apr 30, 2025
59d6669
fix: workaround for invalid lake version in v4.21.0-rc1 (#618)
mhuisi Jun 3, 2025
6421d7c
Release 0.0.206
mhuisi Jun 3, 2025
50d57f2
feat: improve server startup progress bar message (#619)
mhuisi Jun 4, 2025
32297b5
Release 0.0.207
mhuisi Jun 4, 2025
b8fc222
chore: remove the redundant `include: #stringBlock` in lean4 syntax (…
YDX-2147483647 Jun 9, 2025
78194a5
feat: allow using language id `lean` in markdown code blocks (#622)
mhuisi Jun 10, 2025
9b32ef6
feat: improve `lake exe cache get` error reporting (#621)
mhuisi Jun 10, 2025
9384651
feat: better error message for windows antivirus cache errors (#624)
mhuisi Jun 10, 2025
a031ec6
feat: client-side for module hierarchy (#620)
mhuisi Jun 11, 2025
b365c1b
Release 0.0.208 (pre-release)
mhuisi Jun 11, 2025
514362b
Release 0.0.209
mhuisi Jun 26, 2025
dadb4e4
feat: add abbreviation for `HEq` (#632)
Rob23oba Jul 21, 2025
912ca19
feat: add a second two sided abbreviation for ‖z‖ (#634)
Julian Jul 21, 2025
a6ddeaa
feat: abbeviations for macrons (ā, ō, etc.) (#633)
Komyyy Jul 21, 2025
e2a767e
doc: update manual for changes since january (#635)
mhuisi Jul 22, 2025
9d5c0f2
chore: bump unicode input (#636)
mhuisi Jul 22, 2025
1590e3b
feat: activate lean features on all files in a project (#637)
mhuisi Jul 24, 2025
bd30f68
feat: alias `\dot` and `\cdot` to `\centerdot` (#639)
mhuisi Jul 24, 2025
e74069a
chore: bump recommended elan version to 4.0.0 (#640)
mhuisi Jul 24, 2025
6c99ca6
fix: offer update options for all dependencies in manifest (#638)
mhuisi Jul 25, 2025
0f48f56
hack: *
alissa-tung Nov 25, 2024
8da16ac
fix: rewrite dynamic imports
Austaras Jan 9, 2025
22b91ef
hack: tooltip left
alissa-tung Jan 13, 2025
16b414d
hack: hide restart file button
alissa-tung Jun 18, 2025
a30369a
hack: set z-index to tooltip
SayaOvO Jun 25, 2025
3af8ca9
*: fix
SayaOvO Jun 30, 2025
8eb68c5
fix
SayaOvO Jun 30, 2025
92bfd9d
fix: dynamic load module
SayaOvO Aug 13, 2025
cd65261
hack: local tachyons.css
alissa-tung Jul 6, 2025
5b0fe7a
fix: upstream key prop bug
SayaOvO Aug 13, 2025
1171090
*: tooltips zIndex
SayaOvO Nov 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ jobs:
run: |
npm publish --workspace=lean4-infoview --access=public

- name: Try publishing unicode-input
if: ${{ startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, '-pre') && matrix.os == 'ubuntu-latest' }}
continue-on-error: true
run: |
npm publish --workspace=lean4-unicode-input --access=public

- name: Try publishing unicode-input-component
if: ${{ startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, '-pre') && matrix.os == 'ubuntu-latest' }}
continue-on-error: true
run: |
npm publish --workspace=lean4-unicode-input-component --access=public

- name: Package
run: npm run package --workspace=lean4
if: ${{ !startsWith(github.ref, 'refs/tags/v') || !endsWith(github.ref, '-pre') }}
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ After installing this extension, a 'Welcome' page with a setup guide should open
- Setting up a Lean 4 project
- Troubleshooting issues

If the setup guide does not open automatically, you can still open it manually by opening an empty file, clicking on the ∀-symbol in the top right and selecting 'Documentation…' > 'Docs: Show Setup Guide'.
If the setup guide does not open automatically, you can still open it manually by opening an empty file, clicking on the ∀-symbol in the top right and selecting 'Documentation…' > 'Show Setup Guide'.

![Setup guide with instructions for how to re-open the setup guide manually](https://github.com/leanprover/vscode-lean4/raw/HEAD/vscode-lean4/images/setup_guide.png)

Expand Down
2 changes: 1 addition & 1 deletion lean4-infoview-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leanprover/infoview-api",
"version": "0.4.0",
"version": "0.7.0",
"description": "Types and API for @leanprover/infoview.",
"scripts": {
"watch": "tsc --watch",
Expand Down
84 changes: 67 additions & 17 deletions lean4-infoview-api/src/infoviewApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ import type {
WorkspaceEdit,
} from 'vscode-languageserver-protocol'

export type ExpectedTypeVisibility = 'Expanded by default' | 'Collapsed by default' | 'Hidden'

export interface InfoviewConfig {
allErrorsOnLine: boolean
autoOpenShowsGoal: boolean
debounceTime: number
expectedTypeVisibility: ExpectedTypeVisibility
showGoalNames: boolean
emphasizeFirstGoal: boolean
reverseTacticState: boolean
hideTypeAssumptions: boolean
hideInstanceAssumptions: boolean
hideInaccessibleAssumptions: boolean
hideLetValues: boolean
showTooltipOnHover: boolean
}

/**
* An insert `here` should be written exactly at the specified position,
* while one `above` should go on the preceding line.
Expand All @@ -15,6 +32,8 @@ export type TextInsertKind = 'here' | 'above'

/** Interface that the InfoView WebView uses to talk to the hosting editor. */
export interface EditorApi {
saveConfig(config: InfoviewConfig): Promise<any>

/** Make a request to the LSP server. */
sendClientRequest(uri: string, method: string, params: any): Promise<any>
/** Send a notification to the LSP server. */
Expand Down Expand Up @@ -77,25 +96,18 @@ export interface InfoviewTacticStateFilter {
flags: string
}

export interface InfoviewConfig {
allErrorsOnLine: boolean
autoOpenShowsGoal: boolean
debounceTime: number
showExpectedType: boolean
showGoalNames: boolean
emphasizeFirstGoal: boolean
reverseTacticState: boolean
showTooltipOnHover: boolean
}

export const defaultInfoviewConfig: InfoviewConfig = {
allErrorsOnLine: true,
autoOpenShowsGoal: true,
debounceTime: 50,
showExpectedType: true,
expectedTypeVisibility: 'Expanded by default',
showGoalNames: true,
emphasizeFirstGoal: false,
reverseTacticState: false,
hideTypeAssumptions: false,
hideInstanceAssumptions: false,
hideInaccessibleAssumptions: false,
hideLetValues: false,
showTooltipOnHover: true,
}

Expand All @@ -108,6 +120,46 @@ export type InfoviewActionKind =

export type InfoviewAction = { kind: InfoviewActionKind }

export type ContextMenuEntry =
| 'goToDefinition'
| 'select'
| 'unselect'
| 'unselectAll'
| 'pause'
| 'unpause'
| 'pin'
| 'unpin'
| 'refresh'
| 'pauseAllMessages'
| 'unpauseAllMessages'
| 'goToPinnedLocation'
| 'goToMessageLocation'
| 'displayTargetBeforeAssumptions'
| 'displayAssumptionsBeforeTarget'
| 'hideTypeAssumptions'
| 'showTypeAssumptions'
| 'hideInstanceAssumptions'
| 'showInstanceAssumptions'
| 'hideInaccessibleAssumptions'
| 'showInaccessibleAssumptions'
| 'hideLetValues'
| 'showLetValues'
| 'hideGoalNames'
| 'showGoalNames'
| 'emphasizeFirstGoal'
| 'deemphasizeFirstGoal'
| 'saveSettings'

export interface ContextMenuAction {
entry: ContextMenuEntry
/**
* An entry-specific identifier extracted from `data-vscode-context`.
* For example, for `goToDefinition` it is the value of `interactiveCodeTagId`.
* See https://code.visualstudio.com/api/extension-guides/webview#context-menus.
*/
id: string
}

/** Interface the hosting editor uses to talk to the InfoView WebView. */
export interface InfoviewApi {
/** Must be called exactly once on initialization with the current cursor position. */
Expand Down Expand Up @@ -147,11 +199,9 @@ export interface InfoviewApi {
requestedAction(action: InfoviewAction): Promise<void>

/**
* Must fire whenever the user requests to go to a definition using the infoview context menu.
* `interactiveCodeTagId` is obtainable from the `data-vscode-context` field in
* `InteractiveCodeTag`s in the InfoView. See https://code.visualstudio.com/api/extension-guides/webview#context-menus.
*/
goToDefinition(interactiveCodeTagId: string): Promise<void>
* Must fire whenever the user clicks an infoview-specific context menu entry.
**/
clickedContextMenu(action: ContextMenuAction): Promise<void>

/**
* Execute the given JavaScript code inside the infoview. Must not be used
Expand Down
14 changes: 14 additions & 0 deletions lean4-infoview-api/src/lspTypes.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
import type {
Diagnostic,
DocumentUri,
integer,
Range,
TextDocumentPositionParams,
VersionedTextDocumentIdentifier,
} from 'vscode-languageserver-protocol'

// Lean 4 extensions to LSP.

export enum LeanTag {
UnsolvedGoals = 1, // introduced in 2025-03-05
GoalsAccomplished = 2, // introduced in 2025-03-05
}

/** Used in place of {@link Diagnostic} within `textDocument/publishDiagnostics`. */
export interface LeanDiagnostic extends Diagnostic {
fullRange?: Range // introduced in 2021-03-10
isSilent?: boolean // introduced in 2025-03-05
leanTags?: LeanTag[] // introduced in 2025-03-05
}

export interface LeanPublishDiagnosticsParams {
uri: DocumentUri
version?: integer
diagnostics: LeanDiagnostic[]
}

export interface PlainGoal {
Expand Down
17 changes: 9 additions & 8 deletions lean4-infoview/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leanprover/infoview",
"version": "0.7.9",
"version": "0.8.5",
"description": "An interactive display for the Lean 4 theorem prover.",
"scripts": {
"watch": "rollup --config --environment NODE_ENV:development --watch",
Expand All @@ -10,12 +10,12 @@
},
"exports": {
".": {
"default": "./dist/index.production.min.js",
"types": "./dist/index.d.ts"
"types": "./dist/index.d.ts",
"default": "./dist/index.production.min.js"
},
"./loader": {
"default": "./dist/loader.production.min.js",
"types": "./dist/loader.d.ts"
"types": "./dist/loader.d.ts",
"default": "./dist/loader.production.min.js"
},
"./package.json": "./package.json"
},
Expand All @@ -42,16 +42,17 @@
"react-dom": "^18.2.0",
"react-markdown": "^9.0.1",
"react-syntax-highlighter": "^15.5.0",
"remark-math": "^6.0.0",
"rehype-mathjax": "^6.0.0",
"remark-math": "^6.0.0",
"rollup": "^4.24.0",
"rollup-plugin-css-only": "^4.3.0",
"typescript": "^5.4.5"
},
"dependencies": {
"@leanprover/infoview-api": "~0.4.0",
"@vscode/codicons": "^0.0.32",
"@leanprover/infoview-api": "~0.7.0",
"@vscode-elements/react-elements": "^0.5.0",
"@vscode/codicons": "^0.0.32",
"es-module-lexer": "^1.6.0",
"es-module-shims": "^1.7.3",
"react-fast-compare": "^3.2.2",
"tachyons": "^4.12.0",
Expand Down
10 changes: 8 additions & 2 deletions lean4-infoview/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const output =
compact: true,
entryFileNames: '[name].production.min.js',
chunkFileNames: '[name]-[hash].production.min.js',
plugins: [terser()],
plugins: [terser({
format: {
comments: /webpackIgnore/,
}
})],
}
: {
dir: 'dist',
Expand Down Expand Up @@ -74,7 +78,9 @@ const configs = [
{
output: {
...output,
// Put `es-module-shims` in shim mode with support for dynamic `import`
// Put `es-module-shims` in shim mode, needed to support dynamic `import`s.
// This code has to be set before `es-module-shims` is loaded,
// so we put it in the Rollup intro.
intro: 'window.esmsInitOptions = { shimMode: true }',
},
plugins,
Expand Down
2 changes: 1 addition & 1 deletion lean4-infoview/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export { EditorContext, EnvPosContext, VersionContext } from './infoview/context
export { EditorConnection } from './infoview/editorConnection'
export { GoalLocation, GoalsLocation, LocationsContext } from './infoview/goalLocation'
export { InteractiveCode, InteractiveCodeProps, Markdown } from './infoview/interactiveCode'
export { renderInfoview } from './infoview/main'
export { renderInfoview, InfoviewFc } from './infoview/main'
export { RpcContext, useRpcSession } from './infoview/rpcSessions'
export { ServerVersion } from './infoview/serverVersion'
export { DynamicComponent, DynamicComponentProps, PanelWidgetProps, importWidgetModule } from './infoview/userWidget'
Expand Down
11 changes: 8 additions & 3 deletions lean4-infoview/src/infoview/collapsing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,24 @@ export function useIsVisible(): [(element: HTMLElement) => void, boolean] {
return [node, isVisible]
}

interface DetailsProps {
interface DetailsProps extends React.PropsWithoutRef<React.HTMLProps<HTMLDetailsElement>> {
initiallyOpen?: boolean
children: [React.ReactNode, ...React.ReactNode[]]
setOpenRef?: (_: React.Dispatch<React.SetStateAction<boolean>>) => void
}

/** Like `<details>` but can be programatically revealed using `setOpenRef`.
* The first child is placed inside the `<summary>` node. */
export function Details({ initiallyOpen, children: [summary, ...children], setOpenRef }: DetailsProps): JSX.Element {
export function Details({
initiallyOpen,
children: [summary, ...children],
setOpenRef,
...props
}: DetailsProps): JSX.Element {
const [isOpen, setOpen] = React.useState<boolean>(initiallyOpen === undefined ? false : initiallyOpen)
if (setOpenRef) setOpenRef(setOpen)
return (
<details open={isOpen}>
<details open={isOpen} {...props}>
<summary
className="mv2 pointer "
onClick={e => {
Expand Down
11 changes: 8 additions & 3 deletions lean4-infoview/src/infoview/contexts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import * as React from 'react'
import type { Diagnostic, DocumentUri } from 'vscode-languageserver-protocol'
import type { DocumentUri } from 'vscode-languageserver-protocol'

import { defaultInfoviewConfig, InfoviewConfig, LeanFileProgressProcessingInfo } from '@leanprover/infoview-api'
import {
defaultInfoviewConfig,
InfoviewConfig,
LeanDiagnostic,
LeanFileProgressProcessingInfo,
} from '@leanprover/infoview-api'

import { EditorConnection } from './editorConnection'
import { ServerVersion } from './serverVersion'
Expand All @@ -13,7 +18,7 @@ export const EditorContext = React.createContext<EditorConnection>(null as any)
export const VersionContext = React.createContext<ServerVersion | undefined>(undefined)

export const ConfigContext = React.createContext<InfoviewConfig>(defaultInfoviewConfig)
export const LspDiagnosticsContext = React.createContext<Map<DocumentUri, Diagnostic[]>>(new Map())
export const LspDiagnosticsContext = React.createContext<Map<DocumentUri, LeanDiagnostic[]>>(new Map())
export const ProgressContext = React.createContext<Map<DocumentUri, LeanFileProgressProcessingInfo[]>>(new Map())

/**
Expand Down
11 changes: 9 additions & 2 deletions lean4-infoview/src/infoview/editorConnection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Location, ShowDocumentParams } from 'vscode-languageserver-protocol'

import {
ContextMenuAction,
EditorApi,
InfoviewAction,
InfoviewActionKind,
Expand All @@ -12,9 +13,15 @@ import {
import { EventEmitter, Eventify } from './event'
import { DocumentPosition } from './util'

export type EditorEvents = Omit<Eventify<InfoviewApi>, 'requestedAction' | 'goToDefinition'> & {
export type EditorEvents = Omit<Eventify<InfoviewApi>, 'requestedAction' | 'clickedContextMenu'> & {
requestedAction: EventEmitter<InfoviewAction, InfoviewActionKind>
goToDefinition: EventEmitter<string, string>
/**
* Must fire whenever the user clicks an infoview-specific context menu entry.
*
* Keys for this event are of the form `` `${action.entry}:${action.id}` ``.
*/
clickedContextMenu: EventEmitter<ContextMenuAction, string>
goToDefinition?: EventEmitter<number, number>
}

/** Provides higher-level wrappers around functionality provided by the editor,
Expand Down
Loading
Loading