module Unison.Codebase.Editor.HandleInput.LSPDebug (debugLspNameCompletion) where import Unison.Cli.Monad (Cli) import Unison.Cli.Monad qualified as Cli import Unison.Cli.NamesUtils qualified as Cli import Unison.Codebase.Editor.Output (Output (DisplayDebugLSPNameCompletions)) import Unison.LSP.Completion qualified as Completion import Unison.Prelude debugLspNameCompletion :: Text -> Cli () debugLspNameCompletion :: Text -> Cli () debugLspNameCompletion Text prefix = do Names names <- Cli Names Cli.currentNames let ct :: CompletionTree ct = Names -> CompletionTree Completion.namesToCompletionTree Names names let (Bool _, [(Text, Name, LabeledDependency)] matches) = CompletionTree -> Text -> (Bool, [(Text, Name, LabeledDependency)]) Completion.completionsForQuery CompletionTree ct Text prefix Output -> Cli () Cli.respond (Output -> Cli ()) -> Output -> Cli () forall a b. (a -> b) -> a -> b $ [(Text, Name, LabeledDependency)] -> Output DisplayDebugLSPNameCompletions [(Text, Name, LabeledDependency)] matches