Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lua/ember/lsp/typescript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ vim.lsp.config('glint', {
vim.lsp.config('tsc', {
root_dir = utils.is_content_mapper_project,
filetypes = tsFiletypes,
-- nvim-lspconfig's default `tsc` cmd resolves the binary inside its own
-- root_dir function (via a private bin cache). Overriding root_dir above
-- bypasses that, so resolve the workspace binary here instead.
cmd = function(dispatchers, config)
local cmd = 'tsc'
local root = (config or {}).root_dir

if root then
local localBin = vim.fs.joinpath(root, 'node_modules/.bin/tsc')

if vim.fn.executable(localBin) == 1 then
cmd = localBin
end
end

return vim.lsp.rpc.start({ cmd, '--lsp', '--stdio' }, dispatchers)
end,
init_options = {
-- Content mappers spawn processes declared by the project, so TypeScript
-- requires this explicit opt-in (VS Code sends it for trusted workspaces).
Expand Down