Merge pull request #142 from plon-Susk7/dev

pass build information to extension
This commit is contained in:
Andrew Pareles 2024-11-17 19:39:35 -08:00 committed by GitHub
commit 250b90634f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 2 deletions

View file

@ -12,6 +12,7 @@ import { CtrlKWebviewProvider } from './providers/CtrlKWebviewProvider';
import { AutocompleteProvider } from './AutcompleteProvider';
import { runTreeSitter } from '../common/LangaugeServer/createJsProgramGraph';
// // this comes from vscode.proposed.editorInsets.d.ts
// declare module 'vscode' {
// export interface WebviewEditorInset {

View file

@ -1,12 +1,29 @@
import posthog from 'posthog-js'
const buildEnv = 'development';
const buildNumber = '1.0.0';
const isMac = process.platform === 'darwin';
// TODO use commandKey
const commandKey = isMac ? '⌘' : 'Ctrl';
const systemInfo = {
buildEnv,
buildNumber,
isMac,
}
export const identifyUser = (id: string) => {
posthog.identify(id)
}
export const captureEvent = (eventId: string, properties: object) => {
posthog.capture(eventId, properties)
posthog.capture(eventId, { ...properties, systemInfo })
}
export const initPosthog = () => {
@ -17,4 +34,4 @@ export const initPosthog = () => {
person_profiles: 'identified_only' // we only track events from identified users. We identify them in Sidebar
}
)
}
}