Skip to content

Commit 7dc2dd4

Browse files
refactoring
1 parent 90e4a41 commit 7dc2dd4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/views/ProblemsDiagnosticCollection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as vscode from 'vscode'
22
import * as fs from 'fs'
3-
import { groupBy, startCase } from 'lodash'
3+
import { groupBy, startCase, uniqBy } from 'lodash'
44
import { CodacyCloud } from '../git/CodacyCloud'
55
import { PullRequestIssue } from '../git/PullRequest'
66
import { GitProvider } from '../git/GitProvider'
@@ -156,7 +156,7 @@ export class ProblemsDiagnosticCollection implements vscode.Disposable {
156156
this._collection.clear()
157157
const filesWithApiIssues = Object.keys(this._currentApiIssues).map((key) => ({ file: key, isCliIssue: false }))
158158
const filesWithCliIssues = Object.keys(this._currentCliIssues).map((key) => ({ file: key, isCliIssue: true }))
159-
const allFiles = [...new Set([...filesWithApiIssues, ...filesWithCliIssues])]
159+
const allFiles = uniqBy([...filesWithApiIssues, ...filesWithCliIssues], 'file')
160160
allFiles.forEach(({ file, isCliIssue }) => {
161161
const document = vscode.workspace.textDocuments.find((doc) => doc.uri.fsPath === file)
162162
if (document) {

0 commit comments

Comments
 (0)