Sublime Forum

Support React Typescript (TSX) with LSP and typescript-language-server

#1

Has anyone got .tsx files working with typescript-language-server for React?

Here’s my current configuration in an attempt to get it working

{
	"folders":
	[
		{
			"path": "."
		}
	],
	"settings":
	{
		"LSP":
		{
			"typescript-language-server":
			{
				"enabled": true,
    "scopes": [
      "source.tsx"
    ],
    "languageId": "typescriptreact",
    "syntaxes": [
      "Packages/JavaScript/JavaScript.sublime-syntax",
      "Packages/TypeScript Syntax/TypeScriptReact.tmLanguage"
    ]
			}
		}
	}
}
0 Likes

#2

I don’t know about the LSP package, nor React, but have you tried using the TypeScript package by Microsoft? It seems to come with TypeScript React out-of-the-box, and it also has LSP integrated.

0 Likes

#3

Yes, https://packagecontrol.io/packages/JSCustom support react and typescript syntax highlighting. I have been using, and it works great. But you need to configure it first.

0 Likes