Skip to content

internal error: multiple methods appear with identical argument types  #17796

Closed
@0101

Description

@0101

Please provide a succinct description of the issue.

Repro steps

Provide the steps required to reproduce the problem:

  1. Checkout lsp branch
  2. build.cmd -c Debug or just build FSharp.Compiler.LanguageServer project

Expected behavior

Build completes successfully

Actual behavior

We get

error FS0192 : internal error : multiple methods named AddSingleton appear with identical argument types in type Microsoft.Extensions.DependencyInjection.ServiceCollectionSer
viceExtensions [D:\code\fsharp\src\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj]

Related information

Here's the code that triggers the error:

let _ =
serviceCollection
.AddSingleton(initialWorkspace)
.AddSingleton<ContextHolder>()
.AddSingleton<IMethodHandler, InitializeHandler<InitializeParams, InitializeResult, FSharpRequestContext>>()
.AddSingleton<IMethodHandler, InitializedHandler<InitializedParams, FSharpRequestContext>>()
.AddSingleton<IMethodHandler, DocumentStateHandler>()
.AddSingleton<IMethodHandler, LanguageFeaturesHandler>()
.AddSingleton<ILspLogger>(logger)
.AddSingleton<IRequestContextFactory<FSharpRequestContext>, FShapRequestContextFactory>()
.AddSingleton<IHandlerProvider>(fun _ -> this.GetBaseHandlerProvider())
.AddSingleton<IInitializeManager<InitializeParams, InitializeResult>, CapabilitiesManager>()
.AddSingleton(this)
.AddSingleton<ILifeCycleManager>(new LspServiceLifeCycleManager())

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions