Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
VS Code - How to use "code completion" on some object that used in another file

I currently build a back-end using NodeJs.

To make the route, I should code like this:

// sever.js
server.route({
    path: '/some/path',
    method: 'GET',
    handler: (request, reply) => {
        return reply.response('trick or treat');
    }
})

If I make the route like this, there will be code completion when I type request or reply and show all of these properties, include the info. Because the intelliSense will recognize it as a member of server object(handler's parameters).

Now, I want to separate the main server and routes. Will be look like this:

// server.js
const routes = require('./routes');

server.routes(routes);
// routes.js
module.exports = [
    {
        path: '/some/path',
        method: 'GET',
        handler: (request, reply) => {
            return reply.response('trick or treat');
        }
    },
    ...
];

Now, when I type request or reply, there is no code completion like before. What I wanted is how to make intelliSense recognise the request and reply as a member of server object so that there will be code completion, parameter info, etc.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!