jasonwilliams / anki

Anki VSCode Plugin
MIT License
278 stars 32 forks source link

Not work #43

Closed qx closed 3 years ago

qx commented 3 years ago

anki:Version ⁨2.1.38 (355e4cd5)⁩ vscod: 1.54.3 (Universal) anki connect: AnkiConnect 0.01MB. Updated 2021-03-07.

jasonwilliams commented 3 years ago

@qx could you be more specific about what the issue is?

ksrb commented 3 years ago

demo

I can open another issue but I have a feeling that we're running into the same problem.

VS Code: 1.54.3 (system setup) Anki: ⁨2.1.40 (cf446733)⁩ Anki Connect: 0.01MB. Updated 2021-03-07.

jasonwilliams commented 3 years ago

Right I see. I don’t think the explorer will reflect any changes straight away. It only fetches from Anki when you open it up. It’s not “live”.

it sounds like you went a feature request for live updates in the explorer?

ksrb commented 3 years ago

I can see how the GIF above doesn't really show the issue 😕.

demo

Basically nothing is getting uploaded or 'synced'?

I failed to mention this but as you noticed this is on the Windows OS.

I've trying running the Anki: Send To Deck and Anki: Sync Anki with the VS Code inspector open but I didn't see anything of note, is there any other way of getting more information for debugging?

My VS Code does have quite a few setting changes and extensions but I don't think anything would conflict, the Anki stuff I just installed today so everything is set to default there.

jasonwilliams commented 3 years ago

There’s a verbose logging mode in the settings. You can turn that on and check the output.

What version of the extension are you using?

ksrb commented 3 years ago

Extension: v1.2.0 VS Code: 1.54.3 (system setup) Anki: ⁨2.1.40 (cf446733)⁩ Anki Connect: 0.01MB. Updated 2021-03-07

With verbose logging in the inspector and running Anki: Send To Deck or Anki: Sync Anki:

image I'm not sure that warning actually matters though.

Also those are all the extensions I have installed, I disabled all of them in a previous run and nothing changed.

jasonwilliams commented 3 years ago

It won’t appear there, the verbose logging should appear in the output tab on the terminal. It should show requests being made to Anki.

in your settings json you need “anki.log” set to trace

ksrb commented 3 years ago

So I played with it a bit and managed to:

So after trying a bunch of things I couldn't duplicate the issues a 3rd time 😅. I'm inclined to leave it at that for now and just suggest to others who run into a similar issue just to reinstall the extension.

The "anki.log": "trace" didn't show anything of note in the Output log when I was having the issue, it was just showing the commands being executed and didn't log any warnings/errors as far as I could see. Which leads me to suspect that something on Anki or Anki connect's side failed.

Unfortunately, I couldn't duplicate again so hopefully when/if I run into the issue again I'll have a better idea of what's causing it.

jasonwilliams commented 3 years ago

I’ll leave this issue open for now. Feel free to let me know once you can reproduce it

qx commented 3 years ago

@jasonwilliams I work on osx, follow @ksrb 's suggestion,still not work, where can I get log for you

ksrb commented 3 years ago

image

Try the above, maybe you'll have better luck than me at duplicating the issue.

DrRuhe commented 3 years ago

I have the same problem, oddly enough, when sending to an own deck, it creates the deck in Anki, but does not populate it with the cards. (The "notes" deck will also be created, but not populated when running just the default Anki:Send to Deck) Before running anything (Settings are default, except tracing is enabled. I do not have anki sync setup (no account logged in)): image

After running: image

The extension does not give any warning/error.

Anki Info:

Anki 2.1.35 (84dcaa86) Python 3.9.2 Qt 5.15.2 PyQt 5.15.4
Platform: Linux
Flags: frz=False ao=True sv=1
Add-ons, last update check: 2021-04-14 11:05:53

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AnkiConnect ['2055492159', 2021-03-07T06:17, 'None', '']

===IDs of active AnkiWeb add-ons===
2055492159

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

VSCode info:

Version: 1.55.2
Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d
Date: 2021-04-13T09:37:02.931Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Linux x64 4.19.177-1-MANJARO
jasonwilliams commented 3 years ago

Thanks for raising. I will try to improve the tracing output to see if we can find out what’s causing it. There may also have been changes with the Anki Connect API

jasonwilliams commented 3 years ago

@DrRuhe could you show a screenshot of your browse tab in Anki? Just want to know what layouts you have setup and if its installed multiple ones

DrRuhe commented 3 years ago

AFAIK I have no Layouts installed. However I'm new to Anki, so I don't really know what you mean. Anyways, here the screenshot: image

jasonwilliams commented 3 years ago

@DrRuhe yeah, I expected to see BasicWithHighlightVSCode in that list and it’s not there. Looks like it can communicate with your Anki instance but as the card type isn’t there it won’t appear. This usually happens when it didn’t install properly.

