IntelliCode 的概觀Overview of IntelliCode

Visual Studio IntelliCode 利用人工智慧加強軟體開發。Visual Studio IntelliCode enhances software development using artificial intelligence. IntelliCode 可提供內容感知程式碼完成,並引導開發人員遵循其小組的模式與樣式IntelliCode delivers context-aware code completions and guides developers to adhere to the patterns and styles of their team. IntelliCode 隨附於 Visual Studio,在 Visual Studio Code 中則是以附加元件形式提供。IntelliCode is available in Visual Studio and as an extension for Visual Studio Code.

如需詳細資訊,並註冊新聞和更新,請參閱 Visual Studio IntelliCodeFor more information and to sign up for news and updates, see Visual Studio IntelliCode.

安裝 IntelliCodeInstall IntelliCode

開始之前,請確定您有可支援 IntelliCode 的 Visual Studio 或 Visual Studio Code 版本。Before you begin, ensure you have a version of Visual Studio or Visual Studio Code that supports IntelliCode. 基本需求為:The minimum requirements are:

  • Visual Studio Code 2018 年 10 月 1.29 版或更新版本Visual Studio Code October 2018 Release 1.29 or later
  • Visual Studio 2019 (任何版本)Visual Studio 2019 (any version and edition)
  • Visual Studio 2017 15.8 版及更新版本 (所有版本)Visual Studio 2017 version 15.8 and later (any edition)

下表包含有關如何取得適用您開發環境 IntelliCode 的詳細資料:The following table contains details about how to obtain IntelliCode for your development environment:

開發環境Development environment 安裝指示Installation instructions
Visual Studio Code 標誌 1. 為 Windows、MacOS 或 Linux 安裝視覺化工作室代碼1. Install Visual Studio Code for Windows, MacOS, or Linux.
2. 從市場下載 Visual Studio IntelliCode 擴展,或直接從可視化工作室代碼中的擴展視圖安裝它。2. Download the Visual Studio IntelliCode extension from the marketplace, or install it directly from the Extensions view in Visual Studio Code.
3. 重新載入並等待依賴項下載和安裝(請參閱狀態列)。3. Reload and wait for dependencies to download and install (see status bar).
Visual Studio 2019 標誌 1.下載 Visual Studio 2019版本 16.1 或更高版本。1. Download Visual Studio 2019 version 16.1 or later.
2. 安裝受支援的工作負載,如 .NET 桌面開發。2. Install a supported workload, such as .NET desktop development.
3. 預設情況下安裝可視化工作室 IntelliCode。3. Visual Studio IntelliCode is installed by default.

或:Or:

1. 在版本 16.1 之前下載 Visual Studio 2019 版本。1. Download a version of Visual Studio 2019 prior to version 16.1.
2. 從可視化工作室市場下載視覺工作室 IntelliCode 擴展。2. Download the Visual Studio IntelliCode extension from Visual Studio Marketplace.
Visual Studio 2017 標誌 1.下載 Visual Studio 2017版本 15.8 或更高版本。1. Download Visual Studio 2017 version 15.8 or later.
2. 從可視化工作室市場下載視覺工作室 IntelliCode 擴展。2. Download the Visual Studio IntelliCode extension from Visual Studio Marketplace.

內容感知程式碼完成Context-aware code completions

IntelliCode 在 Visual Studio 和 Visual Studio Code 中提供 AI 輔助 IntelliSense。IntelliCode provides AI-assisted IntelliSense in both Visual Studio and Visual Studio Code. IntelliCode 建議會顯示在完成清單的頂端,旁邊帶有星星圖示:IntelliCode suggestions appear at the top of the completion list with a star icon next to them:

在 Visual Studio 中使用 IntelliCode 時加星號的 IntelliSense 建議

完成清單會為開發人員提供正確性最高的 API,而不僅僅是按字母順序排列來呈現成員清單。The completion list suggests the most likely correct API for a developer to use rather than presenting a simple alphabetical list of members. IntelliCode 使用開發人員目前的程式碼內容,以及根據 GitHub 上數千份獲得好評之開放原始碼專案所得出的模式,來提供此動態清單。To provide this dynamic list, IntelliCode uses the developer's current code context as well as patterns based on thousands of highly rated, open-source projects on GitHub. 結果會形成一個能預測最可能和最相關之 API 呼叫的模型。The results form a model that predicts the most likely and most relevant API calls.

支援的語言Supported languages

AI 輔助 IntelliSense 完成支援的語言包括:The supported languages for AI-assisted IntelliSense completions are:

  • C#、C++、XAML、JAVAScript、TypeScript 和可視化工作室的可視化基礎知識。C#, C++, XAML, JavaScript, TypeScript, and Visual Basic for Visual Studio.

  • 用於可視化工作室代碼的 Java、JavaScript、TypeScript、Python 和 SQL。Java, JavaScript, TypeScript, Python, and SQL for Visual Studio Code.

遙測Telemetry

我們會擷取一些匿名的使用狀況與錯誤報告資料,以幫助改善 IntelliCode。We capture some anonymized usage and error-reporting data to help improve IntelliCode. 沒有任何使用者定義的程式碼會傳送給 Microsoft,但我們會收集您使用 IntelliCode 結果的相關資訊。No user-defined code is sent to Microsoft, but we collect information about your use of the IntelliCode results.

若是屬於開放原始碼或 .NET 類型和成員的基本模型建議,我們會針對您是否選取了 IntelliCode 建議進行擷取,並記錄該建議的名稱。For base model suggestions, which are open source or .NET types and members, we capture whether you selected an IntelliCode suggestion and log the name of the suggestion. Microsoft 會使用該資料來監視基本模型的品質。Microsoft uses the data to monitor the quality of the base model. 若為自訂模型,我們會針對您是否選取了 IntelliCode 的建議來進行擷取,但「不會」** 記錄您使用者定義的型別或方法名稱。For custom models, we capture whether you selected an IntelliCode suggestion but do not log the names of your user-defined types or methods.

在 Visual Studio中,開發人員可以退出 Visual Studio 經驗改進計畫,這也會關閉 IntelliCode 的資料收集。In Visual Studio, you can opt out of the Visual Studio Experience Improvement Program, which turns off data collection for IntelliCode too. 在選單列中,選擇 「幫助 > 發送反饋 > 設定」。From the menu bar, select Help > Send Feedback > Settings. 在 [Visual Studio 經驗改進計畫]**** 對話方塊中,選取 [否,我不願意參與]****,然後選取 [確定]****。In the Visual Studio Experience Improvement Program dialog, select No, I would not like to participate and then select OK.

在 Visual Studio Code 中,您可以遵循這些指示停用遙測報告。In Visual Studio Code, you can disable telemetry reporting by following these instructions.

IntelliCode 可能會定期要求您完成匿名問卷。IntelliCode may periodically ask you to complete an anonymous survey. 您也可以註冊新聞和更新,但並不強制。You can also sign up for news and updates but are not required to do so.

另請參閱See also