You can also open the codespace in VS Code if you prefer. Navigate to the repository that contains your extension on GitHub and open it in a codespace to work with it in a browser-based editor. You can also use a custom development container if preferred. Debugging with GitHub CodespacesÄebugging your extension in GitHub Codespaces preview can be a great starting point since you can use both VS Code and the Codespaces browser-based editor for testing and troubleshooting. Typically, your best starting point for testing is to use a remote environment that restricts port access (for example Codespaces, a container, or remote SSH hosts with a restrictive firewall) since extensions that work in these environments tend to work in less restrictive ones like WSL. In this section, we will cover how to edit, launch, and debug your extension in GitHub Codespaces, a local container, an SSH host, or in WSL. While you can install a development version of your extension in a remote environment for testing, if you encounter issues, you will likely want to debug your extension directly in a remote environment. We recommend that you test that all features of your extension work properly in both local and remote workspaces. However, if your extension uses APIs not provided by VS Code - such using Node APIs or running shell scripts - it may not work properly when run remotely. The VS Code APIs are designed to automatically run on the correct machine (either local or remote) when called from both UI or Workspace Extensions. (VS Code also automatically manages starting and stopping the server, so users aren't aware of its presence.) Therefore, the server is automatically installed (or updated) by the Remote Development or GitHub Codespaces extensions when you open a folder in a container, on a remote SSH host, using Codespaces, or in the Windows Subsystem for Linux (WSL). To ensure the latest VS Code client features are available, the server needs to match the VS Code client version exactly. If an extension can run as either kind, VS Code will attempt to choose the optimal one for the situation UI Extensions will run in VS Code's local Extension Host, while Workspace Extensions will run in a Remote Extension Host that sits in a small VS Code Server, if it exists in a remote workspace, otherwise will run in VS Code's local extension host if it exists locally. When a user installs an extension, VS Code automatically installs it to the correct location based on its kind. While Workspace Extensions do not focus on modifying the UI, they can contribute explorers, views, and other UI elements as well. Workspace Extensions can access files in the workspace to provide rich, multi-file language services, debugger support, or perform complex operations on multiple files in the workspace (either directly or by invoking scripts/tools). When in a remote workspace or when using Codespaces, Workspace Extensions run on the remote machine / environment. When in a local workspace, Workspace Extensions run on the local machine. Workspace Extensions: These extensions are run on the same machine as where the workspace is located. Example UI Extensions include: themes, snippets, language grammars, and keymaps. UI Extensions cannot directly access files in the remote workspace, or run scripts/tools installed in that workspace or on the machine. UI Extensions: These extensions contribute to the VS Code user interface and are always run on the user's local machine. In order to make working with Remote Development or Codespaces as transparent as possible to users, VS Code distinguishes two kinds of extensions: This article summarizes what extension authors need to know about Remote Development and Codespaces including the extension architecture, how to debug your extension in remote workspaces or Codespaces, and recommendations on what to do if your extension does not work properly. While many extensions will work without any modifications, you may need to make changes so that your extension works properly in all environments, although these changes are often fairly minor. However, this can have subtle impacts on how extensions need to work. To ensure performance, Remote Development and GitHub Codespaces both transparently run certain VS Code extensions remotely. GitHub Codespaces is a service that expands these capabilities with managed cloud-hosted environments that are accessible from both VS Code and a browser-based editor. Visual Studio Code Remote Development allows you to transparently interact with source code and runtime environments sitting on other machines (whether virtual or physical). Edit Supporting Remote Development and GitHub Codespaces
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |