Skip to content

Commit

Permalink
fix: add type safety checks using 'data satisfies never' in various c…
Browse files Browse the repository at this point in the history
…omponents
  • Loading branch information
tamuratak committed Jan 19, 2025
1 parent 275d493 commit 11d8fa3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export class Viewer {
break
}
default: {
data satisfies never
this.extension.logger.error(`Unknown websocket message: ${msg}`)
break
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class Completer implements vscode.CompletionItemProvider {
break
default:
// This shouldn't be possible, so mark as error case in log.
this.extension.logger.error(`Error - trying to complete unknown type: ${inspectCompact(type)}`)
this.extension.logger.error(`Error - trying to complete unknown type: ${inspectCompact(type satisfies never)}`)
return []
}
const result = line.match(reg)
Expand Down
1 change: 1 addition & 0 deletions viewer/components/extensionconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class ExtensionConnection {
break
}
default: {
data satisfies never
break
}
}
Expand Down
1 change: 1 addition & 0 deletions viewer/components/panelmanagerconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class PanelManagerConnection {
break
}
default: {
data satisfies never
break
}
}
Expand Down

0 comments on commit 11d8fa3

Please sign in to comment.