Skip to content

Commit

Permalink
Support Windsurf editor and any future unknown editors
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Nov 22, 2024
1 parent e4eef7f commit e8c04cd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/wakatime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export class WakaTime {
'Arduino IDE': 'arduino',
'Azure Data Studio': 'azdata',
Cursor: 'cursor',
'SQL Operations Studio': 'sqlops',
'Visual Studio Code': 'vscode',
Onivim: 'onivim',
'Onivim 2': 'onivim',
'SQL Operations Studio': 'sqlops',
'Visual Studio Code': 'vscode',
Windsurf: 'windsurf',
};
private agentName: string;
private extension: any;
Expand Down Expand Up @@ -84,7 +85,14 @@ export class WakaTime {

let extension = vscode.extensions.getExtension('WakaTime.vscode-wakatime');
this.extension = (extension != undefined && extension.packageJSON) || { version: '0.0.0' };
this.agentName = this.appNames[vscode.env.appName] || 'vscode';

if (this.appNames[vscode.env.appName]) {
this.agentName = this.appNames[vscode.env.appName];
} else if (vscode.env.appName.toLowerCase().includes('visual')) {
this.agentName = 'vscode';
} else {
this.agentName = vscode.env.appName.replace(/\s/g, '').toLowerCase();
}

this.options.getSetting('settings', 'disabled', false, (disabled: Setting) => {
this.disabled = disabled.value === 'true';
Expand Down

0 comments on commit e8c04cd

Please sign in to comment.