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

feat: better setup diagnostics #436

Merged
merged 47 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
29ebc7b
chore: remove pre-lake-serve compatibility
mhuisi Apr 24, 2024
28a3e17
refactor: projectInfo.ts
mhuisi Apr 24, 2024
b2fa1bf
chore: remove version cache
mhuisi Apr 24, 2024
c773fd2
chore: remove redundant catch
mhuisi Apr 24, 2024
5bf7816
feat: add version queries to setup diagnostics
mhuisi Apr 24, 2024
9a302a7
chore: remove checkLeanVersion and testLeanVersion
mhuisi Apr 25, 2024
1b16cc4
refactor: remove redundant version check & style refactor
mhuisi Apr 26, 2024
d6286d0
chore: simplify getLeanVersion and remove top-level Lean 3 version check
mhuisi Apr 26, 2024
5070965
refactor: simplify ensureClient
mhuisi Apr 29, 2024
cc244f8
refactor: clean up activation logic
mhuisi Apr 29, 2024
68e262b
chore: adjust tests for adjusted activation logic
mhuisi Apr 29, 2024
1ab7c40
chore: update typescript version
mhuisi Apr 29, 2024
15cc8ca
test: temporarily disable breaking changes test to run CI
mhuisi Apr 30, 2024
1a7fc6a
test: correctly wait for lean 4 feature activation
mhuisi Apr 30, 2024
1b968d3
refactor: lift out lean 4 installation to extension.ts
mhuisi Apr 30, 2024
e148017
feat: global diagnostics
mhuisi Apr 30, 2024
5fb8b0a
test: fix pre-bootstrap test
mhuisi Apr 30, 2024
73b1363
test: remove 'no elan' tests and DISABLE_ELAN flag
mhuisi Apr 30, 2024
a59a773
feat: project diagnostics
mhuisi May 2, 2024
ecbe85f
feat: setup info command
mhuisi May 2, 2024
014bdad
feat: improve error output
mhuisi May 2, 2024
33f554e
refactor: clean up config.ts
mhuisi May 3, 2024
6d07224
refactor: remove PATH adjacent settings
mhuisi May 3, 2024
7bf9d03
feat: add path extension config option
mhuisi May 3, 2024
de28b33
chore: move projectDiagnostics.ts
mhuisi May 3, 2024
30e09b0
feat: add setting to disable setup warnings
mhuisi May 3, 2024
f498853
chore: improve warning
mhuisi May 3, 2024
851106f
feat: improve full diagnostics logic and output
mhuisi May 3, 2024
c79a206
test: check whether `findProgramInPath` is really necessary
mhuisi May 3, 2024
10419ce
refactor: `findProgramInPath` turns out to be unnecessary, so remove it
mhuisi May 3, 2024
135f924
feat: improve initial installation UX
mhuisi May 3, 2024
acf9523
test: remove pre-bootstrap test
mhuisi May 3, 2024
5bd7d6f
doc: augment setup guide
mhuisi May 3, 2024
d9d6687
chore: re-enable breaking change test and bump infoview major version
mhuisi May 3, 2024
67e2e06
chore: less drastic infoview major version bump
mhuisi May 6, 2024
c03d523
feat: check whether `lake --version` works before launching
mhuisi May 6, 2024
eb3b9b9
feat: only display batch execution progress bar after 250ms
mhuisi May 6, 2024
09403cf
fix: report full output in case of execution error
mhuisi May 6, 2024
eb98453
feat: trim batch output
mhuisi May 6, 2024
e7a4c0a
feat: add `elan show` to troubleshooting info and improve output style
mhuisi May 6, 2024
aaeb397
feat: optimize troubleshooting output for copy & pasting
mhuisi May 6, 2024
eef5dad
fix: notification control flow
mhuisi May 7, 2024
b3a1f1e
refactor: remove redundant `async`
mhuisi May 7, 2024
88c1564
test: temporarily disable breaking test to run CI again
mhuisi May 7, 2024
c00252d
chore: re-enable breaking test
mhuisi May 7, 2024
f5bdfaf
feat: display error when `elan self update` fails
mhuisi May 7, 2024
c02ec3b
chore: update current-release
mhuisi May 7, 2024
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
35 changes: 0 additions & 35 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@
"webRoot": "${workspaceRoot}/vscode-lean4/media"
}
},
{
"name": "Extension Tests - pre-bootstrap tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/vscode-lean4",
"--extensionTestsPath=${workspaceFolder}/vscode-lean4/out/test/suite/index",
"${workspaceFolder}/vscode-lean4/test/test-fixtures/simple"
],
"env": {
"LEAN4_TEST_FOLDER": "pre-bootstrap",
"LEAN4_PROMPT_USER": "true"
},
"cwd": "${workspaceFolder}/vscode-lean4/out/",
"outFiles": ["${workspaceFolder}/vscode-lean4/out/test/suite/**/*.js"],
"preLaunchTask": "watchTest"
},
{
"name": "Extension Tests - bootstrap tests",
"type": "extensionHost",
Expand Down Expand Up @@ -67,23 +49,6 @@
"outFiles": ["${workspaceFolder}/vscode-lean4/out/test/suite/**/*.js"],
"preLaunchTask": "watchTest"
},
{
"name": "Extension Tests - adhoc with no elan",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/vscode-lean4",
"--extensionTestsPath=${workspaceFolder}/vscode-lean4/out/test/suite/index"
],
"env": {
"LEAN4_TEST_FOLDER": "simple",
"DISABLE_ELAN": "1"
},
"cwd": "${workspaceFolder}/vscode-lean4/out/",
"outFiles": ["${workspaceFolder}/vscode-lean4/out/test/suite/**/*.js"],
"preLaunchTask": "watchTest"
},
{
"name": "Extension Tests - infoview",
"type": "extensionHost",
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,6 @@ This extension contributes the following settings (for a complete list, open the

### Server settings

* `lean4.toolchainPath`: specifies the location of the Lean toolchain to be used when starting the Lean language server. Most users (i.e. those using `elan`) should not ever need to change this. If you are bundling Lean and `vscode-lean` with [Portable mode VS Code](https://code.visualstudio.com/docs/editor/portable), you might find it useful to specify a relative path to Lean. This can be done by starting this setting string with `%extensionPath%`; the extension will replace this with the absolute path of the extension folder. For example, with the default directory setup in Portable mode, `%extensionPath%/../../../lean` will point to `lean` in the same folder as the VS Code executable / application.

* `lean4.lakePath`: specifies the location of the Lake executable to be used when starting the Lean language server (when possible). If left unspecified, the extension defaults to the Lake executable bundled with the Lean toolchain. Most users thus do not need to use this setting. It is only really helpful if you are building a Lake executable from the source and wish to use it with this extension.

* `lean4.serverEnv`: specifies any Environment variables to add to the Lean 4 language server environment. Note that when opening a [remote folder](https://code.visualstudio.com/docs/remote/ssh) using VS Code the Lean 4 language server will be running on that remote machine.

* `lean4.serverEnvPaths`: specifies any additional paths to add to the Lean 4 language server environment PATH variable.

* `lean4.serverArgs`: specifies any additional arguments to pass on the `lean --server` command line.

* `lean4.serverLogging.enabled`: specifies whether to do additional logging of
Expand Down
2 changes: 1 addition & 1 deletion lean4-infoview-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"license": "Apache-2.0",
"devDependencies": {
"typescript": "^4.9.5",
"typescript": "^5.4.5",
"vscode-languageserver-protocol": "^3.17.3"
}
}
6 changes: 3 additions & 3 deletions lean4-infoview/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leanprover/infoview",
"version": "0.6.1",
"version": "0.7.0",
"description": "An interactive display for the Lean 4 theorem prover.",
"scripts": {
"watch": "rollup --config --environment NODE_ENV:development --watch",
Expand Down Expand Up @@ -39,12 +39,12 @@
"@types/marked": "^4.3.1",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"current-release": "npm:@leanprover/infoview@^0.4.0",
"current-release": "npm:@leanprover/infoview@^0.7.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^3.26.2",
"rollup-plugin-css-only": "^4.3.0",
"typescript": "^4.9.5"
"typescript": "^5.4.5"
},
"dependencies": {
"@leanprover/infoview-api": "~0.4.0",
Expand Down
41 changes: 21 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lint-staged": "^15.2.2",
"prettier": "3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"typescript": "^4.9.5"
"typescript": "^5.4.5"
},
"lint-staged": {
"*.{ts,tsx,js}": [
Expand Down
4 changes: 3 additions & 1 deletion vscode-lean4/media/guide-help.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
## Collecting VS Code Output
If you are encountering an issue with this VS Code extension, copying the output from the 'Lean: Editor' output panel can be helpful for others who are trying to help you.
If you are encountering an issue with Lean or this VS Code extension, copying the output from the 'Lean: Editor' output panel can be helpful for others who are trying to help you.
You can open the 'Lean: Editor' output panel by clicking on the ∀-symbol in the top right and selecting 'Troubleshooting: Show Output'.

![Show Output](show-output.png)

Additionally, copying the information that is displayed when clicking on the ∀-symbol in the top right and selecting 'Troubleshooting: Show Setup Information' is also very helpful.

## Asking Questions on the Lean Zulip Chat

To post a question on the [Lean Zulip chat](https://leanprover.zulipchat.com/), you can follow these steps:
Expand Down
58 changes: 22 additions & 36 deletions vscode-lean4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
"type": "object",
"title": "Lean 4",
"properties": {
"lean4.toolchainPath": {
"type": "string",
"default": "",
"markdownDescription": "**DO NOT CHANGE** unless you know what you are doing. Path to your Lean toolchain. Leave this blank to get the default location from your PATH environment or from the default elan install location.",
"scope": "machine-overridable"
},
"lean4.input.enabled": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -73,36 +67,14 @@
"default": false,
"markdownDescription": "Enable automatically building dependencies when opening a file. In Lean versions pre-4.2.0, dependencies are always built automatically regardless of this setting."
},
"lean4.serverEnv": {
"type": "object",
"default": {},
"description": "Environment variables to add to the Lean 4 server environment",
"additionalProperties": {
"type": "string",
"description": "environment variable to add"
},
"scope": "machine-overridable"
},
"lean4.serverEnvPaths": {
"lean4.envPathExtensions": {
"type": "array",
"default": [],
"description": "Paths to add to the Lean 4 server environment PATH variable.",
"markdownDescription": "Additional entries to add to the PATH variable of the Lean 4 VS Code extension process and any of its child processes.",
"items": {
"type": "string",
"description": "a path to add to the environment"
},
"scope": "machine-overridable"
},
"lean4.enableLake": {
"type": "boolean",
"default": true,
"markdownDescription": "Enable Lake server when possible."
},
"lean4.lakePath": {
"type": "string",
"default": "",
"markdownDescription": "Path to Lake. Leave this blank to use the Lake from the toolchain.",
"scope": "machine-overridable"
"description": "Entry to add to the PATH variable"
}
},
"lean4.serverArgs": {
"type": "array",
Expand Down Expand Up @@ -184,10 +156,10 @@
"default": 200,
"description": "Time (in milliseconds) which must pass since latest edit until elaboration begins. Lower values may make editing feel faster at the cost of higher CPU usage."
},
"lean4.showInvalidProjectWarnings": {
"lean4.showSetupWarnings": {
"type": "boolean",
"default": true,
"markdownDescription": "Show warnings whenever a .lean-file is opened in a folder that does not contain a 'lean-toolchain' file."
"markdownDescription": "Show warning notifications when the Lean setup has warning-level issues."
},
"lean4.alwaysShowTitleBarMenu": {
"type": "boolean",
Expand Down Expand Up @@ -313,6 +285,12 @@
"title": "Troubleshooting: Show Output",
"description": "Show output channel containing all progress updates and errors of commands"
},
{
"command": "lean4.troubleshooting.showSetupInformation",
"category": "Lean 4",
"title": "Troubleshooting: Show Setup Information",
"description": "Show setup information for the environment that the VS Code extension is running in"
},
{
"command": "lean4.setup.showSetupGuide",
"category": "Lean 4",
Expand Down Expand Up @@ -561,6 +539,9 @@
{
"command": "lean4.troubleshooting.showOutput"
},
{
"command": "lean4.troubleshooting.showSetupInformation"
},
{
"command": "lean4.setup.showSetupGuide"
},
Expand Down Expand Up @@ -634,6 +615,11 @@
"when": "config.lean4.alwaysShowTitleBarMenu || lean4.isLeanFeatureSetActive",
"group": "4_troubleshooting"
},
{
"command": "lean4.troubleshooting.showSetupInformation",
"when": "config.lean4.alwaysShowTitleBarMenu || lean4.isLeanFeatureSetActive",
"group": "4_troubleshooting"
},
{
"submenu": "lean4.titlebar.versions",
"when": "config.lean4.alwaysShowTitleBarMenu || lean4.isLeanFeatureSetActive",
Expand Down Expand Up @@ -902,7 +888,7 @@
"test": "node ./out/test/suite/runTest.js"
},
"dependencies": {
"@leanprover/infoview": "~0.6.1",
"@leanprover/infoview": "~0.7.0",
"@leanprover/infoview-api": "~0.4.0",
"axios": "^1.6.7",
"cheerio": "^1.0.0-rc.12",
Expand All @@ -928,7 +914,7 @@
"ovsx": "^0.8.3",
"source-map-loader": "^3.0.2",
"ts-loader": "^9.5.1",
"typescript": "^4.9.5",
"typescript": "^5.4.5",
"webpack": "^5.90.3",
"webpack-cli": "^4.10.0"
},
Expand Down
Loading
Loading