Skip to content

Typescript development problem: Is specialized knowledge required to solve fourslash errors? #56283

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

Closed
1 task done
craigphicks opened this issue Nov 1, 2023 · 4 comments
Closed
1 task done
Labels
Question An issue which isn't directly actionable in code

Comments

@craigphicks
Copy link

Acknowledgement

  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

I have a pull #56281 which involves changing src/lib/rs5.d.ts.
I think because it changes that file, there are a few fourslash errors similar to this one:

         fourslash tests
           tests/cases/fourslash/completionListInTypeParameterOfClassExpression1.ts
             fourslash test completionListInTypeParameterOfClassExpression1.ts runs correctly:
     AssertionError: At marker "4": expected [ 'D', 'any', 'Array', …(138) ] to deeply equal [ 'D', 'any', 'Array', …(137) ]
      at _TestState.verifyCompletionsAreExactly (src/harness/fourslashImpl.ts:1213:16)
      at _TestState.verifyCompletionsWorker (src/harness/fourslashImpl.ts:1074:18)
      at _TestState.verifyCompletions (src/harness/fourslashImpl.ts:1009:25)
      at Verify.completions (src/harness/fourslashInterfaceImpl.ts:251:31)
      at eval (completionListInTypeParameterOfClassExpression1.js:8:8)
      at runCode (src/harness/fourslashImpl.ts:4607:9)
      at runFourSlashTestContent (src/harness/fourslashImpl.ts:4565:5)
      at runFourSlashTest (src/harness/fourslashImpl.ts:4548:5)
      at Context.<anonymous> (src/testRunner/fourslashRunner.ts:60:39)
      at processImmediate (node:internal/timers:478:21)

They don't go away after hereby baseline-accept.
Does this require changing the LKG?
Otherwise, how to inspect the differences and modify the baseline?

@jakebailey
Copy link
Member

If you read the test case, you'll see it mention globalTypesPlus, which depends on

const globalTypeDecls: readonly ExpectedCompletionEntryObject[] = [
and would need to be updated. Most (nearly all) PRs do not modify the globals in such a way that this hardcoded list changes.

@jakebailey
Copy link
Member

jakebailey commented Nov 1, 2023

However, needing to modify this may indicate that something is wrong with the PR (which I have not read; I am not sure anything has changed to make filter(Boolean) any more acceptable than before).

@RyanCavanaugh RyanCavanaugh added the Question An issue which isn't directly actionable in code label Nov 1, 2023
@craigphicks
Copy link
Author

However, needing to modify this may indicate that something is wrong with the PR (which I have not read; I am not sure anything has changed to make filter(Boolean) any more acceptable than before).

I had added a BooleanConverter interface which has only the conversion with no constructor, to use as filter predicate. The idea being to be as specific as possible. However, based on your advice about the cost of changing globals, which I agree with, I have removed it now, and it is using BooleanConstructor without issue.

@typescript-bot
Copy link
Collaborator

This issue has been marked as "Question" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

4 participants