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

Error trying to delete note with command, delete icon does nothing. #6

Open
dokmanc opened this issue Sep 25, 2023 · 13 comments
Open
Assignees
Labels
bug Something isn't working roadmap

Comments

@dokmanc
Copy link

dokmanc commented Sep 25, 2023

When I execute the command "Line Note Plus: Remove note at the current position (Delete Note)", I get the following error:

[Window Title]
Visual Studio Code

[Main Instruction]
Command 'Line Note Plus: Remove note at current position (Delete Note)' resulted in an error

[Content]
cannot open d:%5CGitHub%5CTest%5CPGP%5CApplicationSettings.cs. Detail: Unable to resolve resource d:%5CGitHub%5CTest%5CPGP%5CApplicationSettings.cs

[OK]

It doesn't seem to matter where on the line I put the cursor, or whether the cursor is on the comment line that is added or the line immediately below that is being documented, the result is the same.

Holding the control key down and clicking the waste bin icon does nothing. I can manually delete the comment line.

@prmichaelsen
Copy link
Owner

Thanks for the bug report. Would you be able to provide your OS? I suspect it may be a problem with Windows.

@dokmanc
Copy link
Author

dokmanc commented Oct 3, 2023

Windows 11 Pro
Version 22H2
Windows Feature Experience Pack 1000.22662.1000.0
Processor 13th Gen Intel(R) Core(TM) i9-13900KF 3.00 GHz
Installed RAM 64.0 GB (63.8 GB usable)
System type 64-bit operating system, x64-based processor

@dokmanc
Copy link
Author

dokmanc commented Oct 3, 2023

I get the same result on my other machine:
Processor Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz 2.21 GHz
Installed RAM 32.0 GB (31.8 GB usable)
System type 64-bit operating system, x64-based processor
Edition Windows 10 Enterprise
Version 22H2
OS build 19045.3448
Experience Windows Feature Experience Pack 1000.19044.1000.0

@prmichaelsen
Copy link
Owner

Thanks again. I'll let you know as soon as I've had a chance to take a look.

@prmichaelsen prmichaelsen added the bug Something isn't working label Oct 4, 2023
@prmichaelsen prmichaelsen self-assigned this Oct 4, 2023
@dokmanc
Copy link
Author

dokmanc commented May 24, 2024

Your welcome

@prmichaelsen
Copy link
Owner

Did some refactoring, will publish an update soon. Hopefully this resolves your issue

@dokmanc
Copy link
Author

dokmanc commented May 28, 2024

Patrick,
I appreciate the follow up. Unfortunately, I am still unable to delete the note when I click on the delete link. I don't know if this is worth pointing out but what I find surprising is that the reported error references the file file being documented by a note, not the note file itself. See error screen shot:

LineNotePlus-2024-05-27-ErrorOnDelete

Please let me know if I can provide further information.
Thanks,
Chad

@prmichaelsen
Copy link
Owner

Sorry, my response wasn't exactly clear, I made some changes but didn't release them yet. I just published v4.0.0 but there's no guarantee it fixes this issue.

I believe it has to do with Windows paths, which unfortunately I don't have a way of testing directly since I don't have a Windows machine.

As far as the error message, when the delete link is clicked, the extension opens the noted document and runs editor commands to delete the line. This is why the error is related to junk1.txt and not the note itself.

    registerCommand("linenoteplus.removeNote", async (uuid?: string) => {
      const _uuid = uuid || Note.matchUuidOnActiveLine(getEditor());
      if (_uuid) {
        // remove specified note (when invoked from the hover text)
        const note = getNoteCache().get(_uuid);
        if (note.line > -1) {
          const uri = vscode.Uri.parse(note.targetPath);
          const document = await vscode.workspace.openTextDocument(uri);
          const line = document.lineAt(note.line);
          const edit = new vscode.WorkspaceEdit();
          edit.delete(uri, line.rangeIncludingLineBreak);
          vscode.workspace.applyEdit(edit);
        }
        await note.remove();
        decorateDebounce();
      }
    }),

If it still doesn't work with the refactored v4.0.0, I can take a deeper dive. Thank you for your investigation.

@dokmanc
Copy link
Author

dokmanc commented May 28, 2024

I tried version 4 and got the error

ERR cannot open d:%5CSaved%5CJunk%5Cjunk1.txt. Detail: Unable to resolve resource d:%5CSaved%5CJunk%5Cjunk1.txt: Error: cannot open d:%5CSaved%5CJunk%5Cjunk1.txt. Detail: Unable to resolve resource d:%5CSaved%5CJunk%5Cjunk1.txt
at r.h (p:\Users\chad\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:153:189812)

I am willing to do a screen share using Live Share or webEx if you want to remotely debug my PC...

@prmichaelsen
Copy link
Owner

No worries, I have an old windows machine I'll boot up and give it a shot with

@dokmanc
Copy link
Author

dokmanc commented Jun 13, 2024

I look forward to a new version. Thanks!

prmichaelsen added a commit that referenced this issue Jun 15, 2024
@prmichaelsen
Copy link
Owner

Thank you for your patience. I wasn't able to test it on my windows machine, but I added some error logging so I can better track down what's happening. Would you mind trying again and then pasting the error from the Output here?

@dokmanc
Copy link
Author

dokmanc commented Jun 15, 2024

Thanks.
Here it is:
console.ts:137 [Extension Host] {"stack":"Error: Timeout\n at Timeout.onTimeout (c:\Users\chad\.vscode\extensions\node_modules\.pnpm\@opentelemetry[email protected]@opentelemetry[email protected]\node_modules\@opentelemetry\sdk-trace-base\src\export\BatchSpanProcessorBase.ts:177:16)\n at listOnTimeout (node:internal/timers:573:17)\n at processTimers (node:internal/timers:514:7)","message":"Timeout","name":"Error"}
C @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1196
fire @ event.ts:1227
fire @ ipc.net.ts:650
U.onmessage @ localProcessExtensionHost.ts:378
4notificationsAlerts.ts:42 [Error_0001]: Note with uuid "unfiled/ih8usgHjLSBfEaq5kLJopd.md" not found in document "d:\GitHub\crud\FilmCrud\Client\Shared\MainLayout.razor".
c @ notificationsAlerts.ts:42
(anonymous) @ notificationsAlerts.ts:28
y @ event.ts:1196
z @ event.ts:1207
fire @ event.ts:1231
addNotification @ notifications.ts:228
notify @ notificationService.ts:253
(anonymous) @ mainThreadMessageService.ts:86
f @ mainThreadMessageService.ts:51
$showMessage @ mainThreadMessageService.ts:45
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1196
fire @ event.ts:1227
fire @ ipc.net.ts:650
U.onmessage @ localProcessExtensionHost.ts:378
console.ts:137 [Extension Host] {"stack":"Error: Timeout\n at Timeout.onTimeout (c:\Users\chad\.vscode\extensions\node_modules\.pnpm\@opentelemetry[email protected]@opentelemetry[email protected]\node_modules\@opentelemetry\sdk-trace-base\src\export\BatchSpanProcessorBase.ts:177:16)\n at listOnTimeout (node:internal/timers:573:17)\n at processTimers (node:internal/timers:514:7)","message":"Timeout","name":"Error"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working roadmap
Projects
None yet
Development

No branches or pull requests

2 participants