Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Write Your Python Program - CHANGELOG

* 2.0.9 (2025-10-27)
* Overwrite path to old plugin versions #188
* 2.0.8 (2025-10-16)
* Fix vscode warning for literals
* Fix highlighting for files with umlauts
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Write Your Python Program!",
"description": "A user friendly python environment for beginners",
"license": "See license in LICENSE",
"version": "2.0.8",
"version": "2.0.9",
"publisher": "StefanWehr",
"icon": "icon.png",
"engines": {
Expand Down
10 changes: 7 additions & 3 deletions python/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"python.analysis.diagnosticMode": "workspace",
"python.autoComplete.extraPaths": [
"/Users/swehr/.vscode/extensions/stefanwehr.write-your-python-program-1.3.2/python/src/"
]
"python.analysis.diagnosticSeverityOverrides": {
"reportWildcardImportFromLibrary": "none"
},
"python.analysis.extraPaths": [
"/Users/swehr/.vscode/extensions/stefanwehr.write-your-python-program-2.0.7/python/code/"
],
"python.analysis.typeCheckingMode": "off"
}
15 changes: 12 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ async function fixPylanceConfig(
// turn typechecking off
// This is a quite distructive change, so we do it on first hit of the run button
// not on-load of the plugin
const libDir = context.asAbsolutePath('python/code/');
const subDir = 'python/code';
const libDir = context.asAbsolutePath(subDir);

const cfg = vscode.workspace.getConfiguration('python', folder?.uri);
const target = folder ? vscode.ConfigurationTarget.WorkspaceFolder
Expand Down Expand Up @@ -283,9 +284,17 @@ async function fixPylanceConfig(
// extraPaths
const keyExtraPaths = 'analysis.extraPaths';
const extra = cfg.get<string[]>(keyExtraPaths) ?? [];
if (!extra.includes(libDir)) {
const newExtra = [...extra, libDir];
// Filter out old plugin paths (paths containing 'write-your-python-program' but not matching current libDir)
const filtered = extra.filter(p => {
const isPluginPath = p.includes('stefanwehr.write-your-python-program') && p.includes(subDir);
return !isPluginPath;
});
if (!filtered.includes(libDir)) {
const newExtra = [...filtered, libDir];
await tryUpdate(keyExtraPaths, newExtra);
} else if (filtered.length !== extra.length) {
// libDir is already present but we removed old paths, so update anyway
await tryUpdate(keyExtraPaths, filtered);
}

// typechecking off
Expand Down