Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

[Feature] Allow using locally installed version of tsserver #154

Closed

Description

@remagpie

Summary

Allow users to pick the tsserver.js from the node_modules folder at the current project root if it exists.

Motivation

Most of the projects using typescript specifies their own version of the compiler as a dependency. Since the typescript introduces some breaking changes and new features when bumping their versions, it's pretty natural to use the locally installed version of the compiler rather than the global one. However, ide-typescript currently passes the path to the bundled version of the tsserver.js rather than using the project-local one.

One of the solutions for this situation would be providing an option for using a locally installed version of the tsserver if it exists. Maybe the simplest solution would be done by providing a boolean flag to interpret specified path as a relative path from the ide-typescript's installed directory or current project's root directory. Similar approach is implemented by prettier-atom package.

Describe alternatives you've considered

None

Additional context

startServerProcess() {

This line of code decides the path of the tsserver.js to use.

Activity

  1. remagpie commented on Jul 13, 2019

    @remagpie
    ContributorAuthor

    I found out that if a relative path was provided as an option, this package tries to find tsserver from the path where the package was installed.
    I think finding it from the current project's path would be a good solution for this.

  2. vlad0337187 commented on Sep 25, 2021

    @vlad0337187

    Found problem with merged PR:

    If to open project without locally specified TS server path, it will show error alert.
    Also if to open project with locally specified TS server path, it'll show error alert anyway, because project path is not always set.

    Added fix:
    #166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions