Skip to content
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

Tailwindcss and Eslint working with javascriptreact but not typescriptreact. #1019

Open
Matthew-Craig01 opened this issue Aug 13, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@Matthew-Craig01
Copy link

I've configured multi-lang servers for javascriptreact and typescript react:

(setq lsp-bridge-multi-lang-server-extension-list
  '(
    (("ts" )   . "typescript_eslint")
    (("tsx" )   . "typescriptreact_eslint_tailwindcss")
    (("jsx" )   . "javascriptreact_eslint_tailwindcss")
    (("html") . "html_tailwindcss")
    )
  )

typescriptreact_eslint_tailwindcss:

{
  "completion": ["typescriptreact", "tailwindcss"],
  "completion_item_resolve": ["typescriptreact", "tailwindcss"],
  "diagnostics": ["typescriptreact", "vscode-eslint-language-server"],
  "code_action": ["typescriptreact", "vscode-eslint-language-server"],
  "execute_command": ["typescriptreact", "vscode-eslint-language-server"],
  "find_define": "typescriptreact",
  "find_type_define": "typescriptreact",
  "find_implementation": "typescriptreact",
  "find_references": "typescriptreact",
  "peek_find_definition": "typescriptreact",
  "peek_find_references": "typescriptreact",
  "formatting": "typescriptreact",
  "hover": ["typescriptreact", "tailwindcss"],
  "signature_help": "typescriptreact",
  "prepare_rename": "typescriptreact",
  "rename": "typescriptreact",
  "document_symbol": "typescriptreact",
  "workspace_symbol": "typescriptreact",
  "semantic_tokens": "typescriptreact",
  "inlay_hint": "typescriptreact"
}

javascriptreact_eslint_tailwindcss:

{
  "completion": ["javascriptreact", "tailwindcss"],
  "completion_item_resolve": ["javascriptreact", "tailwindcss"],
  "diagnostics": ["javascriptreact", "vscode-eslint-language-server"],
  "code_action": ["javascriptreact", "vscode-eslint-language-server"],
  "execute_command": ["javascriptreact", "vscode-eslint-language-server"],
  "find_define": "javascriptreact",
  "find_type_define": "javascriptreact",
  "find_implementation": "javascriptreact",
  "find_references": "javascriptreact",
  "peek_find_definition": "javascriptreact",
  "peek_find_references": "javascriptreact",
  "formatting": "javascriptreact",
  "hover": ["javascriptreact", "tailwindcss"],
  "signature_help": "javascriptreact",
  "prepare_rename": "javascriptreact",
  "rename": "javascriptreact",
  "document_symbol": "javascriptreact",
  "workspace_symbol": "javascriptreact",
  "semantic_tokens": "javascriptreact",
  "inlay_hint": "javascriptreact"

}

However, only typescriptreact is working in tsx files (not tailwind or eslint)

My temporary solution for the tailwind part of it is to define a tailwindreact server that I've used in javascriptreact_eslint_tailwindcss:

{
  "name": "tailwindreact",
  "languageId": "javascriptreact",
  "command": ["tailwindcss-language-server", "--stdio"],
  "settings": {},
  "support-single-file": false
}

Similary, for eslint, I've changed vscode-eslint-language-server:

 "languageIds": {
    "tsx": "javascriptreact",
    "ts": "typescript",
    "js": "javascript",
    "jsx": "javascriptreact"
  },

This has fixed my issues for now, however, I thought I'd report this in case there was an underlying reason.

@manateelazycat
Copy link
Owner

It's looks you need "javascriptreact" as languageId pass to taildwindcss, otherwise can't work.

Ref issue #907

@manateelazycat manateelazycat added the good first issue Good for newcomers label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants