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

cannot have code completion for node.js typings in a nodeclipse project with palantir typescript builder #326

Open
johnson-ajar opened this issue Jul 13, 2016 · 1 comment

Comments

@johnson-ajar
Copy link

Hi,
I am a java developer trying to set up an dev environment to do some development using nodeclipse and typescript and angular2.

I installed nodeclipse and then eclipse-typescript.
Created a simple helloworld typescript nodeclipse project.
Then selected the typescript builder.

I create an empty file and then typed.
var http = require("http");

then if I type http. you should expect a menu with list of options available, I don't get any.
But if type
console. then I get a menu with list of options available.

For some reason the code completion for node.js functionality is not working.

I tried including node.d.ts into the projects, but it resulted in error that there is duplicate copy of require.

Not sure how to make the code completion for node.js to work in an nodeclipse project which uses typescript builder.

Please help me to fix this issue.

thanks in advance.
Johnson Abraham

@markwongsk
Copy link

Hey johnson,

In node.d.ts, require extends the following signature:

interface NodeRequireFunction {
    (id: string): any;
}

This means, in particular, that http gets declared as a var with type any. If I do

import * as http from "http";

then I get the autocompletions. Does this help?

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

2 participants