Merge branch 'main' into vnext

This commit is contained in:
Nick Trogh 2024-06-05 14:39:10 +02:00
Родитель 77a0aebebd b66b813c13
Коммит aa1b4f6e7e
20 изменённых файлов: 156 добавлений и 53 удалений

Просмотреть файл

@ -42,10 +42,10 @@ This contributes a task definition for `rake` tasks. The task definition has two
### When clause
A task definition may optional have a `when` property. The `when` property specifies the condition under which task of this type will be available. The `when` property functions in the same way [as other places in VS Code](/api/references/when-clause-contexts), where there is a `when` property. The following contexts should always be considered when creating a task definition:
A task definition may optionally have a `when` property. The `when` property specifies the condition under which a task of this type will be available. The `when` property functions in the same way [as other places in VS Code](/api/references/when-clause-contexts), where there is a `when` property. The following contexts should always be considered when creating a task definition:
- `shellExecutionSupported`: True when VS Code can run `ShellExecution` tasks, such as VS Code is run as a desktop application or when using one of the remote extensions, such as Dev Containers.
- `processExecutionSupported`: True when VS Code can run `ProcessExecution` tasks, such as VS Code is run as a desktop application or when using one of the remote extensions, such as Dev Containers. Currently, it will always have the same value as `shellExecutionSupported`.
- `shellExecutionSupported`: True when VS Code can run `ShellExecution` tasks, such as when VS Code is run as a desktop application or when using one of the remote extensions, such as Dev Containers.
- `processExecutionSupported`: True when VS Code can run `ProcessExecution` tasks, such as when VS Code is run as a desktop application or when using one of the remote extensions, such as Dev Containers. Currently, it will always have the same value as `shellExecutionSupported`.
- `customExecutionSupported`: True when VS Code can run `CustomExecution`. This is always true.
## Task provider

Просмотреть файл

@ -52,7 +52,7 @@ However, let's focus on `package.json` and `extension.ts`, which are essential t
### Extension Manifest
Each VS Code extension must have a `package.json` as its [Extension Manifest](/api/references/extension-manifest). The `package.json` contains a mix of Node.js fields such as `scripts` and `devDependencies` and VS Code specific fields such as `publisher`, `activationEvents` and `contributes`. You can find description of all VS Code specific fields in [Extension Manifest Reference](/api/references/extension-manifest). Here are some most important fields:
Each VS Code extension must have a `package.json` as its [Extension Manifest](/api/references/extension-manifest). The `package.json` contains a mix of Node.js fields such as `scripts` and `devDependencies` and VS Code specific fields such as `publisher`, `activationEvents` and `contributes`. You can find descriptions of all VS Code specific fields in [Extension Manifest Reference](/api/references/extension-manifest). Here are some most important fields:
- `name` and `publisher`: VS Code uses `<publisher>.<name>` as a unique ID for the extension. For example, the Hello World sample has the ID `vscode-samples.helloworld-sample`. VS Code uses the ID to uniquely identify your extension.
- `main`: The extension entry point.

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:17f4e125905187e42eb94103dceb9dca2b13f92c07b004ac3fd7ef4b9c2ef6a3
size 162913

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f19dedc502ce12615a84417f2d0f67dcbbb499d6b6a5c5746bf101f68bd54f36
size 162457

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0a6e75129d870b7bebad25382f9bca020f2b36a9ec88c24bd2895ecf90d8178d
size 173926

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:87a7b64d1ab3aebb11a9f753275bc3521a2f88acdeb3f35bb719dc074dd75436
size 106421

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3173345eb7a5041e3520bfb3d919b0233af1be01db6577b1b4497bb1b761ed57
size 175817

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:574cef36f614407b515bb169e35f9c0708651a0a710dabdc017c32453d7c1c0d
size 109316

Просмотреть файл

