Skip to content

Conversation

jakebailey
Copy link
Member

This mirrors getBindAndCheckDiagnosticsForFileNoCache, which looks like:

    function getBindAndCheckDiagnosticsForFileNoCache(
        sourceFile: SourceFile,
        cancellationToken: CancellationToken | undefined,
        nodesToCheck?: Node[],
    ): readonly Diagnostic[] {
        return runWithCancellationToken(() => {
            if (skipTypeChecking(sourceFile, options, program)) {
                return emptyArray;
            }

            const typeChecker = getTypeChecker();

Notably I am not doing this in getBindDiagnosticsForFile since that isn't actually called by anyone except tsgo for timing.

This fixes the baseline checks that were commented out in #762.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 13 changed files in this pull request and generated no comments.

Files not reviewed (10)
  • testdata/baselines/reference/submodule/compiler/intersectionsOfLargeUnions2.errors.txt: Language not supported
  • testdata/baselines/reference/submodule/compiler/intersectionsOfLargeUnions2.errors.txt.diff: Language not supported
  • testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithComputedPropertyName.errors.txt: Language not supported
  • testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithComputedPropertyName.errors.txt.diff: Language not supported
  • testdata/baselines/reference/submodule/conformance/plainJSRedeclare3.errors.txt: Language not supported
  • testdata/baselines/reference/submodule/conformance/plainJSReservedStrict.errors.txt: Language not supported
  • testdata/baselines/reference/submodule/conformance/ts-expect-error-nocheck-js.errors.txt: Language not supported
  • testdata/baselines/reference/submoduleAccepted/conformance/plainJSRedeclare3.errors.txt.diff: Language not supported
  • testdata/baselines/reference/submoduleAccepted/conformance/plainJSReservedStrict.errors.txt.diff: Language not supported
  • testdata/baselines/reference/submoduleAccepted/conformance/ts-expect-error-nocheck-js.errors.txt.diff: Language not supported
Comments suppressed due to low confidence (1)

internal/checker/utilities.go:1783

  • Ensure that replacing tspath.IsDeclarationFileName(sourceFile.FileName()) with sourceFile.IsDeclarationFile provides the same behavior in all scenarios. It is important that this change does not inadvertently affect the logic for identifying declaration files.
func SkipTypeChecking(sourceFile *ast.SourceFile, options *core.CompilerOptions) bool {

@jakebailey jakebailey mentioned this pull request Apr 7, 2025
@jakebailey jakebailey enabled auto-merge April 7, 2025 20:20
@jakebailey jakebailey added this pull request to the merge queue Apr 7, 2025
}

func (p *Program) getBindDiagnosticsForFile(sourceFile *ast.SourceFile) []*ast.Diagnostic {
// TODO: restore this; tsgo's main depends on this function binding all files for timing.
Copy link
Member

Choose a reason for hiding this comment

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

When and why would we restore this? Seems odd for skipLibChecks to affect binding.

Copy link
Member Author

@jakebailey jakebailey Apr 7, 2025

Choose a reason for hiding this comment

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

We have one function that gets both bind and check diagnostics (getBindAndCheckDiagnosticsForFileNoCache), and it's silenced by this same function in Strada. Why? I have no idea, but that's how it was. It's just that they are split apart in Corsa for timing reasons at the moment.

Merged via the queue into main with commit 704f06c Apr 7, 2025
23 checks passed
@jakebailey jakebailey deleted the jabaile/semantic-diags-unchecked branch April 7, 2025 20:31
tmm1 added a commit to tmm1/typescript-go that referenced this pull request Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants