-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Description
While using the extension I get an error No such label 'onDefinition' for console.timeEnd() appearing every few seconds.
Output:
Warning: Label 'onDefinition' already exists for console.time()
[...]
Finished (node:7660) Warning: No such label 'onDefinition' for console.timeEnd()
stdout: {}
Infos
❯ nu --version
0.80.0
Edition Windows 11 Pro Insider Preview
Version 22H2
OS build 23471.1000
Experience Windows Feature Experience Pack 1000.23471.1000.0
Probable issue
Issue seems to come from this function
vscode-nushell-lang/server/src/server.ts
Lines 113 to 126 in f657b9a
| async function durationLogWrapper<T>( | |
| label: string, | |
| fn: () => Promise<T> | |
| ): Promise<T> { | |
| console.log("Triggered " + label + ": ..."); | |
| console.time(label); | |
| const result = await fn(); | |
| // This purposefully has the same prefix length as the "Triggered " log above, | |
| // also does not add a newline at the end. | |
| process.stdout.write("Finished "); | |
| console.timeEnd(label); | |
| return new Promise<T>((resolve) => resolve(result)); | |
| } |
Indeed,
console.time(label) and console.timeEnd(label) take unique labels, but here the same label is being reused everytime:vscode-nushell-lang/server/src/server.ts
Line 565 in f657b9a
| return await durationLogWrapper(`onDefinition`, async () => { |
hence the warning Warning: Label 'onDefinition' already exists for console.time()
Metadata
Metadata
Assignees
Labels
No labels