天天看點

Visual Studio Code中的Python – 2019年4月釋出 變量浏覽器和資料檢視器 (Variable Explorer and Data Viewer) 調試配置增強 (Enhancements to debug configuration ) Python語言伺服器的其他改進 (Additional improvements to the Python Language Server ) 其他變更和增強 (Other Changes and Enhancements )

We are pleased to announce that the April 2019 release of the Python Extension for Visual Studio Code is now available. You can download the Python extension from the Marketplace, or install it directly from the extension gallery in Visual Studio Code. You can learn more about Python support in Visual Studio Code in the documentation.

我們很高興地宣布,适用于Visual Studio Code的Python擴充的2019年4月版現已可用。 您可以從市場上下載下傳Python擴充 ,也可以直接從Visual Studio Code中的擴充庫安裝它。 您可以在文檔中了解有關Visual Studio Code中Python支援的更多資訊。

In this release we made a series of improvements that are listed in our changelog, closing a total of 84 issues including:

在此版本中,我們進行了一系列改進,這些改進已在變更日志中列出,共解決了84個問題,其中包括:

  • Variable Explorer and Data Viewer

    變量浏覽器和資料檢視器

  • Enhancements to debug configuration

    調試配置增強

  • Additional improvements to the Python Language Server

    Python語言伺服器的其他改進

Keep on reading to learn more!  

繼續閱讀以了解更多資訊!

Visual Studio Code中的Python – 2019年4月釋出 變量浏覽器和資料檢視器 (Variable Explorer and Data Viewer) 調試配置增強 (Enhancements to debug configuration ) Python語言伺服器的其他改進 (Additional improvements to the Python Language Server ) 其他變更和增強 (Other Changes and Enhancements )

變量浏覽器和資料檢視器 (Variable Explorer and Data Viewer)

The Python Interactive experience now comes with a built-in variable explorer along with a data viewer, a highly requested feature from our users. Now you can easily view, inspect and filter the variables in your application, including lists, NumPy arrays, pandas data frames, and more! 

現在,Python互動式體驗帶有内置的變量資料總管以及資料檢視器,這是使用者強烈要求的功能。 現在,您可以輕松地檢視,檢查和過濾應用程式中的變量,包括清單,NumPy數組,pandas資料框等等!

A variables section will now be shown when running code and cells in the Python Interactive window. Once you expand it, you’ll see the list of the variables in the current Jupyter session. More variables will show up automatically as they get used in the code. Clicking on each column header will sort the variables in the table. 

在“ Python互動式”視窗中運作代碼和單元格時,現在将顯示一個變量部分。 展開後,您将在目前的Jupyter會話中看到變量清單。 在代碼中使用它們時,更多變量将自動顯示。 單擊每個列标題将對表中的變量進行排序。

You can also double-click on each row or use the “Show variable in data viewer” button to view full data of each variable in the newly-added Data Viewer, as well as perform simple search over its values: 

您還可以輕按兩下每一行,或使用“在資料檢視器中顯示變量”按鈕在新添加的資料檢視器中檢視每個變量的完整資料,以及對其值進行簡單搜尋:

The Data Viewer requires pandas package 0.20 or later, and you will get a message to install or upgrade if it’s not available.    

資料檢視器需要0.20或更高版本的pandas軟體包,如果沒有可用的安裝或更新資訊,您将收到一條消息。

The Variable Explore is enabled by default. You can turn it off through File > Preferences > Settings and looking for the Python > Data Science: Show Jupyter Variable Explorer setting.

預設情況下啟用變量浏覽。 您可以通過“檔案”>“首選項”>“設定”,然後在“ Python”>“資料科學:顯示Jupyter Variable Explorer”設定中将其關閉。

調試配置增強 (Enhancements to debug configuration )

We simplified the process of configuring the debugger for your workspace. When you start debugging (through the Debug Panel, F5 or Debug > Start Debugging) and no debug configuration exists, you now will be prompted to create a debug configuration for your application. Creating a debug configuration is accomplished through a set of menus, instead of manually configuring the launch.json file.  

我們簡化了為您的工作區配置調試器的過程。 當您開始調試時(通過Debug Panel, F5或Debug> Start D ebugging ),并且不存在任何調試配置,現在将提示您為應用程式建立調試配置。 建立調試配置是通過一組菜單完成的,而不是手動配置launch.json檔案。

This prompt will also be displayed when adding another debug configuration through the launch.json file:

通過launch.json檔案添加另一個調試配置時,也會顯示此提示:

Python語言伺服器的其他改進 (Additional improvements to the Python Language Server )

This release includes several fixes and improvements to the Python Language Server. We added back features that were removed in the 0.2 release: “Rename Symbol”, “Go to Definition” and “Find All References”, and made improvements to loading time and memory usage when importing scientific libraries such as pandas, Plotly, PyQt5 , especially when running in full Anaconda environments.  

此版本包括對Python語言伺服器的一些修複和改進。 我們增加了0.2版中已删除的功能:“重命名符号”,“轉到定義”和“查找所有引用”,并在導入科學圖書館(如熊貓,Plotly,PyQt5,特别是在完整​​的Anaconda環境中運作時。

To opt-in to the Language Server, change the python.jediEnabled setting to false in File > Preferences > User Settings.  We are working towards making the language server the default in the next few releases, so if you run into problems, please file an issue on the Python Language Server GitHubpage.  

要選擇加入語言伺服器,請在File> Preferences> User Settings中将python.jediEnabled設定更改為false 。 我們正在努力在接下來的幾個版本中将語言伺服器設定為預設語言,是以,如果遇到問題,請在Python Language Server GitHub頁面上提出問題。

其他變更和增強 (Other Changes and Enhancements )

We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python in Visual Studio Code. Some notable changes include: 

我們還添加了一些小的增強功能,并解決了使用者要求的問題,這些問題應改善您在Visual Studio Code中使用Python的體驗。 一些值得注意的變化包括:

  • Change default behavior of debugger to display return values. (#3754) 

    更改調試器的預設行為以顯示傳回值。 ( #3754 )

  • Change “Unit Test” phrasing to “Test” or “Testing”. (#4384) 

    将“單元測試”短語更改為“測試”或“測試”。 ( #4384 )

  • Replace setting debugStdLib with justMyCode. (#4032) 

    用justMyCode替換設定debugStdLib。 ( #4032 )

  • Add setting to just enable/disable the data science codelens. (#5211) 

    添加設定以僅啟用/禁用資料科學編碼。 ( #5211 )

  • Improved reliability of test discovery when using pytest. (#4795) 

    使用pytest時提高了測試發現的可靠性。 ( #4795 )

  • Updates to README file. 

    更新為README檔案。

Visual Studio Code中的Python – 2019年4月釋出 變量浏覽器和資料檢視器 (Variable Explorer and Data Viewer) 調試配置增強 (Enhancements to debug configuration ) Python語言伺服器的其他改進 (Additional improvements to the Python Language Server ) 其他變更和增強 (Other Changes and Enhancements )

Be sure to download the Python extension for Visual Studio Code now to try out the above improvements. If you run into any problems, please file an issue on the Python VS Code GitHub page.  

請確定立即下載下傳适用于Visual Studio Code 的Python擴充 ,以嘗試上述改進。 如果遇到任何問題,請在Python VS Code GitHub頁面上送出問題。

盧西亞娜·德·梅洛·阿布 (Luciana de Melo e Abud)

Program Manager, Python extension in Visual Studio Code

程式管理器,Visual Studio Code中的Python擴充

翻譯自: https://habr.com/en/company/microsoft/blog/450708/