Skip to content

Commit 02a1ddf

Browse files
1 parent b7dceb3 commit 02a1ddf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/FileIndexer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ export class FileIndexer {
245245

246246
// Diagnostics should only be added for references to the symbol, not
247247
// the definition
248-
diagnostics: !isDefinitionNode
249-
? this.diagnosticsForSymbol(sym)
250-
: undefined,
248+
diagnostics: isDefinitionNode
249+
? undefined
250+
: FileIndexer.diagnosticsForSymbol(sym),
251251
})
252252
)
253253
if (isDefinitionNode) {
@@ -726,7 +726,7 @@ export class FileIndexer {
726726
}
727727

728728
// Returns the scip diagnostics for a given typescript symbol
729-
private diagnosticsForSymbol(
729+
private static diagnosticsForSymbol(
730730
sym: ts.Symbol
731731
): scip.scip.Diagnostic[] | undefined {
732732
const jsDocTags = sym.getJsDocTags()

src/SnapshotTesting.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ export function formatSnapshot(
297297
pushDoc(range, occurrence.symbol, isDefinition, isStartOfLine)
298298

299299
if (occurrence.diagnostics && occurrence.diagnostics.length > 0) {
300-
for (let diagnostic of occurrence.diagnostics) {
301-
let indent = ' '.repeat(range.start.character - 2)
300+
for (const diagnostic of occurrence.diagnostics) {
301+
const indent = ' '.repeat(range.start.character - 2)
302302
out.push(commentSyntax + indent)
303303
out.push(`diagnostic ${scip.Severity[diagnostic.severity]}:\n`)
304304
if (diagnostic.message) {
305-
for (let messageLine of diagnostic.message.split('\n')) {
305+
for (const messageLine of diagnostic.message.split('\n')) {
306306
out.push(`${commentSyntax + indent}> ${messageLine}\n`)
307307
}
308308
}

0 commit comments

Comments
 (0)