Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
Examples of errors detected by the...

Examples of errors detected by the V7005 diagnostic

V7005. A variable is assigned to itself.


Visual Studio Code

V7005 The variable 'audience' is assigned to itself. extHostTypes.ts 4033


export class LanguageModelTextPart implements vscode.LanguageModelTextPart2 {
  value: string;
  audience: vscode.LanguageModelPartAudience[] | undefined;

  constructor(value: string, audience?: vscode.LanguageModelPartAudience[]) {
    this.value = value;
    audience = audience;
  }

  toJSON() {
    return {
      $mid: MarshalledId.LanguageModelTextPart,
      value: this.value,
      audience: this.audience,
    };
  }
}

Visual Studio Code

V7005 The expression '[this.children[from].boundarySashes, this.children[to].boundarySashes]' is assigned to itself. gridview.ts 575


swapChildren(from: number, to: number): void {
  from = validateIndex(from, this.children.length);
  to = validateIndex(to, this.children.length);
  if (from === to) {
    return;
  }
  this.splitview.swapViews(from, to);
  // swap boundary sashes
  [this.children[from].boundarySashes, this.children[to].boundarySashes] =
    [this.children[from].boundarySashes, this.children[to].boundarySashes];
  // swap children
  [this.children[from], this.children[to]] =
    [this.children[to], this.children[from]];
  this.onDidChildrenChange();
}