@ -10,7 +10,47 @@ MetaDescription: C# package management with NuGet in Visual Studio Code
# NuGet in Visual Studio Code
NuGet is the package manager for .NET. It defines how packages for .NET are created, hosted, and consumed, and provides the tools for each of those roles. Importantly, NuGet also manages the dependency tree on behalf of a project, so you only need to focus on the packages that you're directly using in a project. For more information, go to the [NuGet documentation](https://learn.microsoft.com/nuget/what-is-nuget).
NuGet is the package manager for .NET. It defines how packages for .NET are created, hosted, and consumed, and provides the tools for each of those functions. NuGet also manages the dependency tree on behalf of a project, so you only need to focus on the packages that you're directly using in a project. In Visual Studio Code, you can manage your NuGet packages either directly from the C# Dev Kit Solution explorer, or by using the Command Palette. To learn more about NuGet, go to the [NuGet documentation](https://learn.microsoft.com/nuget/what-is-nuget).
* [NuGet Commands in C# Dev Kit](#nuget-commands-in-c-dev-kit)
* [Dependency Management](#dependency-management)
## NuGet commands in C# Dev Kit
In C# Dev Kit, you can perform NuGet package operations in either of two ways: by using the Command Palette (`kb(workbench.action.showCommands)`) or by right-clicking in the C# Dev Kit Solution explorer. The following sections describe how to use each NuGet command through both of the two methods.
### Add a package
1. To add a NuGet package to your project, use the command **NuGet: Add NuGet Package**.
![Screenshot showing command 'NuGet: Add NuGet Package' in the command palette ](images/package-management/nuget-command-addpackage.png)
2. If you have more than one project in your solution, you are asked to select which project you want to add the package to.
![Screenshot showing quickpick menu with dropdown options "Project" and "Project2"](images/package-management/nuget-command-addackage-projectselection.png)
3. Then you can search for packages by name.
![Screenshot showing command palette search bar with placeholder text that reads "Enter a search term to search for a NuGet package."](images/package-management/nuget-command-addpackage-search1.png)
![Screenshot showing quickpicks dropdown menu with placeholder text that reads: "Select a NuGet package". The quickpick options show a list of example NuGet packages to choose from.](images/package-management/nuget-command-addpackage-search2.png)
4. Next, select the version you want to apply.
![Screenshot showing quickpicks dropdown menu with placeholder text that reads: "Select a NuGet package version". The quickpick options show a list of example NuGet package versions to choose from.](images/package-management/nuget-command-addpackage-versionselection.png)
5. After you select a package and version number, C# Dev Kit adds it to your project and updates your project file and references.
### Update a package
1. To update a NuGet package in your project, use the command **NuGet: Update NuGet Package**.
2. If you have more than one project in your solution, you are asked to select which project contains the package that you would like to update.
3. Next, choose which package to update from the list of packages that are currently installed in your project and that have an update available. If no packages in your solution have an update available, you see a message notifying you of this.
4. Finally, you can select which version you would like to update the package to from a dropdown list of available versions.
![Screenshot showing quickpicks dropdown menu with placeholder text that reads: "Select a NuGet package version". The quickpick options show a list of example NuGet packages to choose from. There are indicators on the list to show which version is currently installed in the users project ("current"), and which is the latest available version ("latest")](images/package-management/nuget-command-update-versionselector.png)
5. C# Dev Kit then performs the necessary changes and updates your project file and references.
### Remove a package
1. To remove a NuGet package from your project, use the command **NuGet: Remove NuGet Package**.
2. If you have more than one project in your solution, you are asked to select which project that you would like to remove a package from.
3. Next, choose which package you want to remove from the list of packages that are currently installed in your project.
4. C# Dev Kit then performs the necessary changes and updates your project file and references.
## Dependency management

Просмотреть файл

@ -209,7 +209,7 @@ Here are the Extensions view filters:
* `@builtin` - Show extensions that come with VS Code. Grouped by type (Programming Languages, Themes, etc.).
* `@disabled` - Show disabled installed extensions.
* `@installed` - Show installed extensions.
* `@outdated` - Show outdated installed extensions. A newer version is available on the Marketplace.
* `@updates` - Show outdated installed extensions. A newer version is available on the Marketplace.
* `@enabled` - Show enabled installed extensions. Extensions can be individually enabled/disabled.
* `@recommended` - Show recommended extensions. Grouped as Workspace specific or general use.
* `@category` - Show extensions belonging to specified category. Below are a few of supported categories. For a complete list, type `@category` and follow the options in the suggestion list:

Просмотреть файл

@ -79,7 +79,7 @@ The `editor.action.codeAction` command lets you configure keybindings for specif
}
```
Code Action kinds are specified by extensions using the enhanced `CodeActionProvided` API. Kinds are hierarchical, so `"kind": "refactor"` shows all refactoring Code Actions, whereas `"kind": "refactor.extract.function"` only shows **Extract function** refactorings.
Code Action kinds are specified by extensions using the enhanced `CodeActionProvider` API. Kinds are hierarchical, so `"kind": "refactor"` shows all refactoring Code Actions, whereas `"kind": "refactor.extract.function"` only shows **Extract function** refactorings.
Using the above keybinding, if only a single `"refactor.extract.function"` Code Action is available, it is automatically applied. If multiple **Extract function** Code Actions are available, VS Code brings up a context menu to select them:

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:383c13ca3eb514543841a6e09fd2d83b887ba16ada3e2cc378448294e1053a23
size 1838508

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7abf44561202d2b606b3937d5e8f57bbf3b0e452e8e83b0232d8362de5a20692
size 7109615

Просмотреть файл

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fae13a5e67ea305efc42d5944d19c6b3427ce05a9d9a3d387875af8599e18252
size 113186

Просмотреть файл

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3919da6387238ef846d54a04c15304c61e38f29c5b3ba1d062142c799c41cbdf
size 134022

Просмотреть файл

@ -31,7 +31,7 @@ You can find and install the Ruby LSP extension from within VS Code via the Exte
![Ruby LSP extension in the Extensions view](images/ruby/ruby_lsp_extensions_view.png)
We'll discuss many of Ruby LSP features in this topic but you can also refer to the extension's documentation at [https://github.com/Shopify/vscode-ruby-lsp](https://github.com/Shopify/vscode-ruby-lsp).
We'll discuss many of Ruby LSP features in this topic but you can also refer to the extension's documentation at [https://github.com/Shopify/ruby-lsp](https://github.com/Shopify/ruby-lsp).
### Check your installation
@ -44,20 +44,28 @@ The extension generates a `.ruby-lsp` folder automatically with a custom bundle
By default, the extension tries to automatically detect the Ruby version manager you're using and use the right versions and paths accordingly. If you want to customize that behavior, set the following configuration in your user [settings](/docs/getstarted/settings.md):
```json
"rubyLsp.rubyVersionManager": "rbenv"
{
"rubyLsp.rubyVersionManager": {
"identifier": "rbenv"
}
}
```
The extension will automatically try to update the `ruby-lsp` language server gem once per day; if you want to force that to happen, use the Command Palette (`kb(workbench.action.showCommands)`) to execute **Ruby LSP: Update language server gem**.
The extension will automatically try to update the `ruby-lsp` language server gem periodically; if you want to force that to happen, use the Command Palette (`kb(workbench.action.showCommands)`) to execute **Ruby LSP: Update language server gem**.
If you have any problems, see [troubleshooting](https://github.com/Shopify/vscode-ruby-lsp#troubleshooting) for next steps.
If you have any problems, see [troubleshooting](https://github.com/Shopify/ruby-lsp/blob/main/TROUBLESHOOTING.md) for next steps.
## Main features
### Symbol detection
### Navigation and IntelliSense
Ruby LSP parses source code and provides symbol detection and navigation for the Outline pane, file breadcrumbs, and symbol searches (accessible with `kb(workbench.action.gotoSymbol)` by default).
The Ruby LSP provides several navigation and IntelliSense related features, such as go to definition, hover, workspace
symbol, document symbol, completion and signature help.
![Ruby document symbols](images/ruby/ruby_lsp_symbols.png)
<video src="images/ruby/navigation.mp4" placeholder="images/ruby/navigation-placeholder.png" autoplay loop controls
muted title="Demo of navigation and intellisense features">
Sorry, your browser doesn't support HTML 5 video.
</video>
To learn more about moving quickly through your source code with VS Code, check out [Code Navigation](/docs/editor/editingevolved.md).
@ -75,10 +83,6 @@ While inlay hints can be helpful for understanding your code, you can also disab
}
```
### Code snippets
As you type in a Ruby file, Ruby LSP might suggest expanding snippets used for common Ruby operations such as creating a new method, class, block, or test boilerplate. To see the full list, check out the snippets file in the Ruby LSP [GitHub repository](https://github.com/Shopify/vscode-ruby-lsp/blob/main/snippets.json).
### Semantic syntax highlighting
Ruby LSP is able to use [semantic syntax highlighting](https://github.com/microsoft/vscode/wiki/Semantic-Highlighting-Overview) and styling due to its rich understanding of a project source code.
@ -134,17 +138,26 @@ In addition to Quick Fixes, the Ruby LSP also provides refactor options through
![Refactor extract to variable](images/ruby/ruby_lsp_refactor.png)
## Debugging support with rdbg
## Debugging
For debug support inside of VS Code, the Ruby LSP requires the VS Code RDBG extension to connect to debug (Ruby's official debugger).
The Ruby LSP extension supports debugging using the debug gem (Ruby's official debugger). Alternatively, developers can
also install the [VS Code RDBG](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) extension
to get debugging functionality.
### Install debugging support
The following documentation is for the Ruby LSP's debugger client. Please refer to [RDBG's README](https://github.com/ruby/vscode-rdbg)
for instructions on how to configure it.
Install the [VS Code RDBG](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) extension.
### Debugging tests
### Set up debugging configuration
The Ruby LSP adds CodeLens buttons on top of unit tests that enable you to run examples in the Test Explorer, run them
in a new terminal or launch the debugger. For these uses, no configuration is required.
To use the debugger, you will need to create [debugging configurations](/docs/editor/debugging.md#launch-configurations) in a `launch.json` file. The configuration lets you pass arguments to your program, run pre-launch tasks, set environment variables, and much more.
![Test running code lenses](images/ruby/ruby_lsp_code_lens.png)
### Debugging through launch tasks
To use the debugger through launch tasks, you will need to create [debugging configurations](/docs/editor/debugging.md#launch-configurations)
in a `launch.json` file. The configuration lets you configure the program to be executed.
To create a `launch.json` for a Ruby program:
@ -158,32 +171,26 @@ Example:
{
"version": "0.2.0",
"configurations": [
// Run all tests in a file using Minitest
// Launch the debugger for any given program. In this case, it will run the current file using Ruby
{
"type": "rdbg",
"name": "Minitest - current file",
"type": "ruby_lsp",
"name": "Debug",
"request": "launch",
"script": "-Itest ${file}",
"askParameters": false
"program": "ruby ${file}",
},
// If your test runner supports line numbers, such as in Rails,
// you can add a task like this one to run only the test under the cursor
// Launch the debugger for the current test file
{
"name": "Minitest - current line",
"type": "rdbg",
"type": "ruby_lsp",
"request": "launch",
"command": "${workspaceRoot}/bin/rails",
"script": "test",
"args": [
"${file}:${lineNumber}"
],
"askParameters": false,
"name": "Debug test file",
"program": "ruby -Itest ${relativeFile}"
},
// Attach the debugger to an active process (for example, Rails server)
// Attach the debugger client to an existing Ruby process that has already been launched with the debugger
// server
{
"type": "rdbg",
"name": "Attach with rdbg",
"request": "attach"
"type": "ruby_lsp",
"request": "attach",
"name": "Attach to existing server",
}
]
}
@ -201,11 +208,11 @@ After adding the launch configurations, we can debug Ruby programs by adding bre
## Next steps
This has been a brief overview showing the Ruby LSP extension features within VS Code. For more information, see the details provided in the Ruby LSP [README](https://github.com/Shopify/vscode-ruby-lsp), including how to tune specific [VS Code editor](https://github.com/Shopify/vscode-ruby-lsp#configuration) configurations.
This has been a brief overview showing the Ruby LSP extension features within VS Code. For more information, see the details provided in the Ruby LSP [README](https://github.com/Shopify/ruby-lsp), including how to tune specific [VS Code editor](https://github.com/Shopify/ruby-lsp/blob/main/vscode/README.md) configurations.
To stay up to date on the latest features/bug fixes for the Ruby LSP extension, see the Releases page for the [language server gem](https://github.com/Shopify/ruby-lsp/releases) and for the [Ruby LSP extension](https://github.com/Shopify/vscode-ruby-lsp/releases).
To stay up to date on the latest features/bug fixes for the Ruby LSP extension, see the Releases page for the [monorepo](https://github.com/Shopify/ruby-lsp/releases), which includes both the server and VS Code extension implementations.
If you have any issues or feature requests, feel free to log them in the Ruby LSP extension [GitHub repo](https://github.com/Shopify/vscode-ruby-lsp/issues).
If you have any issues or feature requests, feel free to log them in the Ruby LSP's [GitHub repo](https://github.com/Shopify/ruby-lsp/issues).
If you'd like to learn more about VS Code, try these topics:

Просмотреть файл

@ -21,7 +21,7 @@ The extensions are known to work when connecting to recent stable/LTS version of
The following non-Linux SSH hosts are also supported:
* **Windows 10 / Server 2016/2019 SSH hosts** (1803+) using the [official OpenSSH Server](https://learn.microsoft.com/windows-server/administration/openssh/openssh_install_firstuse) and enabling `remote.SSH.useLocalServer` [in VS Code settings](/docs/getstarted/settings.md).
* **Windows 10/11 / Server 2016/2019 SSH hosts** (1803+) using the [official OpenSSH Server](https://learn.microsoft.com/windows-server/administration/openssh/openssh_install_firstuse).
* **macOS** 10.14+ (Mojave) SSH hosts with [Remote Login enabled](https://support.apple.com/guide/mac-help/allow-a-remote-computer-to-access-your-mac-mchlp1066/mac).
However, if you are using a non-standard configuration or downstream distribution of Linux, you may run into issues. This document provides information on requirements as well as tips to help you get up and running even if your configuration is only community-supported.

Просмотреть файл

@ -21,11 +21,11 @@ Revert your last commit with the **Git: Undo Last Commit** command. This will re
The **Git: Rename Branch…** command will prompt you for the new name.
### How to I undo a git add before committing?
### How to undo a git add before committing?
Added files listed in the **Staged Changes** can be unstaged with the **-** icon or by drag-and-drop.
### How to I edit the most recent commit message?
### How to edit the most recent commit message?
To update the commit message for the last local commit use the **Git: Commit Staged (Amend)** command. It will open an editor to edit and save the last message. Make sure that no other changes are staged, as they would be included with the commit.

Просмотреть файл

@ -207,7 +207,7 @@ The new `editor.action.codeAction` command lets you configure keybindings for sp
}
```
Code Action kinds are specified by extensions using the enhanced `CodeActionProvided` API. Kinds are hierarchical, so `"kind": "refactor"` will show all refactoring Code Actions, whereas `"kind": "refactor.extract.function"` will only show Extract function refactorings.
Code Action kinds are specified by extensions using the enhanced `CodeActionProvider` API. Kinds are hierarchical, so `"kind": "refactor"` will show all refactoring Code Actions, whereas `"kind": "refactor.extract.function"` will only show Extract function refactorings.
Using the above keybinding, if only a single `"refactor.extract.function"` Code Action is available, it will be automatically applied. If multiple Extract function Code Actions are available, we bring up a context menu to select them:

Просмотреть файл

@ -106,3 +106,35 @@ RUN sudo apt-get update && sudo apt-get install gnupg2 -y
To apply your configuration changes, you need to rebuild the container. You can do this by running **Dev Containers: Rebuild Container** from the Command Palette (`F1`). The next time the container starts, your GPG keys should be accessible inside the container as well.
>**Note**: If you used `gpg` previously in the container, you may need to run **Dev Containers: Rebuild Container** for the update to take effect.
### Using GPG >= 2.4.1
As of GPG version 2.4.1, fresh installations use `use-keyboxd` by default, which changes how keys are managed. Instead of using `pubring.kbx`, keys are maintained by the `keyboxd` process.
VS Code expects `~/.gnupg/pubring.kbx` to exist for accessing GPG keys. With `use-keyboxd` enabled, `pubring.kbx` is no longer used, which makes the keys inaccessible to your dev container.
Use the following temporary workaround to disable `use-keyboxd` and continue to use `pubring.kbx`:
1. Export your keys
```bash
gpg --export > all-keys.asc
gpg --export-secret-keys > all-secret-keys.asc
```
2. Disable `use-keyboxd`
Edit the configuration file `~/.gnupg/common.conf` and comment out the following line:
```plaintext
use-keyboxd
```
Change it to:
```plaintext
# use-keyboxd
```
3. Import your keys back into `pubring.kbx`
```bash
gpg --import all-keys.asc
gpg --import all-secret-keys.asc
```
After completing these steps, your GPG keys are now accessible from within your dev container.