Skip to content

Salsa - reference search across commonjs fails #6682

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

Closed
egamma opened this issue Jan 27, 2016 · 1 comment
Closed

Salsa - reference search across commonjs fails #6682

egamma opened this issue Jan 27, 2016 · 1 comment
Labels
Fixed A PR has been merged for this issue

Comments

@egamma
Copy link
Member

egamma commented Jan 27, 2016

In the following setup:

version: typescript@1.9.0-dev.20160127

jsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5"
    },
    "exclude": [
        "node_modules"
    ]
}

circle.js

const PI = Math.PI;

exports.area = function (r) {
  return PI * r * r;
};

geometry.js

const circle = require('./circle.js');
console.log( `The area of a circle of radius 4 is ${circle.area(4)}`);

Go to definition from geometry.js area works and navigates to the file circle.js.

Doing a reference search from circle.js exports.area doesn't result in any references.

When changing the code of circle.js to:

const PI = Math.PI;

export function area (r) {
  return PI * r * r;
};

then the reference search returns the correct result.

@zhengbli
Copy link
Contributor

This should be fixed by #6632

@zhengbli zhengbli self-assigned this Jan 27, 2016
@zhengbli zhengbli added this to the Salsa 0.9 milestone Jan 27, 2016
@zhengbli zhengbli added Fixed A PR has been merged for this issue Salsa labels Jan 28, 2016
@mhegazy mhegazy modified the milestones: Salsa 0.9, TypeScript 1.8.2 Feb 2, 2016
@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
Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants