-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
add more information to quickinfo for imported symbols #19489
Conversation
ea0d56d
to
9aaa6d2
Compare
@DanielRosenwasser and @bowdenk7 can i get your input on this? |
27f02d9
to
d268886
Compare
verify.baselineQuickInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was a bit difficult to decipher, so I swapped it for a baseline. Hope that's alright. If it helps, this is the diff for it against master.
diff --git a/tests/baselines/reference/quickInfoDisplayPartsInternalModuleAlias.baseline b/tests/baselines/reference/quickInfoDisplayPartsInternalModuleAlias.baseline
index 6c2047f..c476aba 100644
--- a/tests/baselines/reference/quickInfoDisplayPartsInternalModuleAlias.baseline
+++ b/tests/baselines/reference/quickInfoDisplayPartsInternalModuleAlias.baseline
@@ -1,434 +1,722 @@
[
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInternalModuleAlias.ts",
"position": 66
},
"quickInfo": {
"kind": "alias",
"kindModifiers": "",
"textSpan": {
"start": 66,
"length": 2
},
"displayParts": [
{
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "namespace",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "a1",
+ "kind": "aliasName"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
"text": "import",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "a1",
"kind": "aliasName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m",
"kind": "moduleName"
}
],
"documentation": [],
"tags": []
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInternalModuleAlias.ts",
"position": 82
},
"quickInfo": {
"kind": "alias",
"kindModifiers": "",
"textSpan": {
"start": 82,
"length": 2
},
"displayParts": [
{
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "namespace",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "a1",
+ "kind": "aliasName"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
"text": "import",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "a1",
"kind": "aliasName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m",
"kind": "moduleName"
}
],
"documentation": [],
"tags": []
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInternalModuleAlias.ts",
"position": 104
},
"quickInfo": {
"kind": "alias",
"kindModifiers": "",
"textSpan": {
"start": 104,
"length": 2
},
"displayParts": [
{
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "namespace",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "a2",
+ "kind": "aliasName"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
"text": "import",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "a2",
"kind": "aliasName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m",
"kind": "moduleName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "m1",
"kind": "moduleName"
}
],
"documentation": [],
"tags": []
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInternalModuleAlias.ts",
"position": 123
},
"quickInfo": {
"kind": "alias",
"kindModifiers": "",
"textSpan": {
"start": 123,
"length": 2
},
"displayParts": [
{
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "namespace",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "a2",
+ "kind": "aliasName"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
"text": "import",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "a2",
"kind": "aliasName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m",
"kind": "moduleName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "m1",
"kind": "moduleName"
}
],
"documentation": [],
"tags": []
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInternalModuleAlias.ts",
"position": 149
},
"quickInfo": {
"kind": "alias",
"kindModifiers": "export",
"textSpan": {
"start": 149,
"length": 2
},
"displayParts": [
{
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "namespace",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "m2",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "a3",
+ "kind": "aliasName"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
"text": "import",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m2",
"kind": "moduleName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "a3",
"kind": "aliasName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m",
"kind": "moduleName"
}
],
"documentation": [],
"tags": []
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInternalModuleAlias.ts",
"position": 165
},
"quickInfo": {
"kind": "alias",
"kindModifiers": "export",
"textSpan": {
"start": 165,
"length": 2
},
"displayParts": [
{
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "namespace",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "m2",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "a3",
+ "kind": "aliasName"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
"text": "import",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m2",
"kind": "moduleName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "a3",
"kind": "aliasName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m",
"kind": "moduleName"
}
],
"documentation": [],
"tags": []
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInternalModuleAlias.ts",
"position": 194
},
"quickInfo": {
"kind": "alias",
"kindModifiers": "export",
"textSpan": {
"start": 194,
"length": 2
},
"displayParts": [
{
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "namespace",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "m2",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "a4",
+ "kind": "aliasName"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
"text": "import",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m2",
"kind": "moduleName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "a4",
"kind": "aliasName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m",
"kind": "moduleName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "m1",
"kind": "moduleName"
}
],
"documentation": [],
"tags": []
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInternalModuleAlias.ts",
"position": 213
},
"quickInfo": {
"kind": "alias",
"kindModifiers": "export",
"textSpan": {
"start": 213,
"length": 2
},
"displayParts": [
{
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "namespace",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "m2",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "a4",
+ "kind": "aliasName"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
"text": "import",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m2",
"kind": "moduleName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "a4",
"kind": "aliasName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "m",
"kind": "moduleName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "m1",
"kind": "moduleName"
}
],
"documentation": [],
"tags": []
}
}
]
d268886
to
c5dd7e6
Compare
Sorry for the delay! I think it's an improvement, but I could see where it'd go wrong for much more complex types. That said, I don't think that should block the change. |
👍 from me |
c5dd7e6
to
00faeac
Compare
00faeac
to
56fc112
Compare
@jwbay sorry for the delay. can you please refresh the PR, and address the failing CI test? |
merged manually. thanks. |
Fixes #5515
I took the approach here, more or less -- #5515 (comment). We basically print out the root symbol meanings above the import, but with the alias name where it makes sense.
The result:
![image](https://user-images.githubusercontent.com/1320447/32031251-06b7411c-b9ce-11e7-8963-129c52a6d9f5.png)
I tried to follow prior art on how things are displayed. This is the current behavior in master for quickinfo on a resolved signature of an imported alias.
![image](https://user-images.githubusercontent.com/1320447/32031284-30b4a928-b9ce-11e7-9b81-325809b2c715.png)