@tcx4c70/coc-csharp
tcx4c70C# extension for coc.nvim
Published Package Summary
coc-csharp
C# extension for coc.nvim which uses Roslyn language server.
Almost all the code is taken from vscode-csharp with some modifications to work with coc.nvim.
Note: This extension is still in development and may not work as expected. And I'm a newbie in TypeScript (actually, it's my first time to write TypeScript), so the code may not be the best. Any PRs are welcome.
Install
- Install coc.nvim
- Install .NET SDK
- Install Roslyn language server (Optional. If you don't specify the path via
csharp.server.path, the extension will try to download the language server automatically)- Navigate to NuGet, search for
roslyn-language-serverand download the version matching your OS and architecture, such asroslyn-language-server.linux-x64. - Unzip the downloaded
.nupkg - (Optional) Copy the contents of
<zip_root>/tools/<dotnet_version>/<your_arch>to a directory of your choice - Check if it's working by running
dotnet <root_dir>/tools/<dotnet_version>/<your_arch>/Microsoft.CodeAnalysis.LanguageServer.dll --version - Set
csharp.server.pathto the path of the<root_dir>/tools/<dotnet_version>/<your_arch>/Microsoft.CodeAnalysis.LanguageServer.dllin yourcoc-settings.json
- Navigate to NuGet, search for
- Install the extension by running
:CocInstall @tcx4c70/coc-csharp
Configurations
| Key | Description | Default |
|---|---|---|
csharp.enable | Enable coc-csharp extension | true |
csharp.server.path | Path to the Roslyn language server | "" |
csharp.server.logLevel | Log level of roslyn language server. Possible values are Trace, Debug, Information, Warning, Error, Critical and None | "Information" |
csharp.server.releaseChannel | Release channel of roslyn language server (only work if coc.server.path is empty) | "stable" |
csharp.server.checkUpdateDuration | Duration to check for updates of roslyn language server (only work if coc.server.path is empty and release channel is 'preview') | "weekly" |
csharp.semanticHighlighting.blackList | List of semantic token type names that should be excluded from semantic highlighting. For example, ['punctuation', 'decorator'] | [] |
dotnet.typeMembers.memberInsertionLocation | The insertion location of properties, events, and methods When implement interface or abstract class | "withOtherMembersOfTheSameKind" |
dotnet.typeMembers.propertyGenerationBehavior | Generation behavior of properties when implement interface or abstract class | "preferThrowingProperties" |
dotnet.codeLens.enableReferencesCodeLens | Specifies whether the references CodeLens should be shown | true |
dotnet.completion.showCompletionItemsFromUnimportedNamespaces | Enables support for showing unimported types and unimported extension methods in completion lists. When committed, the appropriate using directive will be added at the top of the current file | true |
dotnet.completion.showNameCompletionSuggestions | Perform automatic object name completion for the members that you have recently selected | true |
dotnet.completion.provideRegexCompletions | Show regular expressions in completion list | true |
dotnet.completion.triggerCompletionInArgumentLists | Automatically show completion list in argument lists | true |
dotnet.backgroundAnalysis.analyzerDiagnosticsScope | Run background code analysis for: | openFiles |
dotnet.backgroundAnalysis.compilerDiagnosticsScope | Show compiler errors and warnings for: | openFiles |
dotnet.highlighting.highlightRelatedRegexComponents | Highlight related regular expression components under cursor | true |
dotnet.highlighting.highlightRelatedJsonComponents | Highlight related JSON components under cursor | true |
csharp.inlayHints.enableInlayHintsForImplicitObjectCreation | Show hints for implicit object creation | false |
csharp.inlayHints.enableInlayHintsForImplicitVariableTypes | Show hints for variables with inferred types | false |
csharp.inlayHints.enableInlayHintsForLambdaParameterTypes | Show hints for lambda parameter types | false |
csharp.inlayHints.enableInlayHintsForTypes | Display inline type hints | false |
dotnet.inlayHints.enableInlayHintsForIndexerParameters | Show hints for indexers | false |
dotnet.inlayHints.enableInlayHintsForLiteralParameters | Show hints for literals | false |
dotnet.inlayHints.enableInlayHintsForObjectCreationParameters | Show hints for 'new' expressions | false |
dotnet.inlayHints.enableInlayHintsForOtherParameters | Show hints for everything else | false |
dotnet.inlayHints.enableInlayHintsForParameters | Display inline parameter name hints | false |
dotnet.inlayHints.suppressInlayHintsForParametersThatDifferOnlyBySuffix | Suppress hints when parameter names differ only by suffix | false |
dotnet.inlayHints.suppressInlayHintsForParametersThatMatchArgumentName | Suppress hints when argument matches parameter name | false |
dotnet.inlayHints.suppressInlayHintsForParametersThatMatchMethodIntent | Suppress hints when parameter name matches the method's intent | false |
dotnet.navigation.navigateToDecompiledSources | Enable navigation to decomplied sources | true |
dotnet.navigation.navigateToSourceLinkAndEmbeddedSources | Enable navigation to source link and embedded sources | true |
- C# extension for coc.nvim
- onLanguage:csharp
- onLanguage:cs
- workspaceContains:**/*.{sln,slnx,csproj}
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for @tcx4c70/coc-csharp@1.1.1.
| Command (:CocCommand) | Description |
|---|---|
| dotnet.openSolution | Open Solution |
| dotnet.restartServer | Restart Language Server |
| dotnet.restore.project | Restore Project |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable coc-csharp extension"
}Raw JSON Schema
{
"type": "string",
"default": "",
"description": "Path to roslyn language server (note: need to be the path of the dll file instead of the executable file), e.g.: ~/.roslyn/content/LanguageServer/osx-arm64/Microsoft.CodeAnalysis.LanguageServer.dll. If it's empty, the extension will download roslyn language server and use it."
}Raw JSON Schema
{
"enum": [
"Trace",
"Debug",
"Information",
"Warning",
"Error",
"Critical",
"None"
],
"type": "string",
"default": "Information",
"description": "Log level of roslyn language server. The default value is 'Information'."
}Raw JSON Schema
{
"enum": [
"stable",
"preview"
],
"type": "string",
"default": "stable",
"description": "Release channel of roslyn language server (only work if coc.server.path is empty). The default value is 'stable'.",
"enumDescriptions": [
"Use the latest stable version of roslyn-language-server.",
"Use the latest preview version of roslyn-language-server. It might be unstable but will have the latest features and fixes."
]
}Raw JSON Schema
{
"type": "string",
"scope": "machine-overridable",
"default": null,
"description": "Sets a path where MSBuild binary logs are written to when loading projects, to help diagnose loading errors."
}Raw JSON Schema
{
"enum": [
"never",
"always",
"daily",
"weekly",
"monthly"
],
"type": "string",
"default": "weekly",
"description": "Duration to check for updates of roslyn language server (only work if coc.server.path is empty and release channel is 'preview'). For stable release channel, this configuration is ignored and updates will be checked on every activation.",
"enumDescriptions": [
"Never check for updates",
"Always check for updates",
"Check for updates daily",
"Check for updates weekly",
"Check for updates monthly"
]
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Specifies whether the run and debug test CodeLens should be shown."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "List of semantic token type names that should be excluded from semantic highlighting. For example, ['punctuation', 'decorator']. For full list of semantic token type names, please refer to https://github.com/dotnet/roslyn/blob/main/src/LanguageServer/Protocol/Protocol/SemanticTokens/SemanticTokenTypes.cs and https://github.com/dotnet/roslyn/blob/main/src/LanguageServer/Protocol/Handler/SemanticTokens/CustomLspSemanticTokenNames.cs."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enables automatic NuGet restore if the extension detects assets are missing."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Show remarks information when display symbol."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Specifies whether the references CodeLens should be shown."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Show regular expressions in completion list."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Display inline type hints"
}Raw JSON Schema
{
"enum": [
"withOtherMembersOfTheSameKind",
"atTheEnd"
],
"type": "string",
"default": "withOtherMembersOfTheSameKind",
"description": "The insertion location of properties, events, and methods When implement interface or abstract class.",
"enumDescriptions": [
"Place them with other members of the same kind.",
"Place them at the end."
]
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable navigation to decomplied sources."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Search symbols in reference assemblies. It affects features requires symbol searching, such as add imports."
}Raw JSON Schema
{
"enum": [
"preferThrowingProperties",
"preferAutoProperties"
],
"type": "string",
"default": "preferThrowingProperties",
"description": "Generation behavior of properties when implement interface or abstract class.",
"enumDescriptions": [
"Prefer throwing properties.",
"Prefer auto properties."
]
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Perform automatic object name completion for the members that you have recently selected."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Display inline parameter name hints"
}Raw JSON Schema
{
"enum": [
"openFiles",
"fullSolution",
"none"
],
"type": "string",
"default": "openFiles",
"description": "Run background code analysis for:",
"enumDescriptions": [
"Open documents",
"Entire solution",
"None"
]
}Raw JSON Schema
{
"enum": [
"openFiles",
"fullSolution",
"none"
],
"type": "string",
"default": "openFiles",
"description": "Show compiler errors and warnings for:",
"enumDescriptions": [
"Open documents",
"Entire solution",
"None"
]
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Automatically show completion list in argument lists"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Highlight related JSON components under cursor."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Highlight related regular expression components under cursor."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show hints for everything else"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show hints for indexers"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show hints for literals"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable navigation to source link and embedded sources."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show hints for lambda parameter types"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show hints for variables with inferred types"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show hints for implicit object creation"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enables support for showing unimported types and unimported extension methods in completion lists. When committed, the appropriate using directive will be added at the top of the current file."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Show hints for 'new' expressions"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Suppress hints when argument matches parameter name"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Suppress hints when parameter name matches the method's intent"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Suppress hints when parameter names differ only by suffix"
}