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

intellisense does not work when using module.exports.fnName #7824

Closed
egamma opened this issue Apr 5, 2016 · 12 comments
Closed

intellisense does not work when using module.exports.fnName #7824

egamma opened this issue Apr 5, 2016 · 12 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@egamma
Copy link
Member

egamma commented Apr 5, 2016

From @SamVerschueren on April 5, 2016 6:53

  • VSCode Version: 0.10.14 (insiders) and below
  • OS Version: Mac OS X 10.11.3

Steps to Reproduce:

  1. Create a file called cfx.js with the following content
'use strict';
module.exports.generateCanvas = function (fileOrUrl) {
    console.log(fileOrUrl);
};
  1. Create a file index.js
'use strict';
var cfx = require('./file1');
  1. When you type cfx. in index.js, it will not suggest generateCanvas. If you change cfx.js to exports.generateCanvas instead of module.exports.generateCanvas, it works.

This seems to be a bug because both notations are equivalent.

Copied from original issue: microsoft/vscode#4943

@NickGrease
Copy link

I just wanted to add that this issue happens on Windows 10 / VSCode-10.14 as well.

@danielo515
Copy link

Why is this closed? it still happening:

OS X El Capitán
VSCode Versión 1.5.2 (1.5.2)

I have to attach the exports directly to the exports object instead of module.exports which I prefer.

Regards

@kitsonk
Copy link
Contributor

kitsonk commented Sep 16, 2016

This is part of TypeScript 2.0, which isn't quite yet GA. Have you manually updated your VSCode to use TypeScript 2.0?

@danielo515
Copy link

Hello @kitsonk , no I did not. Is there any manual somewhere?

@osapishchuk
Copy link

osapishchuk commented Mar 23, 2017

Still reproducing on VSC 2.2.1

With module.exports = ABTest it's not working. But if I change to exports = ABTest it working.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 24, 2017

@GEKTORIAN can you file a new issue and share more details.

@zhengbli
Copy link
Contributor

@GEKTORIAN can you share your version of TS as well in the new issue. I could not repro with the latest:
image

@osapishchuk
Copy link

osapishchuk commented Mar 27, 2017

I have 2 files. One is -> node_modules\dw\order\OrderMgr.js. Example of the code:
var OrderMgr = function(){};
OrderMgr.getOrder = function(){};
module.exports = OrderMgr;
Another file from project source doing require ->
var OrderMgr = require('dw/order/OrderMgr');
When I try to type OrderMgr.(ctrl+space) - I see only this https://puu.sh/v0xZY/5d2a81cedd.png

While in WebStorm I have this autocomplete based on OrderMgr content -> https://puu.sh/v0yAF/fb90821371.png

p.s. I'm trying to create self-documented autocomplete for specific platform, that's my methods are empty and I wish to use JSDoc to describe what they are doing and show them in autocomplete. Any help is appreciated here.

cc @mhegazy && @zhengbli

@zhengbli
Copy link
Contributor

Can you elaborate where do these things in the webstorm screenshot come from? Since it is not from your sample code. And the VSCode screenshot shows that we know the OrderMgr is a function, hence the apply etc. methods, that's what we mean by saying this issue is fixed.

@osapishchuk
Copy link

@zhengbli it is from my sample code, I just didn't add rest of the methods, full version will be -

var OrderMgr = function(){};

OrderMgr.getOrder = function(){};
OrderMgr.queryOrders = function(){};
OrderMgr.searchOrder = function(){};
OrderMgr.failOrder = function(){};
OrderMgr.cancelOrder = function(){};
OrderMgr.placeOrder = function(){};
OrderMgr.searchOrders = function(){};
OrderMgr.createOrder = function(){};
OrderMgr.undoFailOrder = function(){};
OrderMgr.processOrders = function(){};
OrderMgr.describeOrder = function(){};
OrderMgr.queryOrder = function(){};
OrderMgr.createShippingOrders = function(){};

OrderMgr.order=null;

module.exports = OrderMgr;

@zhengbli
Copy link
Contributor

Still not reproing this. Is my setup correct?
untitled

I guess there may be some else bugs that messed up your intellisense. If you can create a minimum repro project that would be helpful.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

10 participants