Skip to content

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

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())

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions