Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

info.project.getCurrentDirectory is not a function #67

Open
sebastiencs opened this issue Apr 29, 2018 · 8 comments
Open

info.project.getCurrentDirectory is not a function #67

sebastiencs opened this issue Apr 29, 2018 · 8 comments

Comments

@sebastiencs
Copy link

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 ?

@angelozerr
Copy link
Owner

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

@sebastiencs
Copy link
Author

sebastiencs commented Apr 30, 2018

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 ?

@angelozerr
Copy link
Owner

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

@soywod
Copy link

soywod commented May 14, 2018

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.

@chemzqm
Copy link

chemzqm commented May 18, 2018

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.

@soywod
Copy link

soywod commented May 18, 2018

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 ?

@angelozerr
Copy link
Owner

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

@soywod
Copy link

soywod commented May 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants