( diagnostic: Pick<TsServerDiagnosticType, 'category' | 'code'>, )
| 56 | } |
| 57 | |
| 58 | function tsCategoryToSeverity( |
| 59 | diagnostic: Pick<TsServerDiagnosticType, 'category' | 'code'>, |
| 60 | ): Diagnostic['severity'] { |
| 61 | if (diagnostic.code === 7027) { |
| 62 | return 'warning'; |
| 63 | } |
| 64 | // force resolve types with fallback |
| 65 | switch (diagnostic.category) { |
| 66 | case 'error': |
| 67 | return 'error'; |
| 68 | case 'warning': |
| 69 | return 'warning'; |
| 70 | case 'suggestion': |
| 71 | return 'warning'; |
| 72 | case 'info': |
| 73 | return 'info'; |
| 74 | default: |
| 75 | return 'info'; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | function isDiagnosticWithLocation( |
| 80 | diagnostic: TsServerDiagnosticType, |
no outgoing calls
no test coverage detected