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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

mzhongl524
Copy link
Member

Fix: #1817

Make the hover prompts in vs and vscode consistent

@mzhongl524 mzhongl524 added the ide Issues for VS, VSCode, Monaco, etc. label Feb 14, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the compiler:core Issues for @typespec/compiler label Feb 14, 2025
@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 14, 2025

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - fix ✏️

Fix missing documentation on hover in visual studio

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 14, 2025

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs 🛝 VSCode Extension

@RodgeFu RodgeFu changed the title [Not Ready] [typespec-vs] Fix missing doc on hover in vs [typespec-vs] Fix missing doc on hover in vs Feb 14, 2025
Copy link
Member

@timotheeguerin timotheeguerin Feb 14, 2025

Choose a reason for hiding this comment

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

Can you add screenshot for VS in the description comparing the before and after, from the change I don't really understand how that would make it different.

This also makes it worse in VScode and if we have to choose between VSCode experience or Visual Studio, VSCode is way higher priority. This also make it probably worse with any other editor that we could integrate that respect the markdown field correctly.

Before
Screenshot 2025-02-14 at 8 59 19 AM

After (the inline code are not escaped and words are highlighted by some logic)

Screenshot 2025-02-14 at 8 58 38 AM

Copy link
Member Author

Choose a reason for hiding this comment

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

Before
image
After
image

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems VS has a different way to parse the markdown doc. @mzhongl524 , please help to file a ticket to VS team to see whether it's a bug of them or they do have a different expectation of the passed markdown doc. It's better for us to guess here. thanks.

image

Copy link
Member

Choose a reason for hiding this comment

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

Yeah this just feels like a bug with Visual studio, we are now cheating something to make Visual Studio work while VSCode and any other editor that actually respect the markdown(as the contract says) is now worse.

@@ -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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:core Issues for @typespec/compiler ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing documentation on hover in Visual Studio (classic)
4 participants