-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Error elaborations should not be de-duped #33143
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
Comments
In my particular case, I write compile time tests and it just so happens I was testing two different files. One was the Both clauses expect a However, I noticed that adding the This is like the In this case, the error message can change depending on which line/file is encountered first. |
The |
So, duplicate of #32224 then? |
Not a duplicate! This second instance of the error omits lines that the first instance would have. It isn't reordering types, it's completely omitting lines from the message. The first instance of an error could have 5 lines and the second instance of the same error, produced in a different way, in a different file, could have just 2 lines. Because the second instance is omitting the last 3 lines that should be there. They should be there because the extra lines can help with figuring out errors. It makes no sense to omit lines from a completely unrelated repro of the same error. It's just that it reminds me of the union order problem a little. (Output changes based on what line is encountered first) They're completely different, though. |
Oh, that's just the fact that we only issue elaborations once per file. This is an intentional choice for batch compilation. I'm not sure it makes sense for the language service, but it sounds like you are getting these errors from batch compilation. Without elaboration deduplication, batch compiler output would be huge. Are you proposing issuing all elaborations for every error in batch compilation, or in the language service? |
Not the language service, I suppose. I'm not actually familiar with the TS API. I think I might be using the batch compilation. https://github.com/AnyhowStep/tsql/blob/master/test/compile-time/util.ts#L129 So, I guess I'm asking for a way to turn off error deduplication for batch compilation. I'm comparing each file's actual output (.d.ts and errors) with some expected output. So, if errors are getting deduplicated, it'll cause my actual output to change randomly as I add more tests. I added comments to a commit on my project, it shows which lines were removed because of a test I added, |
I tried to create one program per compile-time test file. It's super slow =( Before, I had, const program = createProgram({
rootNames,
options,
});
program.emit(/*snip*/); It took 30s to run tests on 674 files. Now, I have, for (const rootName of rootNames) {
const program = createProgram({
rootNames : [rootName],
options,
});
program.emit(/*snip*/);
} And I've been waiting for minutes and it still hasn't completed. Is there any way I can speed things up? =( |
It took 2319.367 to use That's about 40 minutes |
TypeScript Version: 3.5.1
Search Terms:
Code
Expected behavior:
Actual behavior:
Playground Link:
Playground
Related Issues:
The text was updated successfully, but these errors were encountered: