Skip to content

Conversation

CyrusNajmabadi
Copy link
Contributor

In order to get all diagnostics, you must call all the APIs. And no APIs return
diagnostics produced by other APIs. This is how things were before the addition
of the getCompletionOptionsDiagnostics API, and i'm returning things to that state.

…nostics.

In order to get all diagnostics, you must call all the APIs.  And no APIs return
diagnostics produced by other APIs.  This is how things were before hte addition
of the getCompletionOptionsDiagnostics API, and i'm returning things to that state.
@@ -105,7 +105,7 @@ namespace ts {
}

export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile): Diagnostic[] {
let diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile));
let diagnostics = program.getOptionsDiagnostics().concat(program.getSyntacticDiagnostics(sourceFile)).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split this into multiple lines

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can't concat just take multiple arguments?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @DanielRosenwasser. Just check concat take multiple arguments which will clean up the expression a bit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

CyrusNajmabadi added a commit that referenced this pull request Jun 18, 2015
Make it so all our diagnostics APIs return an independent set of diagnostics.
@CyrusNajmabadi CyrusNajmabadi merged commit 3a9bc99 into master Jun 18, 2015
@CyrusNajmabadi CyrusNajmabadi deleted the diagnosticCleanup2 branch June 18, 2015 18:12
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants