-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix env var warning description #25758
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { ExtensionContext, Uri } from 'vscode'; | ||
| import { ExtensionContext, MarkdownString, Uri } from 'vscode'; | ||
| import * as path from 'path'; | ||
| import { copy, createDirectory, getConfiguration, onDidChangeConfiguration } from '../common/vscodeApis/workspaceApis'; | ||
| import { EXTENSION_ROOT_DIR } from '../constants'; | ||
| import { Interpreters } from '../common/utils/localize'; | ||
|
|
||
| async function applyPythonStartupSetting(context: ExtensionContext): Promise<void> { | ||
| const config = getConfiguration('python'); | ||
|
|
@@ -21,11 +22,17 @@ async function applyPythonStartupSetting(context: ExtensionContext): Promise<voi | |
| const sourcePath = path.join(EXTENSION_ROOT_DIR, 'python_files', 'pythonrc.py'); | ||
| await copy(Uri.file(sourcePath), destPath, { overwrite: true }); | ||
| context.environmentVariableCollection.replace('PYTHONSTARTUP', destPath.fsPath); | ||
| // When shell integration is enabled, we disable PyREPL from cpython. | ||
| // When shell integration is enabled, we disable PyREPL from cpython. | ||
| context.environmentVariableCollection.replace('PYTHON_BASIC_REPL', '1'); | ||
| context.environmentVariableCollection.description = new MarkdownString( | ||
| Interpreters.shellIntegrationEnvVarCollectionDescription, | ||
| ); | ||
| } else { | ||
| context.environmentVariableCollection.delete('PYTHONSTARTUP'); | ||
| context.environmentVariableCollection.delete('PYTHON_BASIC_REPL'); | ||
| context.environmentVariableCollection.description = new MarkdownString( | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Tyriar Not sure if Im doing something wrong here.. maybe this is bug in env collection?? I noticed when we remove the contribution to environment variable, it doesnt consider description if I try to set them:
Weird bc description showed up when replacing these variable.. just not when deleting these variables. |
||
| Interpreters.shellIntegrationDisabledEnvVarCollectionDescription, | ||
| ); | ||
| } | ||
| } | ||
|
|
||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also used here:
vscode-python/src/client/terminals/envCollectionActivation/service.ts
Lines 408 to 415 in 0b477a3
There's meant to only be a single description to cover everything, but the above also uses scoped and I'm not sure how that interacts here.