tide
tide copied to clipboard
Output stderr when starting tsserver
Checklist
- [X] I have searched both open and closed issues and cannot find a duplicate.
- [ ] I can reproduce the problem with the latest version of the relevant packages.
- [ ] The problem still occurs after I issued
M-x tide-restart-server
in the buffer where I had the problem. - [ ] I verified that the version and the configuration file path reported by
M-x tide-verify-setup
are correct. - [ ] If tide is reporting an error or warning I think should not be reported, I can run
tsc
(andtslint
, if applicable) without the error or warning I'm seeing in tide. - [ ] If tide is not reporting an error or warning I think should be reported,
tsc
(ortslint
, if applicable) reports the error or warning I was expecting to see. - [X] I am positive the problem does not belong to
typescript-mode
ortsserver
.
Relevant Version Numbers
- Tide:
v5.1.3
- TypeScript:
tsc --version Version 5.5.4
- Emacs:
29.4
Steps to Reproduce the Bug
Not a bug but I have done some debugging for errors very similar to https://github.com/ananthakumaran/tide/issues/438 and https://github.com/ananthakumaran/tide/issues/87.
Expected Behavior
When the tsserver
process cannot start, it would be good to see why in the message buffer.
Actual Behavior
In many occasions this does happen.
I was able to get good output by setting this:
(set-process-sentinel process #'tide-net-sentinel)
In my case the error was:
Couldn’t locate project root folder with a tsconfig.json or jsconfig.json file. Using ’/home/user/.config/emacs/lib/tide/’ as project root.
At the point I kind of asked myself why that's the case and stumble across Emacs Async Processes page. It might be the case that start-process
, being a wrapper, does not do much with regards to :stderr
(see make-process
).
I am not sure cause haven't tried (yet) but probably using make-process
would give more control over the output and will end up showing the right message.