Skip to content

Commit

Permalink
fixing key map issues with Jetbrains Rider IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
arafatkatze committed Jan 30, 2025
1 parent 7b495f4 commit 7da14ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions vscode/webviews/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
getAuthErrorMessage,
} from '@sourcegraph/cody-shared'
import type { AuthMethod } from '../src/chat/protocol'
import { version } from '../src/version'
import styles from './App.module.css'
import { AuthPage } from './AuthPage'
import { LoadingPage } from './LoadingPage'
Expand Down Expand Up @@ -163,8 +164,8 @@ export const App: React.FunctionComponent<{ vscodeAPI: VSCodeWrapper }> = ({ vsc
webviewTelemetryService.configure({
isTracingEnabled: true,
debugVerbose: true,
agentIDE: config.clientCapabilities.agentIDE,
extensionAgentVersion: config.clientCapabilities.agentExtensionVersion,
clientPlatform: config.clientCapabilities.agentIDE,
agentVersion: version,
})
}
}, [config, webviewTelemetryService])
Expand Down
22 changes: 11 additions & 11 deletions vscode/webviews/utils/webviewOpenTelemetryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api'
import { Resource } from '@opentelemetry/resources'
import { BatchSpanProcessor, WebTracerProvider } from '@opentelemetry/sdk-trace-web'
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'
import type { CodyIDE } from '@sourcegraph/cody-shared/src/configuration'
import { CodyIDE } from '@sourcegraph/cody-shared/src/configuration'
import { CodyTraceExporterWeb } from '../../src/services/open-telemetry/CodyTraceExportWeb'

// This class is used to initialize and manage the OpenTelemetry service for the webview.
Expand All @@ -14,8 +14,8 @@ export class WebviewOpenTelemetryService {
private unloadInstrumentations?: () => void
private isTracingEnabled = false
private isInitialized = false
private agentIDE?: CodyIDE
private extensionAgentVersion?: string
private clientPlatform?: CodyIDE
private agentVersion?: string
constructor() {
if (!WebviewOpenTelemetryService.instance) {
WebviewOpenTelemetryService.instance = this
Expand All @@ -26,8 +26,8 @@ export class WebviewOpenTelemetryService {
public configure(options?: {
isTracingEnabled?: boolean
debugVerbose?: boolean
agentIDE?: CodyIDE
extensionAgentVersion?: string
clientPlatform?: CodyIDE
agentVersion?: string
}): void {
// If the service is already initialized or if it is not the instance that is being used, return
if (this.isInitialized || WebviewOpenTelemetryService.instance !== this) {
Expand All @@ -37,12 +37,12 @@ export class WebviewOpenTelemetryService {
const {
isTracingEnabled = true,
debugVerbose = false,
agentIDE,
extensionAgentVersion,
clientPlatform,
agentVersion,
} = options || {}
this.isTracingEnabled = isTracingEnabled
this.agentIDE = agentIDE
this.extensionAgentVersion = extensionAgentVersion
this.clientPlatform = clientPlatform
this.agentVersion = agentVersion
const logLevel = debugVerbose ? DiagLogLevel.INFO : DiagLogLevel.ERROR
diag.setLogger(new DiagConsoleLogger(), logLevel)

Expand All @@ -58,8 +58,8 @@ export class WebviewOpenTelemetryService {
new BatchSpanProcessor(
new CodyTraceExporterWeb({
isTracingEnabled: true,
clientPlatform: this.agentIDE ?? ('defaultIDE' as CodyIDE),
agentVersion: this.extensionAgentVersion,
clientPlatform: this.clientPlatform ?? CodyIDE.VSCode,
agentVersion: this.agentVersion,
})
)
)
Expand Down

0 comments on commit 7da14ba

Please sign in to comment.