GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add option for organize imports case sensitivity by andrewbranch · Pull Request #51733 · microsoft/TypeScript

Conversation

@andrewbranch

@andrewbranch Andrew Branch (andrewbranch) commented Dec 3, 2022

Copy link
Copy Markdown
Member

Fixes #51616
Related: #51579

A new user preference (editor PR to follow) allows setting the case sensitivity for import sorting. By default, we detect.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SlurpTheo reacted with eyes emoji
All reactions
  • 👀 1 reaction
Andrew Branch (andrewbranch) added 2 commits November 30, 2022 10:51
@andrewbranch
Add ignore case option to organizeImports
6f21600
@andrewbranch
Adopt in auto-imports, use same case-insensitive comparison as eslint
7ae6020
@typescript-bot TypeScript Bot (typescript-bot) assigned Andrew Branch (andrewbranch) Dec 3, 2022
@typescript-bot TypeScript Bot (typescript-bot) added the Author: Team label Dec 3, 2022
@typescript-bot TypeScript Bot (typescript-bot) assigned Jake Bailey (jakebailey) Dec 3, 2022
@andrewbranch
Andrew Branch (andrewbranch) requested a review from Jake Bailey (jakebailey) December 3, 2022 00:02
@typescript-bot TypeScript Bot (typescript-bot) added the For Milestone Bug PRs that fix a bug with a specific milestone label Dec 3, 2022
@andrewbranch
Andrew Branch (andrewbranch) requested a review from Nathan Shively-Sanders (sandersn) December 3, 2022 00:02
Andrew Branch (andrewbranch) added 6 commits December 5, 2022 11:02
@andrewbranch
Fix build/lint
d4d0844
@andrewbranch
Mark functions internal
a9eb9cf
@andrewbranch
Update affected auto import test
289276b
@andrewbranch
Update API baseline
005c08d
@andrewbranch
Update protocol
a3a6cd4
@andrewbranch
Update API baseline
3c34aab
@andrewbranch Andrew Branch (andrewbranch) mentioned this pull request Dec 6, 2022
Allow enforcement of import-specifiers import-js/eslint-plugin-import#1787
Closed
@jakebailey

Jake Bailey (jakebailey) commented Dec 6, 2022

Copy link
Copy Markdown
Member

I'm finding it hard to deduce from the tests, but what is the behavior when you have both HasDecorator and hasDecorator, in various orders? Does it always output the same thing?

This is something that frustrates me currently about the eslint plugin; it doesn't care which order you have, which leaves a hole where we can end up with conflicts when the result should not depend on the input ordering at all.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sheetalkamat
Sheetal Nandi (sheetalkamat) approved these changes Dec 6, 2022
View reviewed changes
@andrewbranch

Andrew Branch (andrewbranch) commented Dec 6, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Currently, case-insensitive is truly case-insensitive like eslint, which means any order between specifiers that differ only in case is allowed, and a reshuffle will preserve the pre-existing relative order (eslint doesn’t use a stable sort, which means pre-existing order between case-different specifiers is not preserved, resulting in sorts that look totally random). This is something we can definitely change or improve on over the eslint behavior, but if we change back to case sensitive sorting, I wasn’t sure if anyone would end up caring about it.

jakebailey reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jakebailey
Jake Bailey (jakebailey) reviewed Dec 6, 2022
View reviewed changes
Comment thread src/services/organizeImports.ts
/** @internal */
export function getImportDeclarationInsertionIndex(sortedImports: SortedReadonlyArray<AnyImportOrRequireStatement>, newImport: AnyImportOrRequireStatement) {
const index = binarySearch(sortedImports, newImport, identity, compareImportsOrRequireStatements);
export const detectImportSpecifierSorting = memoizeWeak((specifiers: readonly ImportSpecifier[]): SortKind => {

@jakebailey Jake Bailey (jakebailey) Dec 6, 2022

Copy link
Copy Markdown
Member

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.

Is there a particular reason why this one is cached but others aren't? Would everything benefit from being cached like this?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andrewbranch Andrew Branch (andrewbranch) Dec 6, 2022

Copy link
Copy Markdown
Member Author

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.

As it stands now, this is the only one that benefits from being cached. It gets called several times from auto-imports in ways that are cumbersome to cache locally.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jakebailey reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
jakebailey
Jake Bailey (jakebailey) approved these changes Dec 6, 2022
View reviewed changes
Comment thread src/compiler/core.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

sandersn
Nathan Shively-Sanders (sandersn) reviewed Dec 12, 2022
View reviewed changes
Comment thread src/compiler/core.ts
let prevElement = array[0];
for (const element of array.slice(1)) {
if (comparer(prevElement, element) === Comparison.GreaterThan) {
for (let i = 1, len = array.length; i < len; i++) {

@sandersn Nathan Shively-Sanders (sandersn) Dec 12, 2022

Copy link
Copy Markdown
Member

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.

:yikes: nice catch

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andrewbranch Andrew Branch (andrewbranch) Dec 12, 2022

Copy link
Copy Markdown
Member Author

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.

Daniel Rosenwasser (@DanielRosenwasser) noticed this while I was screensharing working on this. Turns out I wrote it years ago, before I was terrified of allocations 🙈

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DanielRosenwasser reacted with laugh emoji DanielRosenwasser reacted with heart emoji
All reactions
  • 😄 1 reaction
  • ❤️ 1 reaction
@jakebailey Jake Bailey (jakebailey) mentioned this pull request Dec 13, 2022
Reduce polymorphism resulting from unstable Node shapes #51682
Merged
@andrewbranch
Merge branch 'main' into bug/organize-imports-case-sensitivity
54d350f
DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) reviewed Dec 13, 2022
View reviewed changes
Comment thread src/compiler/core.ts Outdated
for (let i = 1, len = array.length; i < len; i++) {
const prevElement = array[i - 1];
const element = array[i];
if (caseSensitiveComparer(prevElement, element) === Comparison.GreaterThan) {

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Dec 13, 2022

Copy link
Copy Markdown
Member

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.

It would be more obvious to me what was going on if this was something like !== Comparison.LessThanOrEqualTo

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andrewbranch Andrew Branch (andrewbranch) Dec 13, 2022

Copy link
Copy Markdown
Member Author

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.

“less than or equal to” can’t be represented in a single value the way our Comparison system works:

export const enum Comparison {
    LessThan    = -1,
    EqualTo     = 0,
    GreaterThan = 1
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Dec 13, 2022

Copy link
Copy Markdown
Member

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.

Yeah - just an idle sort of "it would be nice".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) reviewed Dec 13, 2022
View reviewed changes
Comment thread src/compiler/core.ts Outdated
Comment on lines +981 to +989
if (caseSensitiveComparer(prevElement, element) === Comparison.GreaterThan) {
kind &= ~SortKind.CaseSensitive;
}
if (caseInsensitiveComparer(prevElement, element) === Comparison.GreaterThan) {
kind &= ~SortKind.CaseInsensitive;
}
if (kind === SortKind.None) {
return kind;
}

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Dec 13, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

I think that you can optimize this.

  1. If you know that you're not case-sensitively sorted, you never have to check again; you can just always check the case-insensitive branch.
  2. If you are not case-insensitively sorted, you can just bail out at that point. You won't be case-sensitively sorted.

That means the only times you ever have to do two checks for a pair of elements is the first pair that forces you to transition to only checking for case-insensitive comparison.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andrewbranch Andrew Branch (andrewbranch) Dec 13, 2022

Copy link
Copy Markdown
Member Author

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.

Good point on (1), but (2) is not true. ['B', 'a'] is not case-insensitively sorted but is case-sensitively sorted. (That’s the entire reason this is bit flags.)

It sure sounds like the “case-insensitively sorted lists” ought to be a superset of “case-sensitively sorted lists,” doesn’t it? They’re actually a classic Venn diagram shape where there is a non-empty intersection but neither is a subset of the other. When Jake was first trying to explain the problem to me verbally, I made the same mistake.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DanielRosenwasser reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Dec 13, 2022

Copy link
Copy Markdown
Member

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.

Ugh, why was I so convinced this was true? But yes, I see that. At least you can avoid each kind of comparison after the first failure.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andrewbranch Andrew Branch (andrewbranch) Dec 13, 2022

Copy link
Copy Markdown
Member Author

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.

(Quiz ChatGPT about this for a good laugh)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) reviewed Dec 13, 2022
View reviewed changes
Comment thread src/compiler/core.ts
}
return kind;
}

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Dec 13, 2022

Copy link
Copy Markdown
Member

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.

Suggested change

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andrewbranch
Short-circuit comparisons that have already failed
4257fe4
@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Dec 13, 2022

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) user test tsserver
TypeScript Bot (@typescript-bot) test tsserver top100
TypeScript Bot (@typescript-bot) perf test this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 13, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the diff-based user code test suite (tsserver) on this PR at 4257fe4. You can monitor the build here.

Update: The results are in!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 13, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the diff-based top-repos suite (tsserver) on this PR at 4257fe4. You can monitor the build here.

Update: The results are in!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 13, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the perf test suite on this PR at 4257fe4. You can monitor the build here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 13, 2022

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the user test suite comparing main and refs/pull/51733/merge:

Everything looks good!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andrewbranch
Andrew Branch (andrewbranch) merged commit 4076ff8 into microsoft:main Dec 13, 2022
@andrewbranch
Andrew Branch (andrewbranch) deleted the bug/organize-imports-case-sensitivity branch December 13, 2022 22:37
@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 14, 2022

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the top-repos suite comparing main and refs/pull/51733/merge:

Something interesting changed - please have a look.

Details

backstage/backstage

⚠️ Note that built also had errors ⚠️
Req #4960 - completionInfo
    at hasCovariantVoidArgument (/typescript-main/built/local/tsserver.js:59960:91)
    at relateVariances (/typescript-main/built/local/tsserver.js:59210:64)
    at structuredTypeRelatedToWorker (/typescript-main/built/local/tsserver.js:58879:32)
    at structuredTypeRelatedTo (/typescript-main/built/local/tsserver.js:58800:21)
    at recursiveTypeRelatedTo (/typescript-main/built/local/tsserver.js:58770:19)
    at isRelatedTo (/typescript-main/built/local/tsserver.js:58329:16)
    at compareProperties2 (/typescript-main/built/local/tsserver.js:60116:12)
    at propertiesIdenticalTo (/typescript-main/built/local/tsserver.js:59578:25)
    at propertiesRelatedTo (/typescript-main/built/local/tsserver.js:59430:16)
    at structuredTypeRelatedToWorker (/typescript-main/built/local/tsserver.js:59169:21)
    at structuredTypeRelatedTo (/typescript-main/built/local/tsserver.js:58800:21)
    at recursiveTypeRelatedTo (/typescript-main/built/local/tsserver.js:58770:19)
    at isRelatedTo (/typescript-main/built/local/tsserver.js:58329:16)
    at checkTypeRelatedTo (/typescript-main/built/local/tsserver.js:58063:20)
    at isTypeRelatedTo (/typescript-main/built/local/tsserver.js:58018:14)
    at isTypeIdenticalTo (/typescript-main/built/local/tsserver.js:57345:12)
    at isTypeOrBaseIdenticalTo (/typescript-main/built/local/tsserver.js:61563:42)
    at inferFromMatchingTypes (/typescript-main/built/local/tsserver.js:61233:15)
    at inferFromTypes (/typescript-main/built/local/tsserver.js:61065:44)
    at inferTypes (/typescript-main/built/local/tsserver.js:61040:5)
    at inferReverseMappedType (/typescript-main/built/local/tsserver.js:60873:5)
    at /typescript-main/built/local/tsserver.js:60852:65
    at map (/typescript-main/built/local/tsserver.js:2921:19)
    at createReverseMappedType (/typescript-main/built/local/tsserver.js:60852:28)
    at inferTypeForHomomorphicMappedType (/typescript-main/built/local/tsserver.js:60836:18)
    at inferToMappedType (/typescript-main/built/local/tsserver.js:61353:32)
    at inferFromObjectTypes (/typescript-main/built/local/tsserver.js:61440:13)
    at invokeOnce (/typescript-main/built/local/tsserver.js:61218:9)
    at inferFromTypes (/typescript-main/built/local/tsserver.js:61176:11)
    at inferWithPriority (/typescript-main/built/local/tsserver.js:61183:7)
    at inferFromObjectTypes (/typescript-main/built/local/tsserver.js:61481:17)
    at invokeOnce (/typescript-main/built/local/tsserver.js:61218:9)
    at inferFromTypes (/typescript-main/built/local/tsserver.js:61176:11)
    at inferToMultipleTypes (/typescript-main/built/local/tsserver.js:61303:15)
    at inferFromTypes (/typescript-main/built/local/tsserver.js:61157:9)
    at inferFromProperties (/typescript-main/built/local/tsserver.js:61510:11)
    at inferFromObjectTypes (/typescript-main/built/local/tsserver.js:61499:9)
    at invokeOnce (/typescript-main/built/local/tsserver.js:61218:9)
    at inferFromTypes (/typescript-main/built/local/tsserver.js:61176:11)
    at inferTypes (/typescript-main/built/local/tsserver.js:61040:5)
    at inferTypeArguments (/typescript-main/built/local/tsserver.js:66805:11)
    at chooseOverload (/typescript-main/built/local/tsserver.js:67426:33)
    at resolveCall (/typescript-main/built/local/tsserver.js:67293:16)
    at resolveCallExpression (/typescript-main/built/local/tsserver.js:67624:12)
    at resolveSignature (/typescript-main/built/local/tsserver.js:67969:16)
    at getResolvedSignature (/typescript-main/built/local/tsserver.js:67989:20)
    at getContextualTypeForArgumentAtIndex (/typescript-main/built/local/tsserver.js:64299:112)
    at getContextualTypeForArgument (/typescript-main/built/local/tsserver.js:64293:39)
    at getContextualType2 (/typescript-main/built/local/tsserver.js:64673:16)
    at getApparentTypeOfContextualType (/typescript-main/built/local/tsserver.js:64615:120)
    at getContextualTypeForObjectLiteralElement (/typescript-main/built/local/tsserver.js:64495:18)
    at getContextualType2 (/typescript-main/built/local/tsserver.js:64681:16)
    at getApparentTypeOfContextualType (/typescript-main/built/local/tsserver.js:64615:120)
    at getContextualType2 (/typescript-main/built/local/tsserver.js:64686:22)
    at Object.getContextualType (/typescript-main/built/local/tsserver.js:44085:14)
    at getContextualType (/typescript-main/built/local/tsserver.js:135744:348)
    at getCompletionData (/typescript-main/built/local/tsserver.js:135968:43)
    at Object.getCompletionsAtPosition (/typescript-main/built/local/tsserver.js:134376:26)
    at Object.getCompletionsAtPosition2 [as getCompletionsAtPosition] (/typescript-main/built/local/tsserver.js:122893:35)
    at IOSession.getCompletions (/typescript-main/built/local/tsserver.js:160896:54)
    at completionInfo (/typescript-main/built/local/tsserver.js:159577:43)
    at /typescript-main/built/local/tsserver.js:161606:69
    at IOSession.executeWithRequestId (/typescript-main/built/local/tsserver.js:161598:14)
    at IOSession.executeCommand (/typescript-main/built/local/tsserver.js:161606:29)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:161634:51)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:163033:14)
Req #4960 - completionInfo
    at hasCovariantVoidArgument (/typescript-51733/built/local/tsserver.js:60013:91)
    at relateVariances (/typescript-51733/built/local/tsserver.js:59263:64)
    at structuredTypeRelatedToWorker (/typescript-51733/built/local/tsserver.js:58932:32)
    at structuredTypeRelatedTo (/typescript-51733/built/local/tsserver.js:58853:21)
    at recursiveTypeRelatedTo (/typescript-51733/built/local/tsserver.js:58823:19)
    at isRelatedTo (/typescript-51733/built/local/tsserver.js:58382:16)
    at compareProperties2 (/typescript-51733/built/local/tsserver.js:60169:12)
    at propertiesIdenticalTo (/typescript-51733/built/local/tsserver.js:59631:25)
    at propertiesRelatedTo (/typescript-51733/built/local/tsserver.js:59483:16)
    at structuredTypeRelatedToWorker (/typescript-51733/built/local/tsserver.js:59222:21)
    at structuredTypeRelatedTo (/typescript-51733/built/local/tsserver.js:58853:21)
    at recursiveTypeRelatedTo (/typescript-51733/built/local/tsserver.js:58823:19)
    at isRelatedTo (/typescript-51733/built/local/tsserver.js:58382:16)
    at checkTypeRelatedTo (/typescript-51733/built/local/tsserver.js:58116:20)
    at isTypeRelatedTo (/typescript-51733/built/local/tsserver.js:58071:14)
    at isTypeIdenticalTo (/typescript-51733/built/local/tsserver.js:57398:12)
    at isTypeOrBaseIdenticalTo (/typescript-51733/built/local/tsserver.js:61616:42)
    at inferFromMatchingTypes (/typescript-51733/built/local/tsserver.js:61286:15)
    at inferFromTypes (/typescript-51733/built/local/tsserver.js:61118:44)
    at inferTypes (/typescript-51733/built/local/tsserver.js:61093:5)
    at inferReverseMappedType (/typescript-51733/built/local/tsserver.js:60926:5)
    at /typescript-51733/built/local/tsserver.js:60905:65
    at map (/typescript-51733/built/local/tsserver.js:2925:19)
    at createReverseMappedType (/typescript-51733/built/local/tsserver.js:60905:28)
    at inferTypeForHomomorphicMappedType (/typescript-51733/built/local/tsserver.js:60889:18)
    at inferToMappedType (/typescript-51733/built/local/tsserver.js:61406:32)
    at inferFromObjectTypes (/typescript-51733/built/local/tsserver.js:61493:13)
    at invokeOnce (/typescript-51733/built/local/tsserver.js:61271:9)
    at inferFromTypes (/typescript-51733/built/local/tsserver.js:61229:11)
    at inferWithPriority (/typescript-51733/built/local/tsserver.js:61236:7)
    at inferFromObjectTypes (/typescript-51733/built/local/tsserver.js:61534:17)
    at invokeOnce (/typescript-51733/built/local/tsserver.js:61271:9)
    at inferFromTypes (/typescript-51733/built/local/tsserver.js:61229:11)
    at inferToMultipleTypes (/typescript-51733/built/local/tsserver.js:61356:15)
    at inferFromTypes (/typescript-51733/built/local/tsserver.js:61210:9)
    at inferFromProperties (/typescript-51733/built/local/tsserver.js:61563:11)
    at inferFromObjectTypes (/typescript-51733/built/local/tsserver.js:61552:9)
    at invokeOnce (/typescript-51733/built/local/tsserver.js:61271:9)
    at inferFromTypes (/typescript-51733/built/local/tsserver.js:61229:11)
    at inferTypes (/typescript-51733/built/local/tsserver.js:61093:5)
    at inferTypeArguments (/typescript-51733/built/local/tsserver.js:66858:11)
    at chooseOverload (/typescript-51733/built/local/tsserver.js:67479:33)
    at resolveCall (/typescript-51733/built/local/tsserver.js:67346:16)
    at resolveCallExpression (/typescript-51733/built/local/tsserver.js:67677:12)
    at resolveSignature (/typescript-51733/built/local/tsserver.js:68022:16)
    at getResolvedSignature (/typescript-51733/built/local/tsserver.js:68042:20)
    at getContextualTypeForArgumentAtIndex (/typescript-51733/built/local/tsserver.js:64352:112)
    at getContextualTypeForArgument (/typescript-51733/built/local/tsserver.js:64346:39)
    at getContextualType2 (/typescript-51733/built/local/tsserver.js:64726:16)
    at getApparentTypeOfContextualType (/typescript-51733/built/local/tsserver.js:64668:120)
    at getContextualTypeForObjectLiteralElement (/typescript-51733/built/local/tsserver.js:64548:18)
    at getContextualType2 (/typescript-51733/built/local/tsserver.js:64734:16)
    at getApparentTypeOfContextualType (/typescript-51733/built/local/tsserver.js:64668:120)
    at getContextualType2 (/typescript-51733/built/local/tsserver.js:64739:22)
    at Object.getContextualType (/typescript-51733/built/local/tsserver.js:44138:14)
    at getContextualType (/typescript-51733/built/local/tsserver.js:135817:348)
    at getCompletionData (/typescript-51733/built/local/tsserver.js:136041:43)
    at Object.getCompletionsAtPosition (/typescript-51733/built/local/tsserver.js:134449:26)
    at Object.getCompletionsAtPosition2 [as getCompletionsAtPosition] (/typescript-51733/built/local/tsserver.js:122950:35)
    at IOSession.getCompletions (/typescript-51733/built/local/tsserver.js:161016:54)
    at completionInfo (/typescript-51733/built/local/tsserver.js:159697:43)
    at /typescript-51733/built/local/tsserver.js:161726:69
    at IOSession.executeWithRequestId (/typescript-51733/built/local/tsserver.js:161718:14)
    at IOSession.executeCommand (/typescript-51733/built/local/tsserver.js:161726:29)
    at IOSession.onMessage (/typescript-51733/built/local/tsserver.js:161754:51)
    at Interface.<anonymous> (/typescript-51733/built/local/tsserver.js:163153:14)

That is a filtered view of the text. To see the raw error text, go to RepoResults4/backstage.backstage.rawError.txt in the artifact folder

Last few requests

{"seq":4957,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/plugins/catalog-backend-module-gitlab/src/service/GitlabDiscoveryEntityProviderCatalogModule.test.ts","line":25,"offset":50,"entryNames":["app-defaults"]}}
{"seq":4958,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/plugins/catalog-backend-module-gitlab/src/service/GitlabDiscoveryEntityProviderCatalogModule.test.ts","line":52,"offset":18,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":1}}
{"seq":4959,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/plugins/catalog-backend-module-gitlab/src/service/GitlabDiscoveryEntityProviderCatalogModule.test.ts","line":52,"offset":18,"entryNames":["addedProviders"]}}
{"seq":4960,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/plugins/catalog-backend-module-gitlab/src/service/GitlabDiscoveryEntityProviderCatalogModule.test.ts","line":81,"offset":18,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":1}}

Repro Steps

  1. git clone https://github.com/backstage/backstage --recurse-submodules
  2. In dir backstage, run git reset --hard 5b0701ea1b1eaf16d505959f13977b2f3f757d88
  3. Install packages (exact steps are below, but it might be easier to follow the repo readme)
    1. In dir backstage/cypress, run yarn install --no-immutable --mode=skip-build
    2. In dir backstage/microsite-next, run yarn install --no-immutable --mode=skip-build
    3. In dir backstage/microsite, run yarn install --no-immutable --mode=skip-build
    4. In dir backstage, run yarn install --no-immutable --mode=skip-build
    5. In dir backstage/storybook, run yarn install --no-immutable --mode=skip-build
  4. Back in the initial folder, download RepoResults4/backstage.backstage.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./backstage ./backstage.backstage.replay.txt path/to/tsserver.js
  7. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

felixrieseberg/windows95

⚠️ Note that built also had errors ⚠️
Req #542 - references
    at formatMessage2 (/typescript-main/built/local/tsserver.js:158985:21)
    at IOSession.writeMessage (/typescript-main/built/local/tsserver.js:159992:21)
    at IOSession.send (/typescript-main/built/local/tsserver.js:159989:10)
    at IOSession.doOutput (/typescript-main/built/local/tsserver.js:160036:10)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:161647:14)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:163033:14)
