From d1c9ba162222075795c0072c029dbdd7f54b177f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Voron?= Date: Fri, 3 Jan 2025 17:02:18 +0100 Subject: [PATCH] dx: fix VS Code mypy configuration to dramatically speed up things That damned extension was implicitly using its builtin version instead of our own. The result? The two of them were constantly overriding the cache, so mypy was very often starting from cold! --- polar.code-workspace | 2 ++ server/.vscode/settings.json | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/polar.code-workspace b/polar.code-workspace index a55e6d85aa..0b04ee4fa1 100644 --- a/polar.code-workspace +++ b/polar.code-workspace @@ -17,5 +17,7 @@ // Set the Python interpreter globally, so VS Code stops complaining about invalid interpreter on other folders // Also fix the Ruff extension "python.defaultInterpreterPath": "${workspaceFolder:server}/.venv/bin/python", + // Use our own version of mypy, to avoid cache conflicts between the extension version and our own version + "mypy-type-checker.importStrategy": "fromEnvironment", } } diff --git a/server/.vscode/settings.json b/server/.vscode/settings.json index b0d0b97db3..84da7c7fa2 100644 --- a/server/.vscode/settings.json +++ b/server/.vscode/settings.json @@ -25,5 +25,6 @@ }, "editor.defaultFormatter": "charliermarsh.ruff" }, - "ruff.lint.args": ["--config=ruff.vscode.toml"] + "ruff.lint.args": ["--config=ruff.vscode.toml"], + "mypy-type-checker.preferDaemon": true }