From b72355d62889900e963f5a70a99c5ffc9fe8e50d Mon Sep 17 00:00:00 2001 From: Stella <100439259+StellaHuang95@users.noreply.github.com> Date: Tue, 17 Oct 2023 22:25:34 -0700 Subject: [PATCH] Fix warning that repeatedly shows up (#7731) * update versions exposed to users * fix warning repeatedly showing up * update debugpy version --- Build/debugpy-version.txt | 2 +- .../LanguageServerClient/PythonLanguageClient.cs | 12 ------------ .../PythonTools/Project/PythonProjectNode.cs | 9 +++++++++ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Build/debugpy-version.txt b/Build/debugpy-version.txt index 60fdb8d5d..afa2b3515 100644 --- a/Build/debugpy-version.txt +++ b/Build/debugpy-version.txt @@ -1 +1 @@ -1.6.7 \ No newline at end of file +1.8.0 \ No newline at end of file diff --git a/Python/Product/PythonTools/PythonTools/LanguageServerClient/PythonLanguageClient.cs b/Python/Product/PythonTools/PythonTools/LanguageServerClient/PythonLanguageClient.cs index dbd65fafc..4f70f64f3 100644 --- a/Python/Product/PythonTools/PythonTools/LanguageServerClient/PythonLanguageClient.cs +++ b/Python/Product/PythonTools/PythonTools/LanguageServerClient/PythonLanguageClient.cs @@ -396,18 +396,6 @@ namespace Microsoft.PythonTools.LanguageServerClient { PythonConstants.TypeCheckingModeSetting, null, Site, PythonWorkspaceContextProvider.Workspace, out _) ?? _analysisOptions.TypeCheckingMode; - var ver3 = new Version(3, 0); - var version = context.InterpreterConfiguration.Version; - // show a warning if the python version is not supported - if (version.ToLanguageVersion() == PythonLanguageVersion.None) - { - MessageBox.ShowWarningMessage(Site, Strings.PythonVersionNotSupportedInfoBarText.FormatUI(context.InterpreterConfiguration.Description)); - } - else if (context.InterpreterConfiguration.Version < ver3) - { - MessageBox.ShowWarningMessage(Site, Strings.WarningPython2NotSupported); - } - // get task list tokens from options var taskListTokens = new List(); var taskListService = Site.GetService(); diff --git a/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs b/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs index 269765c06..46c0c2b6c 100644 --- a/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs @@ -28,6 +28,7 @@ using System.Xml.XPath; using Microsoft.Build.Execution; using Microsoft.PythonTools.Commands; using Microsoft.PythonTools.Common; +using Microsoft.PythonTools.Common.Parsing; using Microsoft.PythonTools.Environments; using Microsoft.PythonTools.Infrastructure; using Microsoft.PythonTools.Interpreter; @@ -273,6 +274,14 @@ namespace Microsoft.PythonTools.Project { MSBuildConstants.InterpreterIdProperty, ReplaceMSBuildPath(_active.Configuration.Id) ); + var ver3 = new Version(3, 0); + var version = _active.Configuration.Version; + // show a warning if the python version is not supported + if (version.ToLanguageVersion() == PythonLanguageVersion.None) { + Utility.MessageBox.ShowWarningMessage(Site, Strings.PythonVersionNotSupportedInfoBarText.FormatUI(_active.Configuration.Description)); + } else if (_active.Configuration.Version < ver3) { + Utility.MessageBox.ShowWarningMessage(Site, Strings.WarningPython2NotSupported); + } } else { BuildProject.SetProperty(MSBuildConstants.InterpreterIdProperty, ""); }