Req #542 - references
    at formatMessage2 (/typescript-51733/built/local/tsserver.js:159105:21)
    at IOSession.writeMessage (/typescript-51733/built/local/tsserver.js:160112:21)
    at IOSession.send (/typescript-51733/built/local/tsserver.js:160109:10)
    at IOSession.doOutput (/typescript-51733/built/local/tsserver.js:160156:10)
    at IOSession.onMessage (/typescript-51733/built/local/tsserver.js:161767:14)
    at Interface.<anonymous> (/typescript-51733/built/local/tsserver.js:163153:14)

That is a filtered view of the text. To see the raw error text, go to RepoResults4/felixrieseberg.windows95.rawError.txt in the artifact folder

Last few requests

{"seq":539,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/src/renderer/lib/_libwabt.js","line":13,"offset":135424}}
{"seq":540,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/src/renderer/lib/_libwabt.js","line":13,"offset":135723}}
{"seq":541,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/src/renderer/lib/_libwabt.js","line":13,"offset":137242}}
{"seq":542,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/src/renderer/lib/_libwabt.js","line":13,"offset":138991}}

Repro Steps

  1. git clone https://github.com/felixrieseberg/windows95 --recurse-submodules
  2. In dir windows95, run git reset --hard 17a81393467e2668eb2eea291ab4b6a749756dad
  3. In dir windows95, run yarn install --ignore-engines --ignore-scripts --silent
  4. Back in the initial folder, download RepoResults4/felixrieseberg.windows95.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./windows95 ./felixrieseberg.windows95.replay.txt path/to/tsserver.js
  7. npx tsreplay --help to learn about helpful switches for debugging, logging, etc
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andrewbranch Andrew Branch (andrewbranch) mentioned this pull request Jan 20, 2023
Don’t let unsorted import groups eagerly derail sort detection #52332
Merged
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) mentioned this pull request Jan 27, 2023
Design Meeting Notes, 1/25/2023 #52469
Closed
@andrewbranch Andrew Branch (andrewbranch) mentioned this pull request Mar 7, 2023
TSLint named-imports-order and ESLint sort-imports don't order special chars (_) the same as organizeImports #37548
Closed
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@sandersn Nathan Shively-Sanders (sandersn) sandersn left review comments
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) DanielRosenwasser left review comments
@jakebailey Jake Bailey (jakebailey) jakebailey approved these changes
@sheetalkamat Sheetal Nandi (sheetalkamat) sheetalkamat approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@andrewbranch Andrew Branch (andrewbranch)

@jakebailey Jake Bailey (jakebailey)

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Presence of underscore prefixed item in sorted import list causes auto-import to place new import at the end

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@andrewbranch @jakebailey @DanielRosenwasser @typescript-bot @sandersn @sheetalkamat
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.