Visual Studio IntelliCode 常見問題集Visual Studio IntelliCode FAQ

此常見問題集回答一些您可能有的 Visual Studio IntelliCode 問題。This FAQ answers some of the questions you may have about Visual Studio IntelliCode.

問:視覺工作室的 IntelliCode 和視覺工作室代碼之間是否有任何差異?Q: Are there any differences between IntelliCode for Visual Studio and Visual Studio Code?

Visual Studio 的 IntelliCode 提供 Visual Studio Code 延伸模組所沒有的額外功能,包括自動產生之 EditorConfig 檔案和根據您程式碼自訂的 IntelliSense。IntelliCode for Visual Studio offers some additional functionality over the extension for Visual Studio Code, including autogenerated EditorConfig files and customized IntelliSense based on your code. 如需詳細資訊,請參閱 Visual Studio 的 IntelliCodeVisual Studio Code 的 IntelliCode 延伸模組For more information, see IntelliCode for Visual Studio and IntelliCode extension for Visual Studio Code.

問:是什麼讓「AI 輔助感」比普通 IntelliSense 更好?Q: What makes “AI-assisted IntelliSense” better than regular IntelliSense?

使用 IntelliCode,自動完成清單可為開發人員提供最可能正確的 API,而不僅僅是按字母順序排列來呈現成員清單。With IntelliCode, 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 and 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.

對於 C# 開發人員,IntelliCode 可以了解您程式碼的模式。For C# developers, IntelliCode can learn patterns from your code. 這表示 IntelliCode 可以對不在開放原始碼領域的程式碼提出建議,例如,在您自己公用程式類別或領域特定程式庫呼叫的方法。This means IntelliCode can make recommendations on code that isn’t in the open-source domain, for example, methods in your own utility classes or domain-specific library calls. 如需詳細資訊,請參閱根據您程式碼的 IntelliCode 模型常見問題集For more information, see IntelliCode models based on your code FAQ.

Q:IntelliCode 完成建議好用嗎?Q: How good are the IntelliCode completion suggestions?

Microsoft 開發人員已經在內部使用 IntelliCode 的建議一段時間,而且相信這些建議很有用。Developers at Microsoft have been using IntelliCode’s recommendations internally for some time and believe the suggestions are useful. 此外,我們不斷根據使用者意見反應和資料科學小組的創新來調整模型。Additionally, we constantly tune our models based on user feedback and new innovations from our data science teams.

Q.Q. 為何我最愛的程式庫看不到建議?Why isn’t my favorite library seeing recommendations?

對於每種語言,我們不斷提高其基本模型對通用庫和類型的覆蓋率。For each language, we continuously improve its base model's coverage of common libraries and types. 如果有您想要看到所含括的通用程式庫,請使用此頁面底部的意見反應控制項來讓我們知道。If there’s a common library you'd like to see included, use the feedback controls at the bottom of this page to let us know.

對於 C# 使用者,IntelliCode 可以了解您自己程式碼的模式。For C# users, IntelliCode can learn patterns from your own code. 有關詳細資訊,請參閱IntelliCode 團隊完成情況。For more information, see IntelliCode team completions.

問:如何關閉星形建議?Q: How do I turn starred suggestions off?

若要關閉星號 IntelliSense 建議,請停用延伸模組:To turned starred IntelliSense suggestions off, disable the extension:

  • 在可視化工作室中,選擇 「擴展 > 管理擴展」,查找並選擇 IntelliCode 擴展,然後單擊「禁用」。。In Visual Studio, choose Extensions > Manage Extensions, find and select the IntelliCode extension, and then click Disable.

  • 在 Visual Studio 中,按一下 [延伸模組]****、尋找並選取 IntelliCode 延伸模組,然後按一下 [停用]****。In Visual Studio Code, click Extensions, find and select the IntelliCode extension, and then click Disable.

Q.Q. Azure DevOps 任務中完成的錯誤培訓團隊模型Error training team model for completions in Azure DevOps task

