Skip to content

Handle blockedStringType #1266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2025
Merged

Handle blockedStringType #1266

merged 2 commits into from
Jun 23, 2025

Conversation

Andarist
Copy link
Contributor

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 23, 2025 11:23
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.

Pull Request Overview

This PR adds support for returning blockedStringType for certain string literals and re-enables previously skipped string-completion tests by removing their skips and cleaning up the failing-tests list.

  • Implement isSkipDirectInferenceNode check to return blockedStringType in checkExpressionWorker
  • Un-skip four legacy fourslash tests and remove them from failingTests.txt
  • Remove the NodeFlagsSkipDirectInference constant

Reviewed Changes

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

Show a summary per file
File Description
internal/fourslash/tests/gen/stringLiteralCompletionsInPositionTypedUsingRest_test.go Removed t.Skip() to enable the test
internal/fourslash/tests/gen/stringLiteralCompletionsForGenericConditionalTypesUsingTemplateLiteralTypes_test.go Removed t.Skip() to enable the test
internal/fourslash/tests/gen/stringCompletionsFromGenericConditionalTypesUsingTemplateLiteralTypes_test.go Removed t.Skip() to enable the test
internal/fourslash/tests/gen/completionsLiteralMatchingGenericSignature_test.go Removed t.Skip() to enable the test
internal/fourslash/_scripts/failingTests.txt Cleaned up entries for the now-passing tests
internal/checker/checker.go Added if c.isSkipDirectInferenceNode(node) { return c.blockedStringType }
internal/ast/nodeflags.go Removed NodeFlagsSkipDirectInference constant
Comments suppressed due to low confidence (2)

internal/ast/nodeflags.go:43

  • The NodeFlagsSkipDirectInference constant was removed but is still referenced by c.isSkipDirectInferenceNode. Re-add this flag or update the inference logic to use the correct mechanism.
	NodeFlagsJsonFile        NodeFlags = 1 << 25 // If node was parsed in a Json

internal/checker/checker.go:7354

  • [nitpick] The comment !!! Handle blockedStringType is informal and may confuse future readers; consider replacing it with a clear description, e.g., // Skip direct inference for blocked string literals.
	case ast.KindStringLiteral, ast.KindNoSubstitutionTemplateLiteral:

@jakebailey
Copy link
Member

Seems like there might be some nondeterministic behavior based on the test failures?

@gabritto
Copy link
Member

Seems like there might be some nondeterministic behavior based on the test failures?

Yep, which is really surprising to me... @Andarist if you want, I can investigate this when I'm done with my current batch of completions/fourslash fixes.

@Andarist
Copy link
Contributor Author

@jakebailey pointed me to the cause of non-determinism (thanks!) so it's fixed now

@Andarist Andarist requested a review from gabritto June 23, 2025 17:20
@jakebailey jakebailey added this pull request to the merge queue Jun 23, 2025
Merged via the queue into microsoft:main with commit b7ca2d3 Jun 23, 2025
22 checks passed
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