can you keep trace on and run “ Anki: Force Re-install” and paste the output back here. Also do another screenshot of your browse window after that.

DrRuhe commented 3 years ago

Here's the output after running the force reinstall. https://pastebin.com/m7TKZH0h

Now BasicWithHighlightVSCode seems to be there. And now it works. image

DrRuhe commented 3 years ago

So if anybody else has the same problem, and BasicWithHighlightVSCode does not show up in your Browse window, try the force reinstall action. From my experience simply reinstalling the extension, and/or restarting anki/vscode did not help, however your mileage may vary.

qx commented 3 years ago

I have the same problem, oddly enough, when sending to an own deck, it creates the deck in Anki, but does not populate it with the cards. (The "notes" deck will also be created, but not populated when running just the default Anki:Send to Deck) Before running anything (Settings are default, except tracing is enabled. I do not have anki sync setup (no account logged in)): image

After running: image

The extension does not give any warning/error.

Anki Info:

Anki 2.1.35 (84dcaa86) Python 3.9.2 Qt 5.15.2 PyQt 5.15.4
Platform: Linux
Flags: frz=False ao=True sv=1
Add-ons, last update check: 2021-04-14 11:05:53

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AnkiConnect ['2055492159', 2021-03-07T06:17, 'None', '']

===IDs of active AnkiWeb add-ons===
2055492159

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

VSCode info:

Version: 1.55.2
Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d
Date: 2021-04-13T09:37:02.931Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Linux x64 4.19.177-1-MANJARO
{
  "label": "Anki for VSCode",
  "level": "trace",
  "message": "{\"action\":\"createDeck\",\"version\":6,\"params\":{\"deck\":\"MAC\"}}",
  "time": "2021-04-15T07:14:22.075Z"
}
{
  "label": "Anki for VSCode",
  "level": "trace",
  "message": "{\"action\":\"addNotes\",\"version\":6,\"params\":{\"notes\":[{\"deckName\":\"MAC\",\"modelName\":\"BasicWithHighlightVSCode\",\"options\":{\"allowDuplicate\":false,\"duplicateScope\":\"deck\"},\"fields\":{\"Front\":\"<h2 id=\\\"whats-the-markdown\\\">What&#39;s the Markdown?</h2>\\n\",\"Back\":\"<p>Markdown is a lightweight markup language with plain-text-formatting syntax.<br>Its design allows it to be converted to many output formats,<br>but the original tool by the same name only supports HTML.</p>\\n\"},\"tags\":[]},{\"deckName\":\"MAC\",\"modelName\":\"BasicWithHighlightVSCode\",\"options\":{\"allowDuplicate\":false,\"duplicateScope\":\"deck\"},\"fields\":{\"Front\":\"<h2 id=\\\"who-created-markdown\\\">Who created Markdown?</h2>\\n\",\"Back\":\"<p>John Gruber created the Markdown language in 2004 in collaboration with<br>Aaron Swartz on the syntax.</p>\\n\"},\"tags\":[]}]}}",
  "time": "2021-04-15T07:14:22.089Z"
}
{
  "label": "Anki for VSCode",
  "level": "info",
  "message": "active Editor..",
  "time": "2021-04-15T07:14:28.465Z"
}
{
  "label": "Anki for VSCode",
  "level": "trace",
  "message": "{\"action\":\"createDeck\",\"version\":6,\"params\":{\"deck\":\"notes\"}}",
  "time": "2021-04-15T07:14:28.466Z"
}
{
  "label": "Anki for VSCode",
  "level": "trace",
  "message": "{\"action\":\"addNotes\",\"version\":6,\"params\":{\"notes\":[{\"deckName\":\"notes\",\"modelName\":\"BasicWithHighlightVSCode\",\"options\":{\"allowDuplicate\":false,\"duplicateScope\":\"deck\"},\"fields\":{\"Front\":\"<h2 id=\\\"whats-the-markdown\\\">What&#39;s the Markdown?</h2>\\n\",\"Back\":\"<p>Markdown is a lightweight markup language with plain-text-formatting syntax.<br>Its design allows it to be converted to many output formats,<br>but the original tool by the same name only supports HTML.</p>\\n\"},\"tags\":[\"MAC\"]},{\"deckName\":\"notes\",\"modelName\":\"BasicWithHighlightVSCode\",\"options\":{\"allowDuplicate\":false,\"duplicateScope\":\"deck\"},\"fields\":{\"Front\":\"<h2 id=\\\"who-created-markdown\\\">Who created Markdown?</h2>\\n\",\"Back\":\"<p>John Gruber created the Markdown language in 2004 in collaboration with<br>Aaron Swartz on the syntax.</p>\\n\"},\"tags\":[\"MAC\"]}]}}",
  "time": "2021-04-15T07:14:28.489Z"
}

The same with you

qx commented 3 years ago

It works after reinstall command 截屏2021-04-15 下午3 28 20