quarto-dev / quarto-vscode

Quarto extension for VS Code
https://marketplace.visualstudio.com/items?itemName=quarto.quarto
MIT License
112 stars 11 forks source link

commands not found #85

Closed pawelru closed 2 years ago

pawelru commented 2 years ago

When trying to render a document I have got an error that command is not found. Actually none of the quarto commands works.

image

and when doing cmd+shift+k image

I am using:

Please let me know if you need something more from my side.

In Rstudio I have everything working so it's VSCode related

jjallaire commented 2 years ago

This would occur if we can't locate Quarto on your system. This might be because Quarto isn't on the PATH or it might be because RStudio is installed i a location we don't expect. If it's not on your PATH then we look in the following locations:

Do you know where Quarto is installed? If not, try executing which quarto from the terminal within RStudio.

pawelru commented 2 years ago

Please find it attached

❯ which quarto
/usr/local/bin/quarto

❯ quarto --version
1.1.251

❯ echo $PATH
/usr/local/opt/openssl@3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/quarto/bin:/Users/ruckip/opt/miniconda3/bin:/Users/ruckip/opt/miniconda3/condabin:/usr/local/opt/openssl@3/bin
jjallaire commented 2 years ago

Quarto definitely should be found in this configuration! Although I'll be honest and say that I don't know what else to do here as we explicitly looking in /Applications/quarto/bin and that's where it appears to be on your system.

What is the result if you execute which quarto in the VS Code terminal?

pawelru commented 2 years ago

I have the same output from shell terminal, bash terminal, RStudio terminal as well as VSCode terminal.

I have restarted VSCode and now when I do cmd+shift+k then there is an "Activating Extensions..." loader on the bottom-left bar for few seconds and then nothing. For the rest of commands I still got the same: image

image

jjallaire commented 2 years ago

I'm not sure what's going on then. It seems as Quarto isn't found (meaning either the executable isn't there or it isn't callable/invoke-able).

What is the file extension of the document you are working with?

pawelru commented 2 years ago

This is .qmd file that is being correctly identified as a "Quarto" by VSCode image

As I have everything working in RStudio, it seems that everything is ok with quarto-cli itself. For me the connection between vscode-extension to quarto is somehow broken and I don't know how to check / debug this stuff.

I tried to check my keybord shortcuts: image image

This all is a default config and I am not seeing anything suspicious in there.

None of quarto specific commands work for me including even creating a new document which should be quarto-cli independent. When I do cmd+shift+p (View-Command Palette) and then type "quarto.newdocument": image

How to check what's defined under "quarto.newdocument". Where is global registry of commands so that I can check if it is not missing?

jjallaire commented 2 years ago

If you just type quarto.newDocument in the keybindings view you'll likely see it.

I have no idea what might be amiss here. The commands seem to have been "registered" as per the keybindings UI

pawelru commented 2 years ago

So the output is the same as in case of render one. The commend is registered but is not executable.

Looked on SO and I have basically the same issue as described here: https://stackoverflow.com/questions/49534068/command-not-found-in-vscode-extension

However, the top-voted answer is not a root-cause here. I haven't dig any further.

Just curious. I was doing installing everything quarto related today - including this extension. Am I the only one who reports it? Can you please try on your own with the released version and check if you have the same?

jjallaire commented 2 years ago

You are indeed the only one reporting this right now :-(

I reset my system to have all the same versions as you report and things work fine.

I sincerely wish I could do more but it's something peculiar to your environment going on here (as all the paths/versions/etc. seem to line up correctly).

Bonnevie commented 2 years ago

Just to corroborate, I also have this issue, and it is very recent - I was using quarto + VS code's interactive window just yesterday, but now I'm experiencing quarto.runCurrentCell not found, and the same for all other quarto commands. Seems I just fixed it while typing this comment though: I am on Ubuntu and previously used the apt package manager to install Quarto which got me version 0.9.598, and now I just manually updated to 1.1.251 and it appears to work again! It was not sufficient to reinstall the extension alone. But since this is the version @pawelru is on, and he already tried a reinstall I guess it might not help him.

j-winters commented 2 years ago

I duplicated the same issue on my Mac. The issue seems to begin with the Quarto extensions of v1.36.0 and later. When I installed v1.35.0 extension, I was able to render again.

jjallaire commented 2 years ago

Thanks, that stands to be quite helpful! I just did a diff between v1.35.0 and v1.36.0 and didn't see anything that stood out as potentially causing this issue. It would be helpful to know:

(1) Exactly what behavior you are seeing (it is "command not found" or just render appearing not to work)

(2) What version of VS Code you are running

(3) What version of Quarto you see for quarto --version

pawelru commented 2 years ago

I duplicated the same issue on my Mac. The issue seems to begin with the Quarto extensions of v1.36.0 and later. When I installed v1.35.0 extension, I was able to render again.

I do confirm the above. Reverting back to v1.35.0 makes everything work and from v1.36.0 it is not working anymore. I haven't changed quarto version itself so it's still 1.1.251

jjallaire commented 2 years ago

Hi there, could you also let me know what version of VS Code you are running? Also, could you try invoking Help -> Toggle Developer Tools and then re-try the Quarto commands? (perhaps you will see some JavaScript errors that are occurring).

jjallaire commented 2 years ago

My best guess at this point is that JavaScript exception is occurring sometime during the middle of Quarto extension initialization which prevents those commands from being registered. Hopefully the Help => Toggle Developer Tools will give us a clue!

jjallaire commented 2 years ago

Just to keep an easily accessible record of it, here are the diffs from 1.35 to 1.36: https://github.com/quarto-dev/quarto-vscode/compare/5e14c88d8fbe428d89710ca0fedf23a4e1df4c82...9fc7c5ab041c281e236d5c56acb2854edcce8d0e

pawelru commented 2 years ago

VSCode version

Version: 1.66.2 (Universal)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:49:20.994Z (6 mos ago)
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Darwin x64 21.6.0

I updated to the newest quarto extension and in the developer tools, before any quarto commands I see the following:

Activating extension 'quarto.quarto' failed: Extension 'quarto.quarto' CANNOT use API proposal: notebookDocumentEvents.
Its package.json#enabledApiProposals-property declares: [] but NOT notebookDocumentEvents.
 The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api quarto.quarto.

How should I understand the above?

(I don't have any other records in the console after running other quarto commands.)

This is missing in v1.35.

jjallaire commented 2 years ago

Okay, we've figured out the problem! You are running version 1.66.2 (which in theory we are compatible with). You can see in this code that we are subscribing to an event that only exists in 1.67:

https://github.com/quarto-dev/quarto-vscode/compare/5e14c88d8fbe428d89710ca0fedf23a4e1df4c82...9fc7c5ab041c281e236d5c56acb2854edcce8d0e#diff-9317a765a7e36179d3a6f2d841bbf7ceaa7449a5beafb1a4812dce59f08fb10dR111-R121

The problem is that that event actually appears to be present in v1.66 but it throws an exception when accessed (which prevents us from further initializing).

I realize that you could mitigate this by just updating VS Code, but If you don't mind I'd love to try to resolve this and publish a new version of the extension to try w/ 1.66. Give me an hour or two and I should be able to get that published so you can test.

jjallaire commented 2 years ago

Okay, this commit should fix the problem: https://github.com/quarto-dev/quarto-vscode/commit/646c464afa94cbc229258f91b8d565c29f689763

This is available now in an updated release (v1.46.0).

Thanks again for your help in diagnosing the problem!

pawelru commented 2 years ago

🎉 all working in v1.46 Thank you!

ChuliangXiao commented 2 years ago

Okay, this commit should fix the problem: 646c464

This is available now in an updated release (v1.46.0).

Thanks again for your help in diagnosing the problem!

I'm having very similar issues as @pawelru did:

  1. Non Run Cell bottom above the code chunk
  2. Top right Render bottom not responding
  3. cmmand + shift + k returning command 'quarto.renderShortcut' not found using:
    macOS Monterey 12.2.1
    Quarto 1.1.251
    Quarto-vscode v1.50.0
    VSCode: 1.72.2

    image

jjallaire commented 2 years ago

Try executing Help => Toggle Developer Tools and see if there are any JavaScript errors which are occurring when the Quarto extension is loaded. You might need to also execute the Developer => Reload Window command to cause the extension to re-initialize.

ChuliangXiao commented 2 years ago

Try executing Help => Toggle Developer Tools and see if there are any JavaScript errors which are occurring when the Quarto extension is loaded. You might need to also execute the Developer => Reload Window command to cause the extension to re-initialize.

It's my mistake. I created quarto/ folder and put example-py.qmd into it. After renaming it to quarto-ex/, all those three issues are gone. Thank you for your prompt response, JJ.