Skip to content

Delete unnecessary spaces #2499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions docs/extensibility/adding-an-lsp-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ms.assetid: 52f12785-1c51-4c2c-8228-c8e10316cd83
author: "gregvanl"
ms.author: "gregvanl"
manager: jillfra
ms.workload:
ms.workload:
- "vssdk"
---
# Add a Language Server Protocol extension
Expand Down Expand Up @@ -83,9 +83,9 @@ textDocument/rename | yes
## Getting started

> [!NOTE]
> Starting with Visual Studio 15.8 Preview 3, support for the common Language Server Protocol is built into Visual Studio. If you've built LSP extensions using our preview [Language Server Client VSIX](https://marketplace.visualstudio.com/items?itemName=vsext.LanguageServerClientPreview) version, they will stop working once to you've upgraded to 15.8 Preview 3 or higher. You will need to do the following to get your LSP extensions working again:
> Starting with Visual Studio 15.8 Preview 3, support for the common Language Server Protocol is built into Visual Studio. If you've built LSP extensions using our preview [Language Server Client VSIX](https://marketplace.visualstudio.com/items?itemName=vsext.LanguageServerClientPreview) version, they will stop working once to you've upgraded to 15.8 Preview 3 or higher. You will need to do the following to get your LSP extensions working again:
>
> 1. Uninstall the Microsoft Visual Studio Language Server Protocol Preview VSIX. Starting with 15.8 Preview 4, every time you perform an upgrade in Visual Studio, we will automatically detect and remove the preview VSIX for you during the upgrade process.
> 1. Uninstall the Microsoft Visual Studio Language Server Protocol Preview VSIX. Starting with 15.8 Preview 4, every time you perform an upgrade in Visual Studio, we will automatically detect and remove the preview VSIX for you during the upgrade process.
>
> 2. Update your Nuget reference to the latest non-preview version for [LSP packages](https://www.nuget.org/packages/Microsoft.VisualStudio.LanguageServer.Client).
>
Expand Down Expand Up @@ -123,10 +123,10 @@ The LSP does not include specification on how to provide text colorization for l

4. Create a *.pkgdef* file and add a line similar to this:

```xml
[$RootKey$\TextMate\Repositories]
"MyLang"="$PackageFolder$\Grammars"
```
```xml
[$RootKey$\TextMate\Repositories]
"MyLang"="$PackageFolder$\Grammars"
```

5. Right-click on the files and select **Properties**. Change the **Build** action to **Content** and the **Include in VSIX** property to true.

Expand Down Expand Up @@ -286,31 +286,31 @@ Follow these steps below to add support for settings to your LSP language servic

1. Add a JSON file (for example, *MockLanguageExtensionSettings.json*) in your project that contains the settings and their default values. For example:

```json
{
"foo.maxNumberOfProblems": -1
}
```
```json
{
"foo.maxNumberOfProblems": -1
}
```
2. Right-click on the JSON file and select **Properties**. Change the **Build** action to "Content" and the "Include in VSIX' property to true.

3. Implement ConfigurationSections and return the list of prefixes for the settings defined in the JSON file (In Visual Studio Code, this would map to the configuration section name in package.json):

```csharp
public IEnumerable<string> ConfigurationSections
{
get
{
yield return "foo";
}
}
```
```csharp
public IEnumerable<string> ConfigurationSections
{
get
{
yield return "foo";
}
}
```

4. Add a .pkgdef file to the project (add new text file and change the file extension to .pkgdef). The pkgdef file should contain this info:

```xml
```xml
[$RootKey$\OpenFolder\Settings\VSWorkspaceSettings\[settings-name]]
@="$PackageFolder$\[settings-file-name].json"
```
```

Sample:
```xml
Expand All @@ -334,13 +334,13 @@ Follow these steps below to add support for settings to your LSP language servic
2. User adds a file in the *.vs* folder called *VSWorkspaceSettings.json*.
3. User adds a line to the *VSWorkspaceSettings.json* file for a setting the server provides. For example:

```json
{
"foo.maxNumberOfProblems": 10
}
```
### Enabling diagnostics tracing
Diagnostics tracing can be enabled to output all messages between the client and server, which can be useful when debugging issues. To enable diagnostic tracing, do the following:
```json
{
"foo.maxNumberOfProblems": 10
}
```
### Enabling diagnostics tracing
Diagnostics tracing can be enabled to output all messages between the client and server, which can be useful when debugging issues. To enable diagnostic tracing, do the following:

4. Open or create the workspace settings file *VSWorkspaceSettings.json* (see "User editing of settings for a workspace").
5. Add the following line in the settings json file:
Expand All @@ -356,7 +356,7 @@ There are three possible values for trace verbosity:
* "Messages": tracing turned on but only method name and response ID are traced.
* "Verbose": tracing turned on; the entire rpc message is traced.

When tracing is turned on the content is written to a file in the *%temp%\VisualStudio\LSP* directory. The log follows the naming format *[LanguageClientName]-[Datetime Stamp].log*. Currently, tracing can only be enabled for open folder scenarios. Opening a single file to activate a language server does not have diagnostics tracing support.
When tracing is turned on the content is written to a file in the *%temp%\VisualStudio\LSP* directory. The log follows the naming format *[LanguageClientName]-[Datetime Stamp].log*. Currently, tracing can only be enabled for open folder scenarios. Opening a single file to activate a language server does not have diagnostics tracing support.

### Custom messages

Expand Down Expand Up @@ -419,7 +419,7 @@ internal class MockCustomLanguageClient : MockLanguageClient, ILanguageClientCus
}

public async Task SendServerCustomNotification(object arg)
{
{
await this.customMessageRpc.NotifyWithParameterObjectAsync("OnCustomNotification", arg);
}

Expand Down