視覺化工作室 IntelliCode 團隊模型訓練Azure DevOps 工作_僅在_執行由以下原因之一引起的產生或ContinuousIntegration``Manual``IndividualCI``BatchedCI``Schedule``Scheduled發佈時觸發:、、、、、、、 和 。The Visual Studio IntelliCode Team Model Training Azure DevOps Task is triggered only when you run a build or release caused by one of the following reasons: Manual, IndividualCI, BatchedCI, Schedule, Scheduled, and ContinuousIntegration. 有關生成和發佈管道觸發原因的詳細資訊,請參閱:For more information on build and release pipeline triggering reasons see:

特別是,完成培訓的團隊模型不適用於拉取請求。In particular, team model for completion training will not work on pull requests. 這是設計,以避免為使用臨時提交而為完成創建團隊模型,這些完成在拉取請求完成後可能會被壓扁,因為使用者無法使用此類模型。This is by design in order to avoid creating team models for completions that use temporary commits that may get squashed once the pull request is completed, given that users would be unable to consume such models. 有關詳細資訊,請參閱Q. 錯誤使用或由於未知提交而訓練團隊模型For more information see Q. Error consuming or training team model due to unknown commit.

Q.Q. 由於模型擁有權而導致的完成錯誤培訓團隊模型Error training team model for completions due to model ownership

團隊模型只能由模型的所有者訓練和重新訓練。Team models can only be trained and re-trained by the owner of the model. 擁有者還可以從 IntelliCode 的服務中移除模型,請參閱刪除模型The owner can also delete the model from IntelliCode's services, see Delete your model.

我們目前正在努力改善這種體驗,以便有權訪問存儲庫的任何人都可以為其培訓和重新訓練團隊模型。We're currently working on improving this experience so that anyone with access to the repository can train and re-train team models for it. 註冊有關團隊模型的消息和更新在視覺工作室IntelliCodeSign up for news and updates about team models at Visual Studio IntelliCode.

Q.Q. 由於限制而導致的完成錯誤培訓團隊模型Error training team model for completions due to throttling

每個存儲庫每分鐘只能訓練一次團隊模型。Team models can only be trained once per minute for each repository. 通常,這足以使團隊模型保持完成,以便使用最新版本的代碼重新更新完成。Typically that is enough to keep a team model for completions freshly updated with the latest version of your code. 如果您發現您的模型仍然陳舊時,以這個速度訓練,請讓我們知道,在提出一個問題。If you are finding that your model is still stale when trained at this rate, please let us know by raising an issue at

Q.Q. 由於未知提交而導致的錯誤使用或培訓團隊模型Error consuming or training team model due to unknown commit

當團隊模型在提交上訓練,然後從 git 歷史記錄中刪除該提交,或者由於其他原因無法訪問定型電腦提交,則您將無法使用與該提交關聯的模型。When a team model is trained on a commit, and then that commit is deleted from the git history, or the commit is not accessible to the training machine for another reason, then you'll not be able to consume the model associated to that commit. 如果是這樣的話,你也可能無法訓練新的模型。You may also be unable to train new models going forward if that's the case.

如果由於 git 歷史記錄中的更改而無法重新訓練模型,請嘗試刪除模型,然後執行其他團隊模型培訓。If your model is unable to be re-trained due to changes in the git history, try deleting the model and then do another team model training. 請參考此項目刪除的模型See Delete your model.

Q.Q. 它是免費的嗎?Is it free?

IntelliCode 一律具有實質的免費層。IntelliCode will always have a substantive free tier. Microsoft 未來可能會開始對一些 IntelliCode 功能收費。Microsoft may start to charge for some of the IntelliCode features in the future.

Q.Q. IntelliCode 的未來動態如何?What's coming in the future for IntelliCode?

如需未來功能的資訊,請在 Visual Studio IntelliCode 註冊消息和更新。For information about future features, sign up for news and updates at Visual Studio IntelliCode.

另請參閱See also