sapegin / vscode-just-blame

VS Code extension to show Git Blame annotations, inspired by JetBrains editors 🪲
https://marketplace.visualstudio.com/items?itemName=sapegin.just-blame
MIT License
5 stars 0 forks source link

Blame panel not visible #2

Open moltob opened 3 days ago

moltob commented 3 days ago

Thank you for writing this extensions. It looks like exactly what I was looking for.

For some reason, I am not able to see the blame panel/sidebar/annotations. Relaunching/restarting VSCode did not help. No other git-related extension is active/installed.

Am I missing the obvious?

In the main editor a source file is open and I trigger the "toggle git blame annotations" command from the command panel. Noting happens in terms of editor/views. The "just blame" output window shows this (some internal names replaced with "xxx"):

🪲 Just Blame starting...
Create new blame instance for /home/xxx/work/xxx/zephyr/src/zephyr/services/entra_id/entitlement_update.py
Config:  {"colorScale":{"light":["#a4bed0","#aec5d5","#b8ccdb","#c2d4e0","#cddbe5","#d7e2ea","#e1e9ef","#ebf1f5","#f5f8fa","#fcfdfd"],"dark":["#65469b","#5e4190","#573c86","#50377b","#493371","#422e66","#3d2b5f","#362654","#2f214a","#291c3f"]},"locale":"en-GB"}
Workspace root: /home/xxx/work/xxx/zephyr
Relative path: src/zephyr/services/entra_id/entitlement_update.py
Running git blame: git --no-pager blame --porcelain "src/zephyr/services/entra_id/entitlement_update.py"
GitHub URL git@xxx-github.xxx.net:xxx/zephyr.git

In case it matters: This is VSCode running in Windows 10 connected to the local WSL instance, where the code/git lives.

Thanks!

sapegin commented 3 days ago

My only guess is that there's a runtime exception somewhere. Can you try to open Help → Toggle Developer Tools and see if there are any errors in the console?

moltob commented 3 days ago

You're right:

image

sapegin commented 3 days ago

This is very confusing, DateTimeFormat says that the +200 is an incorrect timezone, but I have the same timezone, and it works fine for me...

My guess is that maybe Electron on Windows doesn't support it? I'm on a Mac.

Can you try these two snippets in Code's DevTools console?

new Intl.DateTimeFormat('en', {dateStyle: 'long', timeStyle: 'long', timeZone: '+0200'}).format(new Date())
new Intl.DateTimeFormat('en', {dateStyle: 'long', timeStyle: 'long', timeZone: 'Europe/Berlin'}).format(new Date())

On my machine both work the same way in all browsers I have (Chromium, Firefox, Safari, and Code).

moltob commented 3 days ago

No issue in the console, it seems:

> new Intl.DateTimeFormat('en', {dateStyle: 'long', timeStyle: 'long', timeZone: '+0200'}).format(new Date())
'September 16, 2024 at 12:25:10 PM GMT+2'

> new Intl.DateTimeFormat('en', {dateStyle: 'long', timeStyle: 'long', timeZone: 'Europe/Berlin'}).format(new Date())
'September 16, 2024 at 12:25:20 PM GMT+2'
moltob commented 3 days ago

You want me to put some debug statements anywhere?

sapegin commented 3 days ago

Not sure what to log exactly; we can wrap the whole thing in try/catch so it won't crash the whole thing at least...

sapegin commented 3 days ago

I published a new version (2.0.5) with try/catch and additional logs, so it shouldn't crash at least. I'm still not sure how to debug/fix the actual issue.

moltob commented 3 days ago

It does show annotations now. The vscode output shows this:

Error formatting date: Invalid time zone specified: +0200
Timestamp: "2022-09-16T12:08:16.000Z"
Time zone: +0200
moltob commented 3 days ago

I looked at your code and for me using the replacement TZ/format is just fine. Feel free to close the issue, whenever you like, unless you want to debug anything that comes to your mind. I am happy trying out anything you suggest.

Or just close. 😄

Thanks again for your effort and instantaneous support.