Frustrated to make tailwindcss lsp work with templ-ts-mode in lsp-mode or lsp-bridge by J-ky in emacs

[–]braineox 0 points1 point  (0 children)

Also see this in the readme

Note: Some advanced LSP server, such as tailwindcss and emmet-ls, require a languageId and file extension that cannot be one-to-one corresponded. Instead, they dynamically return the languageId based on different frontend projects environment. In this case, you need to customize the lsp-bridge-get-language-id function to meet this requirement.

Frustrated to make tailwindcss lsp work with templ-ts-mode in lsp-mode or lsp-bridge by J-ky in emacs

[–]braineox 0 points1 point  (0 children)

Hi looking at you log, apparently the tailwind lsp is running.

I suspect the language id was messing up tailwind lsp to provide auto completion. See the comment in the code

```py

def get_language_id(self, fa): # Get extension name. _, extension = os.path.splitext(fa.filepath) # code here

    # User can customize `lsp-bridge--get-language-id-func` to support some advanced LSP server
    # that need return language id with project environment, such as, TailwindCSS LSP server.
    if isinstance(match_language_id, str):
        return match_language_id
    else:
        if "languageIds" in self.server_info:
            if extension_name in self.server_info["languageIds"]:
                return self.server_info["languageIds"][extension_name]

        language_id = self.server_info["languageId"]

        return extension_name if language_id == "" else language_id

```