Skip to content

noogle.dev opens whenever any button is pressed when cursor is on a lib.* function with recent nixd #98

Closed

Description

@neko-kai

Following nix-community/nixd#764 when using a recent nixd (e.g. from nixpkgs/unstable) whenever the cursor is on a symbol from lib.* and ANY key or mouse button is pressed, a new browser tab opens with https://noogle.dev/f/lib/abc

Activity

  1. JojOatXGME commented on Feb 14, 2026

    @JojOatXGME
    Contributor

    Thanks for your report. Unfortunately, I am not sure if I will find time to work on this topic soon. 😞 (I will try, though.)

  2. Meallia commented on May 2, 2026

    @Meallia
    Contributor

    I did some research and I think I get why this happens

    The LSP client ( the IDE ) receives the following codeAction from the LSP server ( nixd ):

    kind: refactor
    title: Open Noogle documentation for mkIf
    data: {"noogleUrl": "https://noogle.dev/f/lib/mkIf"}

    It then tries to build an Intention action ( The yellow light bulb ), to do that, it calls the server back to get the diff.
    Instead of providing a diff, the LSP server replies with window/showDocument with the noogle URL as parameter.

    I found a way to suppress this by overriding the lspCustomization class in NixLspServerDescriptor, I'll try to craft a PR with it ( maybe with a checkbox in the LSP settings ).

        override val lspCustomization: LspCustomization = object : LspCustomization() {
            override val codeActionsCustomizer = object : LspCodeActionsSupport() {
                private fun isNixdOpenNoogleCodeAction(codeAction: CodeAction): Boolean =
                    codeAction.kind == "refactor" && (codeAction.data as? JsonObject)?.has("noogleUrl") ?: false
    
                override fun createIntentionAction(lspServer: LspServer, codeAction: CodeAction): LspIntentionAction? =
                    if (isNixdOpenNoogleCodeAction(codeAction)) {
                        /* Discard the code action */
                        null
                    } else {
                        super.createIntentionAction(lspServer, codeAction)
                    }
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions