resolve tsserver.js via an absolute path (#57)

this commit changes the `tsserver.js` resolution logic to use an
absolute path rather than a relative one. previously, if a user wanted
to use a `tsserver.js` that was local to a project but didn't live in
`node_modules` (which would be automatically resolved by default), the
`tsserver.tsdk` needed to be hardcoded to an absolute path. this
required the user to modify `coc-settings.json` each time they wished to
switch projects. by resolving to an absolute path, a user can now set
the value to a relative path which will resolve correctly per project.

this change facilitates simplified usage of Yarn v2's PnP feature, which
can generate a project-specific `tsserver.js` to enable correct IDE
integration.
This commit is contained in:
Geoff Whatley 2019-09-09 14:04:01 +10:00 committed by Qiming zhao
parent 74bb59b24e
commit 3a4f993918

View file

@ -21,7 +21,7 @@ export class TypeScriptVersion {
}
public get tsServerPath(): string {
return path.join(this.path, 'tsserver.js')
return path.resolve(this.path, 'tsserver.js')
}
public get pathLabel(): string {