tslint-language-service icon indicating copy to clipboard operation
tslint-language-service copied to clipboard

info.project.getCurrentDirectory is not a function

Open sebastiencs opened this issue 7 years ago • 8 comments

Hi,

I'm using javascript-typescript-langserver with emacs. When I try to use tslint-language-service, I have this error:

Plugin activation failed: TypeError: info.project.getCurrentDirectory is not a function

My node_modules folder contains tslint, tslint-language-service and typescript

What could be wrong ?

sebastiencs avatar Apr 29 '18 18:04 sebastiencs

I'm using javascript-typescript-langserver with emacs.

I didin't know javascript-typescript-langserver supports now plugin. I think it's an issue with the implementation of plugin support in javascript-typescript-langserver

angelozerr avatar Apr 30 '18 07:04 angelozerr

There was the issue that javascript-typescript-langserver didn't search the plugin in the right path (not in my node_modules project folder), so I forked it and now it takes the right path: my_project/node_modules/tslint-language-service.

What does this plugin require to make it work ?

sebastiencs avatar Apr 30 '18 11:04 sebastiencs

To be honnest with you, I don't know. You should see tsserver source for that.

angelozerr avatar Apr 30 '18 12:04 angelozerr

I have the same error on Vim8, any news about this ?

[EDIT] The problem seems to come from a bad reference, I'm gonna try a PR.

soywod avatar May 14 '18 23:05 soywod

javascript-typescript-langserver could be extended to do this as well.

I can make this issue resolved from javascript-typescript-langserver, but it still doesn't work, looks like there still some work for javascript-typescript-langserver to be done.

chemzqm avatar May 18 '18 04:05 chemzqm

After some research, javascript-typescript-langserver seems to be late on their type definition. They are based on this commit of TypeScript to define Project (export abstract class Project). But now, on TypeScript master, Project is different (export abstract class Project implements LanguageServiceHost, ModuleResolutionHost), and this method getCurrentDirectory is part of LanguageServiceHost. So I think you are right @chemzqm , javascript-typescript-langserver should update their type.

I think my PR #68 is still a useful temporary fix, the time for javascript-typescript-langserver to improve their implementation, what do you think ?

soywod avatar May 18 '18 10:05 soywod

I would like to avoid doing some hack, so I hope javascript-typescript-langserver will fix this problem. Hope you will understand.

angelozerr avatar May 18 '18 10:05 angelozerr

I understand, and it makes sense. I've sent a PR to javascript-typescript-langserver to make this plugin work.

soywod avatar May 18 '18 13:05 soywod