vscode_deno icon indicating copy to clipboard operation
vscode_deno copied to clipboard

Task Panel Doesn't Show Any Tasks

Open PytatoDuck opened this issue 1 year ago • 3 comments

Describe the bug

I just made a fresh Fresh Deno project, and in the task panel I don't see any task. But with the CLI, I can see and run them. In #991 I see it been solved, but I got the same problem. Also, on Linux it works so a Windows problem.

I'm on deno 2.1.2 (release, x86_64-pc-windows-msvc) | vscode_deno 3.42.0 | vscode 1.95.3.

To Reproduce

  1. Open a Deno Project.
  2. Go to the task panel.

Expected behavior See task in the Task Panel.

Details

In the CLI, it works all good. Screenshot 2024-12-02 201902

But the Task panel is empty. Screenshot 2024-12-02 202029

If I run Deno: Run Task from the command panel, I get this Screenshot 2024-12-02 202256 Screenshot 2024-12-02 202225

Which I thought it might mean I don't have a Deno project open, but I do Screenshot 2024-12-02 204207


And here is the deno.json file, as fresh as it can get.

{
  "lock": false,
  "tasks": {
    "check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
    "cli": "echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
    "manifest": "deno task cli manifest $(pwd)",
    "start": "deno run -A --watch=static/,routes/ dev.ts",
    "build": "deno run -A dev.ts build",
    "preview": "deno run -A main.ts",
    "update": "deno run -A -r https://fresh.deno.dev/update ."
  },
  "lint": {
    "rules": {
      "tags": [
        "fresh",
        "recommended"
      ]
    }
  },
  "exclude": [
    "**/_fresh/*"
  ],
  "imports": {
    "$fresh/": "https://deno.land/x/[email protected]/",
    "preact": "https://esm.sh/[email protected]",
    "preact/": "https://esm.sh/[email protected]/",
    "@preact/signals": "https://esm.sh/*@preact/[email protected]",
    "@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
    "$std/": "https://deno.land/[email protected]/"
  },
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "preact"
  }
}

PytatoDuck avatar Dec 02 '24 15:12 PytatoDuck

Can you share your deno.xxx settings?

FYI the Deno: Run Task command is for running the task your cursor is on in the deno.json, that's behaving as expected.

nayeemrmn avatar Dec 03 '24 03:12 nayeemrmn

Where would I find the deno.xxx settings (I thought that was the deno.json file)

Here is the .vscode\settings.json

{
  "deno.enable": true,
  "deno.lint": true,
  "editor.defaultFormatter": "denoland.vscode-deno",
  "[typescriptreact]": {
    "editor.defaultFormatter": "denoland.vscode-deno"
  },
  "[typescript]": {
    "editor.defaultFormatter": "denoland.vscode-deno"
  },
  "[javascriptreact]": {
    "editor.defaultFormatter": "denoland.vscode-deno"
  },
  "[javascript]": {
    "editor.defaultFormatter": "denoland.vscode-deno"
  }
}

And .vscode\extensions.json

{
  "recommendations": [
    "denoland.vscode-deno"
  ]
}

PytatoDuck avatar Dec 03 '24 13:12 PytatoDuck

I also don't see any tasks in the "deno tasks" panel. Below is my deno.json that i'm still trying to setup for my current workspace...

{
	"tasks": {
		"serve-src": {
			"command": "dsbuild --serve-only --port=3000 --serve-dir=src"
		},
		"test": "deno test --allow-net",
		"lint": "deno lint"
	},
	"compilerOptions": {
		"lib": [
			"dom",
			"dom.iterable",
			"dom.asynciterable",
			"esnext",
			"deno.ns"
		]
	},
	"imports": {
	}
}

Image

TriMoon avatar Feb 02 '25 19:02 TriMoon

Seems that vscode encode non-ascii paths to uri and deno plugin fails to handle these uris.

Reproduce: open vscode under a path including non-ascii characters (e.g. CJK characters) and active deno plugin.

mashizora avatar Mar 19 '25 09:03 mashizora

In #996, the workspace folder URI is converted to a string without encoding before being compared to configTask.sourceUri. Since configTask.sourceUri is a percent-encoded URI in LSP's code, #996 may introduce a new bug when the workspace path contains non-ASCII characters.

ref: https://github.com/denoland/deno/blob/aa1f43702dc79021fe1dfa99e44733aa345a7dce/cli/lsp/language_server.rs#L4364-L4392 https://github.com/denoland/deno/blob/aa1f43702dc79021fe1dfa99e44733aa345a7dce/cli/lsp/urls.rs#L149-L174

mashizora avatar Mar 29 '25 09:03 mashizora

Encoding discrepancies between URIs VSCode and Deno LSP have been fixed. Closing for now, but comment here if it's still an issue.

nayeemrmn avatar May 01 '25 00:05 nayeemrmn

I'm on Win11 using this extension with latest 3.44.0 version and Deno Tasks still empty for me. Don't see any errors or anything suspicious in Output with internal debug enabled

qustrolabe avatar May 02 '25 13:05 qustrolabe