Skip to content

Commit

Permalink
Fix biome formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pkukielka committed Nov 6, 2024
1 parent 23d0dd9 commit 5fd9fd2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion agent/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export class Agent extends MessageHandler implements ExtensionClient {
this.notify('debug/message', {
channel: 'Document Sync Check',
message: panicMessage + '\n' + message,
level: 'error'
level: 'error',
})
},
edit: (uri, callback, options) => {
Expand Down
39 changes: 28 additions & 11 deletions agent/src/vscode-shim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { AgentTabGroups } from './AgentTabGroups'
import { AgentWorkspaceConfiguration } from './AgentWorkspaceConfiguration'
import type { Agent } from './agent'
import { matchesGlobPatterns } from './cli/command-bench/matchesGlobPatterns'
import {ClientInfo, DebugMessageLogLevel, ExtensionConfiguration} from './protocol-alias'
import type { ClientInfo, DebugMessageLogLevel, ExtensionConfiguration } from './protocol-alias'

// Not using CODY_TESTING because it changes the URL endpoint we send requests
// to and we want to send requests to sourcegraph.com because we record the HTTP
Expand Down Expand Up @@ -532,25 +532,42 @@ export namespace UriString {
function outputChannel(name: string): vscode.LogOutputChannel {
function notifyAgent(level: DebugMessageLogLevel, message: string, ...args: any[]): void {
if (agent) {
const formattedMessage = args.length ? String(message).replace(/{(\d+)}/g, (match, num) => args[num]?.toString() ?? match) : message
const formattedMessage = args.length
? String(message).replace(/{(\d+)}/g, (match, num) => args[num]?.toString() ?? match)
: message
agent.notify('debug/message', { channel: name, message: formattedMessage, level })

}
}
return {
name,
append: message => { notifyAgent('info', message) },
appendLine: message => { notifyAgent('trace', message) },
replace: message => { notifyAgent('trace', message) },
append: message => {
notifyAgent('info', message)
},
appendLine: message => {
notifyAgent('trace', message)
},
replace: message => {
notifyAgent('trace', message)
},
clear: () => {},
show: () => {},
hide: () => {},
dispose: () => {},
trace: (message: string, ...args: any[]) => { notifyAgent('trace', message, args) },
debug: (message: string, ...args: any[]) => { notifyAgent('debug', message, args) },
info: (message: string, ...args: any[]) => { notifyAgent('info', message, args) },
warn: (message: string, ...args: any[]) => { notifyAgent('warn', message, args) },
error: (message: string, ...args: any[]) => { notifyAgent('error', message, args) },
trace: (message: string, ...args: any[]) => {
notifyAgent('trace', message, args)
},
debug: (message: string, ...args: any[]) => {
notifyAgent('debug', message, args)
},
info: (message: string, ...args: any[]) => {
notifyAgent('info', message, args)
},
warn: (message: string, ...args: any[]) => {
notifyAgent('warn', message, args)
},
error: (message: string, ...args: any[]) => {
notifyAgent('error', message, args)
},
logLevel: LogLevel.Trace,
onDidChangeLogLevel: emptyEvent(),
}
Expand Down

0 comments on commit 5fd9fd2

Please sign in to comment.