tonka3000 / vscode-raycast

Raycast tools for VSCode
https://marketplace.visualstudio.com/items?itemName=tonka3000.raycast
MIT License
15 stars 2 forks source link

raycast.attachdebugger no find #33

Open lishoulong opened 1 month ago

lishoulong commented 1 month ago

Summary

{ "command": "raycast.attachdebugger", "when": "raycast.workspaceEnabled" }, 安装的插件,在指令面板中搜索不到 raycast.attachdebugger,猜测是不满足 raycast.workspaceEnabled 条件,如何才能满足呢

Steps to reproduce

开发的是 raycast extension 应用

  1. 安装好 vscode 插件
  2. 重启 vacode
  3. cd 到对应插件目录下
  4. 命令行执行 npx ray develop 启动了服务
  5. command + shift + p,指令面板搜索不到 raycast.attachdebugger

    image

What is the current bug behavior?

指令面板搜索不到 raycast.attachdebugger

What is the expected correct behavior?

指令面板可以搜索到 raycast.attachdebugger,可以 debugger 调试代码

Relevant logs and/or screenshots

Possible fixes

猜测是不满足 raycast.workspaceEnabled 条件,如何才能满足呢

tonka3000 commented 1 month ago

Try the commad: Raycast: Update State of Extension.

In general you need a package.json with @raycast/API as dependeny. Is this the case for your project?

lishoulong commented 1 month ago

Try the commad: Raycast: Update State of Extension.

In general you need a package.json with @raycast/API as dependeny. Is this the case for your project?

I try this command "Raycast: Update State of Extension", but in no use. In fact, I just develop this official project "raycast/extensions", my package.json has @raycast/API as dependeny

tonka3000 commented 1 month ago

Interesting. Please paste the your log file here (check for sensitive data first before uploading).

You can active the logger by adding "raycast.loglevel": "debug" to your settings.json file.

Trigger the mentioned Update State commad afterwards.

lishoulong commented 1 month ago

Interesting. Please paste the your log file here (check for sensitive data first before uploading).

You can active the logger by adding "raycast.loglevel": "debug" to your settings.json file.

Trigger the mentioned Update State commad afterwards.

get, please help where can I find my log file?

tonka3000 commented 1 month ago

In the output panel (somewhere next to the terminal). Choose Raycast I the drop-down in the output panel.

lishoulong commented 1 month ago

I the output panel (somewhere next to the terminal). Choose Raycast I the drop-down in the output panel.

HI,the following is my log。 2024-05-19T22:44:14.479Z [debug] update state 2024-05-19T22:44:14.480Z [debug] /Users/raycast_extensions/package.json raycast enabled: false 2024-05-19T22:44:14.480Z [debug] setContext raycast.workspaceEnabled to false 2024-05-19T22:44:14.481Z [debug] setContent succeeded

tonka3000 commented 1 month ago

/Users/raycast_extensions/package.json is this the path to your package.json? Did you removed the username after /Users?

Which directory did you open from the extensions repo? You should open the project directly inside the extensions folder in the clone repo. Is this the case?

lishoulong commented 1 month ago

/Users/raycast_extensions/package.json is this the path to your package.json? Did you removed the username after /Users?

Which directory did you open from the extensions repo? You should open the project directly inside the extensions folder in the clone repo. Is this the case?

Sorry for late response, my package.json path is "~/Documents/xxx/lib/raycast_extensions/extensions/notion/package.json"

mlz11 commented 1 month ago

Hey @tonka3000 👋🏻

Thanks for your help. I followed your advice and here is the output of the Update State command + Attach Debugger command :

2024-05-20T16:07:40.206Z [debug] update state
2024-05-20T16:07:40.208Z [debug] /Users/zraqs/oss/raycast/yafw/extensions/yafw/package.json raycast enabled: true
2024-05-20T16:07:40.208Z [debug] setContext raycast.workspaceEnabled to true
2024-05-20T16:07:40.210Z [debug] setContent succeeded
2024-05-20T16:07:46.447Z [debug] found Raycast node process: 30625 Raycast Helper (Extensions)      
2024-05-20T16:07:46.447Z [debug] 30625

Everything seems okay but my breakpoints are still skipped. Any idea ?

tonka3000 commented 1 month ago

@mlz11 interesting. Looks correct to me as well. I just automatically start the node debugger from node so I don't do something special beside getting the right process id dynamicly.

Maybe that is an issue from the node debugger of VSCode.

Possible things to check

tonka3000 commented 1 month ago

@lishoulong Hm, can you share the content of your package.json? It seems that it does not detect Rayvast your project.

Also make sure to open the folder directly in VSCode which contains the mentioned package.json.

lishoulong commented 1 month ago

@lishoulong Hm, can you share the content of your package.json? It seems that it does not detect Rayvast your project.

Also make sure to open the folder directly in VSCode which contains the mentioned package.json.

@tonka3000 Thanks for your replay. After open the inner package.json level foler, I can find the attach debugger command in the command platte. But it can not stop at break point line, the follow is log.

2024-05-21T00:21:35.287Z [debug] /Users/xx/Documents/xx/lib/raycast_extensions/extensions/notion/package.json raycast enabled: true 2024-05-21T00:21:35.287Z [debug] setContext raycast.workspaceEnabled to true 2024-05-21T00:21:35.288Z [debug] setContent succeeded 2024-05-21T00:21:35.289Z [debug] setContext raycast.extensionLoaded to true 2024-05-21T00:21:35.289Z [debug] setContent succeeded 2024-05-21T00:21:37.654Z [debug] Got version 1.74.0 from npm for @raycast/migration 2024-05-21T00:21:37.654Z [debug] set latest npm raycast migration version to 1.74.0 2024-05-21T00:21:37.654Z [debug] refresh treedataprovider 2024-05-21T00:22:13.046Z [debug] found Raycast node process: 74780 Raycast Helper (Extensions)
2024-05-21T00:22:13.046Z [debug] 74780 2024-05-21T00:23:05.825Z [debug] found Raycast node process: 31780 Raycast Helper (Extensions)
2024-05-21T00:23:05.825Z [debug] 31780

perat commented 1 month ago

For me it is the same. So as a workaround I've opened extension folder ($HOME/github.com/raycast/extensions/extensions/github-for-enterprise) in VSCode instead of a root project ($HOME/github.com/raycast/extensions)

tonka3000 commented 1 month ago

@perat This is the way it is build 😁. You should not open the raycast/extensions im VSCode, you should always open raycast/extensions/. The extension is the repo are independent of each other.

tonka3000 commented 1 month ago

@lishoulong good to hear. It seems that the node debugger from VSCode itself is broken currently. Need to wait some weeks to check if it got fix upstream. The log show the my extension works as expected 🥳.

lucasmezencio commented 1 month ago

@tonka3000 same thing for me. Everything seems to be working, but I can't attach the debugger:

2024-06-16T16:32:10.768Z [debug] update state
2024-06-16T16:32:10.778Z [debug] /Users/xxx/projects/xxx/raycast-extensions/extensions/system-monitor/package.json raycast enabled: true
2024-06-16T16:32:10.778Z [debug] setContext raycast.workspaceEnabled to true
2024-06-16T16:32:10.779Z [debug] setContent succeeded
2024-06-16T16:32:36.026Z [debug] found Raycast node process: 54125 Raycast Helper (Extensions)      
2024-06-16T16:32:36.027Z [debug] 54125