Skip to content

Language Server apparent infinite loop #1399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PhilipTrauner opened this issue Jun 4, 2025 · 5 comments · Fixed by #1400
Closed

Language Server apparent infinite loop #1399

PhilipTrauner opened this issue Jun 4, 2025 · 5 comments · Fixed by #1400
Labels
bug Something isn't working

Comments

@PhilipTrauner
Copy link

What version of Tailwind CSS are you using?

4.1.8

What operating system are you using?

macOS

Reproduction URL

@theme {
    --color-label: rgb(from var(--color-label) r g b);
}

@utility color-scheme-light {
    --color-label: black;
}

@utility color-scheme-dark {
    --color-label: white;
}

@layer base {
    @media (prefers-color-scheme: light) {
        :root {
            @apply color-scheme-light;
        }
    }

    @media (prefers-color-scheme: dark) {
        :root {
            @apply color-scheme-dark;
        }
    }
}

Describe your issue

when porting the pattern above from Tailwind v3, i noticed that the Tailwind language server became caught in what appears to be an infinite loop.
building (with postcss) still succeeds, and does not consume excessive resources.

the same behavior does not occur when using a different, non-shadowed, variable name.

@theme {
    --color-label: rgb(from var(---color-label) r g b);
}

@utility color-scheme-light {
    ---color-label: black;
}

@utility color-scheme-dark {
    ---color-label: white;
}

if my assumption is correct, and the name shadowing is the root cause here, i would not mind if shadowing was flagged as an error.

@RobinMalfait RobinMalfait transferred this issue from tailwindlabs/tailwindcss Jun 4, 2025
@thecrypticace
Copy link
Contributor

I thought I had fixed this 🤔

Will take a look!

@thecrypticace
Copy link
Contributor

@PhilipTrauner Are you sure you're on the latest language server / VSCode extension version? If so can you provide a reproduction project I can clone?

@thecrypticace thecrypticace added the question Further information is requested label Jun 4, 2025
@PhilipTrauner
Copy link
Author

@thecrypticace will put together an example project in a short while, but until then, some here's more details:

  • i'm using Zed, which uses version 0.14.20 of @tailwindcss/language-server
  • the rpc message that causes the infinite loop is the following
    {"jsonrpc":"2.0","id":182,"method":"completionItem/resolve","params":{"label":"text-label","kind":21,"sortText":"18330","data":{"_projectKey":"0","variants":[]}}}
  • hovering (textDocument/hover) does not cause the loop

@thecrypticace
Copy link
Contributor

@PhilipTrauner Ooooh yep I can reproduce the resolve causing a freeze. Thanks! Can forget about the repro then!

@thecrypticace thecrypticace added bug Something isn't working and removed question Further information is requested labels Jun 4, 2025
@thecrypticace
Copy link
Contributor

I plan to get a release out with this fix soon (hopefully today)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants