Skip to content

Allow user to configure path to tsc and tsserver #255

Closed
@hoanhtien

Description

@hoanhtien

For now we are shipping a TypeScript compiler and language service along with the plugin. However, some users have the tendency to stick with certain version of TypeScript and want to use that version in the plugin. It would be good to give them the ability to configure the TypeScript version they want to use.

Current state
Currently we have a setting "typescript_proc_file" to specify path to tsserver.js. There is no similar setting for tsc.

# retrieve the path to tsserver.js
# first see if user set the path to the file
settings = sublime.load_settings('Preferences.sublime-settings')
proc_file = settings.get('typescript_proc_file')
if not proc_file:
    # otherwise, get tsserver.js from package directory
    proc_file = os.path.join(PLUGIN_DIR, "tsserver", "tsserver.js")

Propose
There should be two settings "typescript_tsc_file" and "typescript_tsserver_file" with the following possible values:

  • "plugin": use the tsc/tsserver shipped along with the plugin
  • "global": use the tsc/tsserver in their PATH (most likely installed with NPM)
  • path to executable tsc/tsserver (e.g. tsc.exe) or tsc.js/tsserver.js.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions