IntelliCode for Visual Studio Code 概觀IntelliCode for Visual Studio Code overview

適用於 Visual Studio Code 的 IntelliCode 延伸模組為 Python、Java、TypeScript 和 JavaScript 提供人工智慧輔助的 IntelliSense。The IntelliCode extension for Visual Studio Code provides artificial intelligence-assisted IntelliSense for Python, Java, TypeScript, and JavaScript. AI 輔助 IntelliSense 可預測最可能正確的 API 給開發人員使用,而不僅僅是按字母順序排列來呈現成員清單。AI-assisted IntelliSense predicts the most likely correct API for the developer to use rather than just presenting an alphabetical list of members. 會使用開發人員的目前程式碼內容和模式,以提供動態清單。It uses the developer's current code context and patterns to provide this dynamic list.

Visual Studio Code 中的 Python IntelliCode

支援的語言Supported languages

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

  • JavaJava
  • JavaScript 和 TypeScriptJavaScript and TypeScript
  • PythonPython
  • SQLSQL

PrerequisitesPrerequisites

若要安裝延伸模組,您需要 Visual Studio Code 2018 年 10 月版本 1.29 或更新版本。To install the extension, you need Visual Studio Code October 2018 Release 1.29 or later.

若要取得適用於 Java 的 AI 輔助 IntelliSense,您需要 Java 8 Update 151 或更高版本。To get AI-assisted IntelliSense for Java, you need Java 8 Update 151 or higher. (如果您有以前的 JAVA 8 版本,您將看到錯誤java.security.InvalidKeyException:非法金鑰大小,IntelliCode AI 輔助的 IntelliSense 建議將不起作用。(If you have a previous Java 8 version, you'll see the error java.security.InvalidKeyException: Illegal key size, and IntelliCode AI-assisted IntelliSense recommendations won't work.)

疑難排解Troubleshoot

本節提供常見問題的一些疑難排解祕訣。This section provides some troubleshooting tips for common problems.

沒有自動完成清單No completion lists

如果您沒有看到任何 IntelliSense 自動完成清單,請嘗試下列步驟:If you don't see any IntelliSense completion lists, try these steps:

  • 查看您嘗試要使用的語言輸出視窗,並查看是否有可採取動作的錯誤訊息。Look at the output window for the language you're trying to use and see if there's an actionable error message.

  • 嘗試停用 IntelliCode 延伸模組,並查看是否得到任何 IntelliSense 自動完成。Try disabling the IntelliCode extension and see if you get any IntelliSense completions. 如果您停用 IntelliCode 時確實看到 IntelliSense 自動完成,請瀏覽現有問題或開啟新的問題。If you do see IntelliSense completions with IntelliCode disabled, look through the existing issues or open a new one.

您也可以針對您的語言嘗試下列疑難排解步驟:You can also try the following troubleshooting steps for your language:

沒有星號建議No starred suggestions

如果您看到 IntelliSense 自動完成清單,但沒有任何完成項目已加星號,請查看 [VS IntelliCode 輸出]**** 視窗。If you see IntelliSense completion lists, but none of the completion items are starred, look at the VS IntelliCode output window.

  • 是否有網路錯誤?Is there a network error?

    • 您是否能夠正常存取網際網路?Are you able to access the internet normally?

    • 在 Proxy 或受限防火牆後方嗎?Are you behind a proxy or restrictive firewall?

    使用 IntelliCode 時,您可能會看到錯誤訊息「無法下載 IntelliCode 模型。When using IntelliCode, you may see the error message "Couldn't download IntelliCode model. 請檢查您的網路連線或防火牆設定。」,或在 Visual Studio Code 的 IntelliCode 輸出視窗窗格看到類似訊息。Please check your network connectivity or firewall settings.", or see similar messages in the IntelliCode output window pane in Visual Studio Code. 您也可能會看不到 IntelliCode 星號建議。You might also see no IntelliCode starred suggestions. 如果透過 Proxy 或受限防火牆來連線到網際網路,則可能會造成這些問題。If you connect to the internet through a proxy or restrictive firewall, that may cause these issues.

    首先,請嘗試更新至 Visual Studio Code 1.30 版或更新版本,然後開啟網路 Proxy 支援As a first step, try updating to Visual Studio Code 1.30 or later, and turning on network proxy support .

    如果開啟網路 Proxy 支援對您沒有用,請檢查對應的 github 問題並讓我們深入了解。If turning on network proxy support doesn't work for you, check the corresponding github issue and let us know more.

  • 有可提供協助的可採取動作訊息嗎?Is there an actionable message that helps?

如果您仍會遇到問題,請瀏覽現有問題或開啟一個新問題。If you're still facing a problem, look through the existing issues or open a new one.

提供意見反應Provide feedback

如果您遇到問題,可以瀏覽現有問題,並使用👍「讚」反應來附議它們。If you encounter a problem, you can browse existing issues and upvote them using a 👍 "thumbs up" reaction. 如果您沒有看到您的特定問題,請按一下此頁面底部的 「發送有關 > 此產品的反饋」按鈕以創建新問題。If you don't see your particular problem, click the Send feedback about > This product button at the bottom of this page to create a new issue. 包含來自 Visual Studio IntelliCode、Python、Java、JavaScript、TypeScript 或 SQL 的任何輸出視窗日誌條目。Include any Output window log entries from Visual Studio IntelliCode, Python, Java, JavaScript, TypeScript, or SQL with the bug.

另請參閱See also