Skip to content

Recent PR made plugin stop working given tailwind.config files more than 2 levels deep from workspace root #78

@mpereira

Description

@mpereira

Hi,

I upgraded lsp-tailwindcss and noticed that the tailwindcss LSP functionality stopped working.

After debugging for a few minutes I narrowed it down to the change introduced in: #71

The following two lines are added to

(f-glob "tailwind.config.*" (lsp-workspace-root))
(f-glob "**/tailwind.config.*" (lsp-workspace-root))

Since f-glob is not recursive, if one has a tailwindcss config file that is not in the workspace root (line 1) or in a directory contained in the workspace root (line 2), (lsp-tailwindcss--has-config-file) will evaluate to nil, causing (lsp-tailwindcss--activate-p) to also evaluate to nil, causing the mode not to be loaded.

My tailwind.config file is exactly 2 levels deep from the workspace root.

The fix would likely involve using a recursive file search that stops on the first match.

My current workaround is to set (setq lsp-tailwindcss-skip-config-check t).

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