Skip to content

Output stderr when starting tsserver #473

@arichiardi

Description

@arichiardi

Checklist

  • 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 (and tslint, 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 (or tslint, if applicable) reports the error or warning I was expecting to see.
  • I am positive the problem does not belong to typescript-mode or tsserver.

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 #438 and #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions