Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants