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

Plugin doesn't work in debug mode #6

Closed
ZeroXbot opened this issue Mar 28, 2023 · 10 comments
Closed

Plugin doesn't work in debug mode #6

ZeroXbot opened this issue Mar 28, 2023 · 10 comments

Comments

@ZeroXbot
Copy link

I get following error when trying to run template as is.

Activating extension 'undefined_publisher.nrs-language-server' failed:
Cannot find module 'x:\Repos\lsp\dist\extension.js'
Require stack:
- c:\Users\ZX\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\ZX\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\ZX\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js - .

Steps to reproduce:

  • clone repository
  • run pnpm i and cargo build as instruction says
  • run debug
  • open any file in debug vscode and set language to nrs
@IWANABETHATGUY
Copy link
Owner

you need to build the client code first

@IWANABETHATGUY
Copy link
Owner

Could you try running

rm -rf dist && tsc -b -w

@ZeroXbot
Copy link
Author

Thank you for fast response, that did the job. Shame it was not mentioned in readme, for person not versed in JS ecosystem it is misleading.

@IWANABETHATGUY
Copy link
Owner

image
Yeah, I miss that part. But after you press, F5 vs code will automatically do that for you

@IWANABETHATGUY
Copy link
Owner

Yeah, It's my fault that I assume everyone would press F5 on vscode

@IWANABETHATGUY
Copy link
Owner

@ZeroXbot
Copy link
Author

But after you press, F5 vs code will automatically do that for you

It seems it doesn't as I use F5 and without manual tsc invocation it fails as in OP

@IWANABETHATGUY
Copy link
Owner

Added here c5792ed

@samschlegel
Copy link

For context, in my case the issue was due to pnpm not being found when the task is run, likely due to how my zshrc is configured leading to the PATH not being correctly set in the task runner environment?

 *  Executing task: pnpm run watch 

zsh:1: command not found: pnpm

 *  The terminal process "/usr/bin/zsh '-c', 'pnpm run watch'" terminated with exit code: 127. 

I moved it to my .zshenv and it all works now on F5

@tankorsmash
Copy link

tankorsmash commented Oct 26, 2023

Full steps to get this template going is

  • clone repository
  • run pnpm i and cargo build as instruction says
  • open VSCode
  • run debug 'launch client', which opens a new VScode instance
  • in the new vscode instance, open examples/index.rs (or any file)
  • hit Ctrl+Shift+P, 'change language mode'
  • choose 'nrs'

It loses the rust syntax highlighting but I think this is intentional. If you totally replace the contents with the sample from the README, the LSP works though.

You don't get any output in Output nor Debug Console, even after changing the logging to Verbose. But in the Launched Client, if you open the Output panel to nrs language server, you'll see all the logging. May have to enable 'Trace' for the language server first.

"Attach to Server" is commented out in the launch.json and doesn't appear to be needed.


Closest you can get to live reloading is

  • cargo watch -x run
  • going into the original host VSCode and restarting by clicking this green circular arrow at the bottom
image

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

4 participants