Repository: TabbyML/tabby
File: clients/vscode/src/lsp/CodeLensMiddleware.ts (TypeScript)

Code before:
  fontWeight: "normal",
  isWholeLine: true,
  rangeBehavior: DecorationRangeBehavior.ClosedOpen,
});
const decorationTypeUnchanged = window.createTextEditorDecorationType({});
const decorationTypePending = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("editor.inactiveSelectionBackground"),
  isWholeLine: true,
  rangeBehavior: DecorationRangeBehavior.ClosedClosed,
});
const decorationTypeTextInserted = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("diffEditor.insertedTextBackground"),
  isWholeLine: false,
  rangeBehavior: DecorationRangeBehavior.ClosedOpen,
});
const decorationTypeTextDeleted = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("diffEditor.removedTextBackground"),
  isWholeLine: false,
  rangeBehavior: DecorationRangeBehavior.ClosedOpen,
});
const decorationTypeLineInserted = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("diffEditor.insertedLineBackground"),
  isWholeLine: true,
  rangeBehavior: DecorationRangeBehavior.ClosedClosed,
});
const decorationTypeDeleted = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("diffEditor.removedLineBackground"),
  isWholeLine: true,
  rangeBehavior: DecorationRangeBehavior.ClosedClosed,
});
const decorationTypes: Record<string, TextEditorDecorationType> = {
  header: decorationTypeHeader,
  footer: decorationTypeFooter,
  commentsFirstLine: decorationTypeComments,
  comments: decorationTypeComments,
  waiting: decorationTypePending,
  inProgress: decorationTypeLineInserted,
  unchanged: decorationTypeUnchanged,
  inserted: decorationTypeLineInserted,
  deleted: decorationTypeDeleted,
};

const textDecorationTypes: Record<string, TextEditorDecorationType> = {
  inserted: decorationTypeTextInserted,
  deleted: decorationTypeTextDeleted,
};

export class CodeLensMiddleware implements VscodeLspCodeLensMiddleware {
  private readonly decorationMap = new Map<TextEditor, Map<TextEditorDecorationType, Range[]>>();

  async provideCodeLenses(

Review comment (suggestion):
Also rename this to keep consistent.
```suggestion
const decorationTypeLineDeleted = window.createTextEditorDecorationType({
```

Code after:
  fontWeight: "normal",
  isWholeLine: true,
  rangeBehavior: DecorationRangeBehavior.ClosedOpen,
});
const decorationTypeUnchanged = window.createTextEditorDecorationType({});
const decorationTypePending = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("editor.inactiveSelectionBackground"),
  isWholeLine: true,
  rangeBehavior: DecorationRangeBehavior.ClosedClosed,
});
const decorationTypeTextInserted = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("diffEditor.insertedTextBackground"),
  isWholeLine: false,
  rangeBehavior: DecorationRangeBehavior.ClosedOpen,
});
const decorationTypeTextDeleted = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("diffEditor.removedTextBackground"),
  isWholeLine: false,
  rangeBehavior: DecorationRangeBehavior.ClosedOpen,
});
const decorationTypeLineInserted = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("diffEditor.insertedLineBackground"),
  isWholeLine: true,
  rangeBehavior: DecorationRangeBehavior.ClosedClosed,
});
const decorationTypeLineDeleted = window.createTextEditorDecorationType({
  backgroundColor: new ThemeColor("diffEditor.removedLineBackground"),
  isWholeLine: true,
  rangeBehavior: DecorationRangeBehavior.ClosedClosed,
});
const lineDecorationTypes: Record<string, TextEditorDecorationType> = {
  header: decorationTypeHeader,
  footer: decorationTypeFooter,
  commentsFirstLine: decorationTypeComments,
  comments: decorationTypeComments,
  waiting: decorationTypePending,
  inProgress: decorationTypeLineInserted,
  unchanged: decorationTypeUnchanged,
  inserted: decorationTypeLineInserted,
  deleted: decorationTypeLineDeleted,
};

const textDecorationTypes: Record<string, TextEditorDecorationType> = {
  inserted: decorationTypeTextInserted,
  deleted: decorationTypeTextDeleted,
};

export class CodeLensMiddleware implements VscodeLspCodeLensMiddleware {
  private readonly decorationMap = new Map<TextEditor, Map<TextEditorDecorationType, Range[]>>();

  async provideCodeLenses(