0.0.8 • Published 4 months ago

@tcx4c70/coc-csharp v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

  1. Install coc.nvim
  2. Install .NET SDK
  3. 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)
    1. Navigate to this feed, search for Microsoft.CodeAnalysis.LanguageServer and download the version matching your OS and architecture.
    2. Unzip the downloaded .nupkg
    3. (Optional) Copy the contents of <zip_root>/content/LanguageServer/<your_arch> to a directory of your choice
    4. Check if it's working by running dotnet <root_dir>/content/LanguageServer/<your_arch>/Microsoft.CodeAnalysis.LanguageServer.dll --version
    5. Set csharp.server.path to the path of the <root_dir>/content/LanguageServer/<your_arch>/Microsoft.CodeAnalysis.LanguageServer.dll in your coc-settings.json
  4. Install the extension by running :CocInstall @tcx4c70/coc-csharp

Configurations

KeyDescriptionDefault
csharp.enableEnable coc-csharp extensiontrue
csharp.server.pathPath to the Roslyn language server""
csharp.server.checkUpdateDurationDuration to check for updates of roslyn language server (only work if coc.server.path is empty)"weekly"
csharp.semanticHighlighting.blackListList of semantic token type names that should be excluded from semantic highlighting. For example, 'punctuation', 'decorator'[]
dotnet.typeMembers.memberInsertionLocationThe insertion location of properties, events, and methods When implement interface or abstract class"withOtherMembersOfTheSameKind"
dotnet.typeMembers.propertyGenerationBehaviorGeneration behavior of properties when implement interface or abstract class"preferThrowingProperties"
dotnet.codeLens.enableReferencesCodeLensSpecifies whether the references CodeLens should be showntrue
dotnet.completion.showCompletionItemsFromUnimportedNamespacesEnables 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 filetrue
dotnet.completion.showNameCompletionSuggestionsPerform automatic object name completion for the members that you have recently selectedtrue
dotnet.completion.provideRegexCompletionsShow regular expressions in completion listtrue
dotnet.completion.triggerCompletionInArgumentListsAutomatically show completion list in argument liststrue
dotnet.backgroundAnalysis.analyzerDiagnosticsScopeRun background code analysis for:openFiles
dotnet.backgroundAnalysis.compilerDiagnosticsScopeShow compiler errors and warnings for:openFiles
dotnet.highlighting.highlightRelatedRegexComponentsHighlight related regular expression components under cursortrue
dotnet.highlighting.highlightRelatedJsonComponentsHighlight related JSON components under cursortrue
csharp.inlayHints.enableInlayHintsForImplicitObjectCreationShow hints for implicit object creationfalse
csharp.inlayHints.enableInlayHintsForImplicitVariableTypesShow hints for variables with inferred typesfalse
csharp.inlayHints.enableInlayHintsForLambdaParameterTypesShow hints for lambda parameter typesfalse
csharp.inlayHints.enableInlayHintsForTypesDisplay inline type hintsfalse
dotnet.inlayHints.enableInlayHintsForIndexerParametersShow hints for indexersfalse
dotnet.inlayHints.enableInlayHintsForLiteralParametersShow hints for literalsfalse
dotnet.inlayHints.enableInlayHintsForObjectCreationParametersShow hints for 'new' expressionsfalse
dotnet.inlayHints.enableInlayHintsForOtherParametersShow hints for everything elsefalse
dotnet.inlayHints.enableInlayHintsForParametersDisplay inline parameter name hintsfalse
dotnet.inlayHints.suppressInlayHintsForParametersThatDifferOnlyBySuffixSuppress hints when parameter names differ only by suffixfalse
dotnet.inlayHints.suppressInlayHintsForParametersThatMatchArgumentNameSuppress hints when argument matches parameter namefalse
dotnet.inlayHints.suppressInlayHintsForParametersThatMatchMethodIntentSuppress hints when parameter name matches the method's intentfalse
dotnet.navigation.navigateToDecompiledSourcesEnable navigation to decomplied sourcestrue
dotnet.navigation.navigateToSourceLinkAndEmbeddedSourcesEnable navigation to source link and embedded sourcestrue
dotnet.quickInfo.showRemarksInQuickInfoShow remarks information when display symboltrue
dotnet.symbolSearch.searchReferenceAssembliesSearch symbols in reference assemblies. It affects features requires symbol searching, such as add importstrue
dotnet.projects.binaryLogPathSets a path where MSBuild binary logs are written to when loading projects, to help diagnose loading errorsnull
dotnet.projects.enableAutomaticRestoreEnables automatic NuGet restore if the extension detects assets are missingtrue

Commands

CommandDescription
dotnet.openSolutionOpen Solution
dotnet.restartServerRestart Language Server
dotnet.restore.allRestore All Projects
dotnet.restore.projectRestore Project

TODO

  • Support more LSP extensions from the language server
  • Add Razor support

Thanks

License

MIT


This extension is built with create-coc-extension

0.0.8

4 months ago

0.0.7

7 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago