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

[typespec-vs] Fix missing doc on hover in vs #6012

Closed
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b0ac596
Merge pull request #1 from microsoft/main
mzhongl524 Nov 22, 2024
3fcbe52
Merge branch 'microsoft:main' into main
mzhongl524 Nov 25, 2024
c109816
Merge branch 'microsoft:main' into main
mzhongl524 Dec 6, 2024
23f0108
Merge branch 'microsoft:main' into main
mzhongl524 Dec 12, 2024
6f04f65
Merge branch 'microsoft:main' into main
mzhongl524 Dec 23, 2024
688ca03
Merge branch 'microsoft:main' into main
mzhongl524 Dec 24, 2024
de3725e
Merge branch 'microsoft:main' into main
mzhongl524 Dec 30, 2024
8130ffb
Merge branch 'microsoft:main' into main
mzhongl524 Jan 3, 2025
beb6433
Merge branch 'microsoft:main' into main
mzhongl524 Jan 15, 2025
8a501f2
Merge branch 'microsoft:main' into main
mzhongl524 Jan 15, 2025
6e1ab2d
Merge branch 'microsoft:main' into main
mzhongl524 Jan 23, 2025
a35052f
Merge branch 'microsoft:main' into main
mzhongl524 Jan 24, 2025
be57c13
Merge branch 'microsoft:main' into main
mzhongl524 Feb 5, 2025
3a9dc7a
Merge branch 'microsoft:main' into main
mzhongl524 Feb 10, 2025
ad7dff7
Merge branch 'microsoft:main' into main
mzhongl524 Feb 10, 2025
f8e8f2f
Merge branch 'microsoft:main' into main
mzhongl524 Feb 12, 2025
619ccbb
Make the hover prompts in vs and vscode consistent
mzhongl524 Feb 14, 2025
4200f2c
adjust the test
mzhongl524 Feb 14, 2025
0833d0a
Create fix-missing-doc-on-hover-in-vs-2025-1-14-2-56-0.md
mzhongl524 Feb 14, 2025
dd496fe
adjust the test
mzhongl524 Feb 14, 2025
38656bb
Merge branch 'fix-missing-doc-on-hover-in-vs' of https://github.com/m…
mzhongl524 Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adjust the test
  • Loading branch information
mzhongl524 committed Feb 14, 2025
commit dd496feb04a21a34f0e0edd768df3f8bea289264
89 changes: 52 additions & 37 deletions packages/compiler/test/server/completion.test.ts
Original file line number Diff line number Diff line change
@@ -1167,7 +1167,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"```typespec\ndec N.hello(value: string)\n```\n\nJust an example.\n\n_@param_ `value` —\nThe value.\n\n_@example_ —\n```typespec\n@hello\nmodel M {}\n```",
"```typespec\ndec N.hello(value: string)\n```\n\n```\nJust an example.\n```\n\n```\n@param value — The value.\n```\n\n```\n@example —\n```\n```typespec\n@hello\nmodel M {}\n```",
},
},
],
@@ -1358,7 +1358,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.msg: string\n```\n\nmy log message",
value:
"(model property)\n```typespec\nMyLogArg.msg: string\n```\n\n```\nmy log message\n```",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so is the difference that you always put everything in fence? a bit confused on what that makes different.

Would maybe update those expected value to defined this way, it is quite hard to make sense of it right now with everything inline

[
  "...",
  "..."
].join("\n")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The display of getHover in vscode is the same as before, but in vs, getHover can get the same result as vscode, instead of missing some content

},
},
{
@@ -1367,7 +1368,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.id: int16\n```\n\nmy log id",
value:
"(model property)\n```typespec\nMyLogArg.id: int16\n```\n\n```\nmy log id\n```",
},
},
{
@@ -1377,7 +1379,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\nmy log context",
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\n```\nmy log context\n```",
},
},
],
@@ -1405,7 +1407,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\nname of log context",
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\n```\nname of log context\n```",
},
},
{
@@ -1415,7 +1417,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.item: Array<Element>\n```\n\nitems of context",
"(model property)\n```typespec\nMyLogContext<T>.item: Array<Element>\n```\n\n```\nitems of context\n```",
},
},
],
@@ -1736,7 +1738,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.msg: string\n```\n\nmy log message",
value:
"(model property)\n```typespec\nMyLogArg.msg: string\n```\n\n```\nmy log message\n```",
},
},
{
@@ -1745,7 +1748,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.id: int16\n```\n\nmy log id",
value:
"(model property)\n```typespec\nMyLogArg.id: int16\n```\n\n```\nmy log id\n```",
},
},
{
@@ -1755,7 +1759,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\nmy log context",
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\n```\nmy log context\n```",
},
},
],
@@ -1780,7 +1784,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.msg: string\n```\n\nmy log message",
value:
"(model property)\n```typespec\nMyLogArg.msg: string\n```\n\n```\nmy log message\n```",
},
},
{
@@ -1789,7 +1794,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.id: int16\n```\n\nmy log id",
value:
"(model property)\n```typespec\nMyLogArg.id: int16\n```\n\n```\nmy log id\n```",
},
},
{
@@ -1799,7 +1805,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\nmy log context",
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\n```\nmy log context\n```",
},
},
],
@@ -1824,7 +1830,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.msg: string\n```\n\nmy log message",
value:
"(model property)\n```typespec\nMyLogArg.msg: string\n```\n\n```\nmy log message\n```",
},
},
{
@@ -1833,7 +1840,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.id: int16\n```\n\nmy log id",
value:
"(model property)\n```typespec\nMyLogArg.id: int16\n```\n\n```\nmy log id\n```",
},
},
{
@@ -1843,7 +1851,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\nmy log context",
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\n```\nmy log context\n```",
},
},
],
@@ -1932,7 +1940,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.msg: string\n```\n\nmy log message",
value:
"(model property)\n```typespec\nMyLogArg.msg: string\n```\n\n```\nmy log message\n```",
},
},
{
@@ -1941,7 +1950,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.id: int16\n```\n\nmy log id",
value:
"(model property)\n```typespec\nMyLogArg.id: int16\n```\n\n```\nmy log id\n```",
},
},
{
@@ -1951,7 +1961,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\nmy log context",
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\n```\nmy log context\n```",
},
},
{
@@ -1961,7 +1971,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context2: [MyLogContext<string>, int16]\n```\n\nmy log context2",
"(model property)\n```typespec\nMyLogArg.context2: [MyLogContext<string>, int16]\n```\n\n```\nmy log context2\n```",
},
},
],
@@ -1987,7 +1997,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.msg: string\n```\n\nmy log message",
value:
"(model property)\n```typespec\nMyLogArg.msg: string\n```\n\n```\nmy log message\n```",
},
},
{
@@ -1996,7 +2007,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.id: int16\n```\n\nmy log id",
value:
"(model property)\n```typespec\nMyLogArg.id: int16\n```\n\n```\nmy log id\n```",
},
},
{
@@ -2006,7 +2018,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\nmy log context",
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>[]\n```\n\n```\nmy log context\n```",
},
},
{
@@ -2016,7 +2028,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context2: [MyLogContext<string>, int16]\n```\n\nmy log context2",
"(model property)\n```typespec\nMyLogArg.context2: [MyLogContext<string>, int16]\n```\n\n```\nmy log context2\n```",
},
},
],
@@ -2043,7 +2055,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\nname of log context",
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\n```\nname of log context\n```",
},
},
{
@@ -2053,7 +2065,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.item: Array<Element>\n```\n\nitems of context",
"(model property)\n```typespec\nMyLogContext<T>.item: Array<Element>\n```\n\n```\nitems of context\n```",
},
},
],
@@ -2080,7 +2092,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\nname of log context",
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\n```\nname of log context\n```",
},
},
{
@@ -2090,7 +2102,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.item: Array<Element>\n```\n\nitems of context",
"(model property)\n```typespec\nMyLogContext<T>.item: Array<Element>\n```\n\n```\nitems of context\n```",
},
},
],
@@ -2118,7 +2130,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\nname of log context",
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\n```\nname of log context\n```",
},
},
{
@@ -2128,7 +2140,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.item: Array<Element>\n```\n\nitems of context",
"(model property)\n```typespec\nMyLogContext<T>.item: Array<Element>\n```\n\n```\nitems of context\n```",
},
},
],
@@ -2244,7 +2256,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.msg: string\n```\n\nmy log message",
value:
"(model property)\n```typespec\nMyLogArg.msg: string\n```\n\n```\nmy log message\n```",
},
},
{
@@ -2253,7 +2266,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.id: int16\n```\n\nmy log id",
value:
"(model property)\n```typespec\nMyLogArg.id: int16\n```\n\n```\nmy log id\n```",
},
},
{
@@ -2263,7 +2277,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>\n```\n\nmy log context",
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>\n```\n\n```\nmy log context\n```",
},
},
],
@@ -2310,7 +2324,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\nname of log context",
"(model property)\n```typespec\nMyLogContext<T>.name: string\n```\n\n```\nname of log context\n```",
},
},
{
@@ -2320,7 +2334,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.item: Record<Element>\n```\n\nitems of context",
"(model property)\n```typespec\nMyLogContext<T>.item: Record<Element>\n```\n\n```\nitems of context\n```",
},
},
],
@@ -2368,7 +2382,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogContext<T>.item: Record<Element>\n```\n\nitems of context",
"(model property)\n```typespec\nMyLogContext<T>.item: Record<Element>\n```\n\n```\nitems of context\n```",
},
},
],
@@ -2414,7 +2428,8 @@ describe("identifiers", () => {
kind: CompletionItemKind.Field,
documentation: {
kind: MarkupKind.Markdown,
value: "(model property)\n```typespec\nMyLogArg.id: int16\n```\n\nmy log id",
value:
"(model property)\n```typespec\nMyLogArg.id: int16\n```\n\n```\nmy log id\n```",
},
},
{
@@ -2424,7 +2439,7 @@ describe("identifiers", () => {
documentation: {
kind: MarkupKind.Markdown,
value:
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>\n```\n\nmy log context",
"(model property)\n```typespec\nMyLogArg.context: MyLogContext<string>\n```\n\n```\nmy log context\n```",
},
},
],