File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed
Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -630,7 +630,7 @@ let simpleAddMissingCases: codeActionExtractor = async ({
630630 . join ( "" )
631631 . trim ( ) ;
632632
633- let filePath = utils . uriToNormalizedPath ( file as utils . FileURI ) ;
633+ let filePath = utils . uriToNormalizedPath ( file ) ;
634634
635635 let newSwitchCode = await utils . runAnalysisAfterSanityCheck ( filePath , [
636636 "codemod" ,
Original file line number Diff line number Diff line change @@ -587,8 +587,7 @@ async function compileContents(
587587 const change = Object . values ( ca . codeAction . edit . changes ) [ 0 ] ;
588588
589589 ca . codeAction . edit . changes = {
590- [ utils . pathToURI ( entry . file . sourceFilePath ) as utils . FileURI ] :
591- change ,
590+ [ utils . pathToURI ( entry . file . sourceFilePath ) ] : change ,
592591 } ;
593592 }
594593 } ) ;
@@ -655,9 +654,7 @@ async function compileContents(
655654 }
656655 }
657656
658- const fileUri = utils . pathToURI (
659- entry . file . sourceFilePath ,
660- ) as utils . FileURI ;
657+ const fileUri = utils . pathToURI ( entry . file . sourceFilePath ) ;
661658
662659 // Update filesWithDiagnostics to track this file
663660 // entry.project.rootPath is guaranteed to match a key in projectsFiles
@@ -671,10 +668,10 @@ async function compileContents(
671668 const allDiagnostics = [ ...res , ...compilerDiagnosticsForFile ] ;
672669
673670 if ( allDiagnostics . length > 0 ) {
674- projectFile . filesWithDiagnostics . add ( fileUri as utils . FileURI ) ;
671+ projectFile . filesWithDiagnostics . add ( fileUri ) ;
675672 } else {
676673 // Only remove if there are no diagnostics at all
677- projectFile . filesWithDiagnostics . delete ( fileUri as utils . FileURI ) ;
674+ projectFile . filesWithDiagnostics . delete ( fileUri ) ;
678675 }
679676 }
680677
Original file line number Diff line number Diff line change @@ -167,11 +167,12 @@ let sendUpdatedDiagnostics = async () => {
167167 codeActionsFromDiagnostics = codeActions ;
168168
169169 // diff
170- Object . keys ( filesAndErrors ) . forEach ( ( file ) => {
171- const fileUri = file as utils . FileURI ;
170+ (
171+ Object . entries ( filesAndErrors ) as Array < [ utils . FileURI , p . Diagnostic [ ] ] >
172+ ) . forEach ( ( [ fileUri , diagnostics ] ) => {
172173 let params : p . PublishDiagnosticsParams = {
173174 uri : fileUri ,
174- diagnostics : filesAndErrors [ fileUri ] ,
175+ diagnostics,
175176 } ;
176177 let notification : p . NotificationMessage = {
177178 jsonrpc : c . jsonrpcVersion ,
@@ -216,8 +217,10 @@ let sendUpdatedDiagnostics = async () => {
216217
217218 let errorCount = 0 ;
218219 let warningCount = 0 ;
219- for ( const [ fileUri , diags ] of Object . entries ( filesAndErrors ) ) {
220- const filePath = utils . uriToNormalizedPath ( fileUri as utils . FileURI ) ;
220+ for ( const [ fileUri , diags ] of Object . entries ( filesAndErrors ) as Array <
221+ [ utils . FileURI , p . Diagnostic [ ] ]
222+ > ) {
223+ const filePath = utils . uriToNormalizedPath ( fileUri ) ;
221224 if ( filePath . startsWith ( projectRootPath ) ) {
222225 for ( const d of diags as v . Diagnostic [ ] ) {
223226 if ( d . severity === v . DiagnosticSeverity . Error ) errorCount ++ ;
You can’t perform that action at this time.
0 commit comments