vscode_deno icon indicating copy to clipboard operation
vscode_deno copied to clipboard

Typescript Documentation renders differently in hover vs. ctrl-space

Open JustinGrote opened this issue 1 year ago • 1 comments

Moved from: https://github.com/microsoft/vscode/issues/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

JustinGrote avatar Oct 21 '22 01:10 JustinGrote