From @abc1236762 on December 15, 2016 19:4
- VSCode Version: 1.8.0
- OS Version: Windows 10.0.14393
Steps to Reproduce:
- Create a project folder and create
func.js, main.js, and jsconfig.json in it.
jsconfig.json:
{
"compilerOptions": {
"target": "ES6"
},
"file": [
"func.js"
]
}
func.js:
function Test() {
// ...
}
// ...
Test.a = function() {
// ...
var k = require('n');
// ...
return 0;
};
// ...
Test.prototype.b = function() {
// ...
var k = require('n');
// ...
return 1;
};
main.js:
Test.a();
var test = new Test();
test.b();
-
Open main.js, and move mouse on Test or a() at line 1, the ToolTip shows any, move mouse on any words, the ToolTip shows the sentence that have any. Also autocomplete do not show a when I type Test. and b when I type test..
-
Edit func.js, make lines which has require as comment, like :
function Test() {
// ...
}
// ...
Test.a = function() {
// ...
//var k = require('n');
// ...
return 0;
};
// ...
Test.prototype.b = function() {
// ...
//var k = require('n');
// ...
return 1;
};
- Open main.js, and move mouse on
Test at line 1 and line 2, the ToolTip shows function Test(): void, but move mouse on a() at line 1, the ToolTip still shows any, move mouse on any words at line 2 and line 3, the ToolTip shows the sentence that haven't any. For example, test shows
var test: {
b: () => number;
}
- Output
Test.a() can get 0, test.b() can get 1. At Step 4, Visual Studio Code found the definition of test.b() as Test.prototype.b (move mouse on b() at line 3 and the ToolTip shows (property) Test.b: () => number), but not found the definition of Test.a() because move mouse on a() at line 1 and the ToolTip shows any. Also autocomplete show b when I type test., but not show a when I type Test..
Conclusion:
If the definition of the method or prototype of function in JavaScript have method require() in it, Intellisense in Visual Studio Code cannot find the definition of "that function, the prototype of that function, and the method of that function" at another JS file.
If the definition of the method or prototype of function in JavaScript do not have method require() in it, Intellisense in Visual Studio Code can find the definition of "that function, and the prototype of that function" at another JS file, but still cannot find the definition of method of that function at another JS file.
Copied from original issue: microsoft/vscode#17339
From @abc1236762 on December 15, 2016 19:4
Steps to Reproduce:
func.js,main.js, andjsconfig.jsonin it.jsconfig.json:{ "compilerOptions": { "target": "ES6" }, "file": [ "func.js" ] }func.js:main.js:Open main.js, and move mouse on
Testora()at line 1, the ToolTip showsany, move mouse on any words, the ToolTip shows the sentence that haveany. Also autocomplete do not showawhen I typeTest.andbwhen I typetest..Edit
func.js, make lines which hasrequireas comment, like :Testat line 1 and line 2, the ToolTip showsfunction Test(): void, but move mouse ona()at line 1, the ToolTip still showsany, move mouse on any words at line 2 and line 3, the ToolTip shows the sentence that haven'tany. For example,testshowsTest.a()can get0,test.b()can get1. At Step 4, Visual Studio Code found the definition oftest.b()asTest.prototype.b(move mouse onb()at line 3 and the ToolTip shows(property) Test.b: () => number), but not found the definition ofTest.a()because move mouse ona()at line 1 and the ToolTip showsany. Also autocomplete showbwhen I typetest., but not showawhen I typeTest..Conclusion:
If the definition of the method or prototype of function in JavaScript have method
require()in it, Intellisense in Visual Studio Code cannot find the definition of "that function, the prototype of that function, and the method of that function" at another JS file.If the definition of the method or prototype of function in JavaScript do not have method
require()in it, Intellisense in Visual Studio Code can find the definition of "that function, and the prototype of that function" at another JS file, but still cannot find the definition of method of that function at another JS file.Copied from original issue: microsoft/vscode#17339