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

Typescript Documentation renders differently in hover vs. ctrl-space #738

Open
JustinGrote opened this issue Oct 21, 2022 · 1 comment
Open

Comments

@JustinGrote
Copy link

JustinGrote commented Oct 21, 2022

Moved from: microsoft/vscode#163085

  • VS Code Version: 1.73.0-insider
  • OS Version: Windows 11 22H2

Steps to Reproduce:

  1. Typescript with doc definition
  2. Ctrl-space in default Typescript works fine, hover and ctrl-space look same for JSDoc
  3. Enable Deno
  4. Ctrl-space now doesn't render properly.
/**
 * The entrypoint to your module-based Cloudflare Worker. This should be your **export default**.
 *
 * @see https://blog.cloudflare.com/workers-javascript-modules/
 * @tutorial https://developers.cloudflare.com/workers/get-started/guide/#5-write-code
 * @example
 * <caption>### Hello World</caption>
 *
 * ```
 * const worker: CFWorker = {
 *  fetch(_request) {
 * 	 return new Response("Hello World!");
 *  }
 * }
 * export default worker
 * // returns "Hello World!"
 * ```
 *
 *
 * @example
 * <caption>### Reply with the name provided by the name query parameter. This is an example of separating the work from the handler</caption>
 *
 *
 * // Define how the fetch should be handled
 * function respondWithName(request: Request) {
 *	  const url = new URL(request.url);
 *	  const name = url.searchParams.get("name");
 *   const response = `Hello ${name}!`;
 *   return new Response(response);
 * }
 *
 * const worker: CFWorker = {
 *	  //Bind the fetch handler to the worker
 *   fetch: respondWithName,
 * };
 *
 * export default worker;
 *
 * //Returns "Hello Friend!" for http://myworker?name=Friend
 */
interface CFWorker<Env = unknown> {
	/**
	 * The function that will be called when a request is made to your Worker.
	 */
	fetch?: CFWorkerFetchHandler<Env>;
	/**
	 * The function that will be called when a scheduled event is triggered.
	 */
	scheduled?: CFWorkerScheduledHandler<Env>;
}

Render when hovering the type is as expected:
image

Render when using ctrl-space is incorrect:
image

Set deno.enable to false and it looks normal again
image

@Adegbenga5005
Copy link

thanks

@bartlomieju bartlomieju added the dx label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants