2

I had been working with vs code for a while to develop NodeJS projects however IntelliSense not working for the classes and files I am writing, I had tried the solution inside here but it did not work for me, so anyone can help me to fix this problem.

VS code version:1.25.0

NodeJS version:8.9.4

An example about IntelliSense problem:

This is a simple class This is a simple class

As you can see when I am importing it from another file no IntelliSense is working As you can see when I am importing it from another file no IntelliSense is working But the node_module files IntelliSense is working But the node_module files IntelliSense is working!

Mahmoud Heretani
  • 555
  • 1
  • 6
  • 17

1 Answers1

0

I tried to solve it with a different syntax to export the class:

class Util {
    constructor() { }

    getNumber(x, y) {
        return x * y;
    }
}

exports.default = Util;

Then, I could import the class like this

const util = require('./../util/util').default;

And the autocompletion works:

enter image description here

Philipp Kief
  • 8,172
  • 5
  • 33
  • 43