Skip to content

ts_ls doesn't work for svelte files #2628

@rado31

Description

@rado31

I use Neovim/NvChad with Mason. typescript-language-server installed and it works for TS files.

As in your documentation https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#svelte, I've installed "typescript-svelte-plugin", there is my package.json

{
	"name": "learning-svelte",
	"version": "0.0.1",
	"type": "module",
	"scripts": {
		"dev": "vite dev",
		"build": "vite build",
		"preview": "vite preview",
		"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
		"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
	},
	"devDependencies": {
		"@sveltejs/adapter-auto": "^3.0.0",
		"@sveltejs/kit": "^2.9.0",
		"@sveltejs/vite-plugin-svelte": "^5.0.0",
		"svelte": "^5.0.0",
		"svelte-check": "^4.0.0",
		"typescript": "^5.0.0",
		"typescript-svelte-plugin": "^0.3.44",
		"vite": "^6.0.0"
	}
}

And also my tsconfig.json

{
	"extends": "./.svelte-kit/tsconfig.json",
	"compilerOptions": {
		"allowJs": true,
		"checkJs": true,
		"esModuleInterop": true,
		"forceConsistentCasingInFileNames": true,
		"resolveJsonModule": true,
		"skipLibCheck": true,
		"sourceMap": true,
		"strict": true,
		"moduleResolution": "bundler",
		"plugins": [ { "name": "typescript-svelte-plugin", "enabled": true } ]
	}
}

But LSP doesn't work for svelte files. Do I need to install "svelte-language-server"? Is it right that 2 LSP work for svelte project (I mean that, won't they conflict with each other?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions