-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Clone node to remove location even when it has been modified if needed #58706
Clone node to remove location even when it has been modified if needed #58706
Conversation
e58f95a
to
a8f73f8
Compare
Wow, this is a big baseline change, but maybe it's just going to have to happen given #58698 is a bad bug? |
Would run perf on this but I think the merge conflict will make the bot mad. |
@typescript-bot perf test this |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
startupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey I've minimized the diff (and swapped them all to only improvements) by adding a small change to explicitly add positions for type parameter names. I think the original change caused us to stop attaching positions to them spuriously, and now we actually do it explicitly, so there's a smaller diff, but there is a diff of parameter names where we now actually have locations. Also a fourslash test update that shows a new comment getting preserved. |
import {fn} from "./a"; | ||
export const m = { | ||
/** | ||
* leading doc for prop | ||
*/ | ||
prop: 1 | ||
} | ||
|
||
|
||
export const x = { p: fn }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test doesn't seem like it tests #58698; am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, maybe I'm just wrong given the issue was about pulling comments from other files, yeah.
@typescript-bot perf test this faster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming perf remains unchanged.
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
* upstream/main: (37 commits) Added NoTruncation flag to completions (microsoft#58719) Clone node to remove location even when it has been modified if needed (microsoft#58706) Properly account for `this` argument in intersection apparent type caching (microsoft#58677) Fix: Include Values of Script Extensions for Unicode Property Value Expressions in Regular Expressions (microsoft#58615) In `reScanSlashToken` use `charCodeChecked` not `codePointChecked` (microsoft#58727) Shorten error spans for errors reported on constructor declarations (microsoft#58061) Mark file as skips typechecking if it contains ts-nocheck (microsoft#58593) Fixed an issue with broken `await using` declarations in `for of` loops (microsoft#56466) Do not expand type references in keyof and index access (microsoft#58715) Improve the performance of isolatedDeclarations quickfix (microsoft#58722) Unwrap `NoInfer` types when narrowing (microsoft#58292) Recover from type reuse errors by falling back to inferred type printing (microsoft#58720) Fixing self import (microsoft#58718) Enable JS emit for noCheck and noCheck for transpileModule (microsoft#58364) Revert PR 55371 (microsoft#58702) Update dependencies (microsoft#58639) Fix baselines after PR 58621 (microsoft#58705) Do not infer `yield*` type from contextual `TReturn` (microsoft#58621) `await using` normative changes (microsoft#58624) Handling statements from a known source file (microsoft#58679) ...
Because when a node is updated because its' children changed, location data is, by default, copied by the node update functions. In addition, I also handle deleting location data from node arrays from other files as well, as I noticed that while debugging.
Additionally, one of the comment range copies in the test was coming from an unchecked
setCommentRange
outside the node copying code, so that now has builtin checks now, too.Fixes #58698