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

raycast.attachdebugger no find #33

Open
lishoulong opened this issue May 18, 2024 · 17 comments
Open

raycast.attachdebugger no find #33

lishoulong opened this issue May 18, 2024 · 17 comments

Comments

@lishoulong
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

tonka3000 commented May 19, 2024

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
Copy link
Author

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
Copy link
Owner

tonka3000 commented May 19, 2024

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

@lishoulong
Copy link
Author

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
Copy link
Owner

tonka3000 commented May 20, 2024

/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
Copy link
Author

/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
Copy link

mlz11 commented May 20, 2024

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
Copy link
Owner

@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

  • Check if the right commad is trigger which is in dev mode
  • Check if you don't start the store installed command
  • Try to set breakpoints on other lines as well as other files and check again
  • Restart Raycast and try again

@tonka3000
Copy link
Owner

@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
Copy link
Author

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

perat commented May 31, 2024

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
Copy link
Owner

@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
Copy link
Owner

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

@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

@AkaShark
Copy link

Has this problem been fixed by upstream? I am also encountering this issue with Cursor.

2024-11-29T04:40:21.927Z [debug] update state
2024-11-29T04:40:21.938Z [debug] xxxx/package.json raycast enabled: true
2024-11-29T04:40:21.938Z [debug] setContext raycast.workspaceEnabled to true
2024-11-29T04:40:21.938Z [debug] setContent succeeded
2024-11-29T04:40:37.015Z [debug] found Raycast node process: 2975 Raycast Helper (Extensions)
2024-11-29T04:40:37.015Z [debug] 2975
2024-11-29T04:41:07.024Z [debug] found Raycast node process: 2975 Raycast Helper (Extensions)
2024-11-29T04:41:07.025Z [debug] 2975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants