Skip to content

Quick Info for imported JSON #12426

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
waderyan opened this issue Nov 21, 2016 · 6 comments
Closed

Quick Info for imported JSON #12426

waderyan opened this issue Nov 21, 2016 · 6 comments
Assignees
Labels
Duplicate An existing issue was already created VS Code Tracked There is a VS Code equivalent to this issue

Comments

@waderyan
Copy link

From @Thaina on December 17, 2015 12:13

require("file.json") should load json data with the intellisense as of require another js with module.exports. But vscode can't parse it out to intellisense

Copied from original issue: microsoft/vscode#1415

@waderyan
Copy link
Author

From @dbaeumer on December 17, 2015 15:3

@Thaina can you please provide an example. It is hard to understand what exactly you mean.

@waderyan
Copy link
Author

From @Thaina on December 18, 2015 3:10

@dbaeumer
I have config.js

module.exports = {
	"season": 1
};

and config.json

{
	"season": 1
}

As you can see. require js file got the intellisense loaded. But json file cannot

image

@waderyan
Copy link
Author

From @Thaina on December 19, 2015 18:52

@dbaeumer @bpasero What info you still need?

@waderyan
Copy link
Author

From @egamma on December 20, 2015 17:7

@Thaina. Now it is clear, thanks. Node.js supports to require a json file since a while, but unfortunately we do not support this in the JS language service, yet.

@waderyan
Copy link
Author

Looking at this today and it looks like we don't get IntelliSense for either.

image\

Output from TS Service confirms Visual Studio Code is displaying the correct info.

[Trace - 2:49:22 PM] Sending request: quickinfo (14). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/waander/Development/Microsoft/Sandbox/test/test.ts",
    "line": 1,
    "offset": 10
}
[Trace - 2:49:22 PM] Response received: quickinfo (14). Request took 2 ms. Success: true 
Result: {
    "kind": "var",
    "kindModifiers": "",
    "start": {
        "line": 1,
        "offset": 5
    },
    "end": {
        "line": 1,
        "offset": 11
    },
    "displayString": "var config: any",
    "documentation": ""
}
[Trace - 2:49:22 PM] Sending request: quickinfo (15). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/waander/Development/Microsoft/Sandbox/test/test.ts",
    "line": 1,
    "offset": 10
}
[Trace - 2:49:22 PM] Response received: quickinfo (15). Request took 1 ms. Success: true 
Result: {
    "kind": "var",
    "kindModifiers": "",
    "start": {
        "line": 1,
        "offset": 5
    },
    "end": {
        "line": 1,
        "offset": 11
    },
    "displayString": "var config: any",
    "documentation": ""
}
[Trace - 2:49:32 PM] Sending request: quickinfo (16). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/waander/Development/Microsoft/Sandbox/test/test.ts",
    "line": 2,
    "offset": 7
}
[Trace - 2:49:32 PM] Response received: quickinfo (16). Request took 2 ms. Success: true 
Result: {
    "kind": "var",
    "kindModifiers": "",
    "start": {
        "line": 2,
        "offset": 5
    },
    "end": {
        "line": 2,
        "offset": 9
    },
    "displayString": "var conf: any",
    "documentation": ""
}

@waderyan waderyan added VS Code Tracked There is a VS Code equivalent to this issue and removed feature-request labels Nov 21, 2016
@waderyan waderyan changed the title intellisense is not loaded correctly when nodejs require json file Quick Info for imported JSON Nov 21, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Nov 22, 2016

Duplicate of #7071

@mhegazy mhegazy closed this as completed Nov 22, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Nov 22, 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
Duplicate An existing issue was already created VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants