Title: Auto-imports from code actions and completions don't match order that "Organize imports" outputs · Issue #60492 · microsoft/TypeScript · GitHub
Open Graph Title: Auto-imports from code actions and completions don't match order that "Organize imports" outputs · Issue #60492 · microsoft/TypeScript
X Title: Auto-imports from code actions and completions don't match order that "Organize imports" outputs · Issue #60492 · microsoft/TypeScript
Description: 🔎 Search Terms "auto-import", "order", "import", "organize imports" 🕗 Version & Regression Information This is the behavior in every version I tried. ⏯ Playground Link No response 💻 Code In a simple npm package with just TypeScript 5.6.3...
Open Graph Description: 🔎 Search Terms "auto-import", "order", "import", "organize imports" 🕗 Version & Regression Information This is the behavior in every version I tried. ⏯ Playground Link No response 💻 Code In a simpl...
X Description: 🔎 Search Terms "auto-import", "order", "import", "organize imports" 🕗 Version & Regression Information This is the behavior in every version I tried. ⏯ P...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/60492
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Auto-imports from code actions and completions don't match order that \"Organize imports\" outputs","articleBody":"### 🔎 Search Terms\n\n\"auto-import\", \"order\", \"import\", \"organize imports\"\n\n### 🕗 Version & Regression Information\n\n- This is the behavior in every version I tried.\n\n### ⏯ Playground Link\n\n_No response_\n\n### 💻 Code\n\nIn a simple npm package with just TypeScript 5.6.3 installed, create a TypeScript file with the following content:\n\n```ts\nimport { foo } from \"@foo\";\nimport { bar } from \"@bar\";\nimport { a } from \"workspace-a\";\nimport { b } from \"workspace-b\";\n\nconsole.log(foo + bar + a + b)\n```\n\nNow at the end of the file type `is` and select the completion `isAccessor` that brings the import from TypeScript.\n\n\n### 🙁 Actual behavior\n\nThe import from the completion is added below `import { b } from \"workspace-b\";`, but notice how the import gets moved to the middle if one runs the \"Organize imports\" command in VS Code.\n\n### 🙂 Expected behavior\n\nFor completions and code actions that add an import to use the same ordering logic that the \"Organize imports\" command uses. After all this seems to be advertised by https://github.com/microsoft/TypeScript/pull/52115 (\"These rules will also apply to auto-imports and import fixes, which will use the user's collation preferences to determine if a list of import or export specifiers is already sorted before selecting an insertion point\").\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/MariaSolOs","@type":"Person","name":"MariaSolOs"},"datePublished":"2024-11-13T04:49:18Z","url":"https://github.com/microsoft/TypeScript/issues/60492"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dba51adc-0235-4530-e54a-3a60ee03b57c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B830:2A5566:B975:EE12:6B017DA1 |
| html-safe-nonce | f69a1bd6c7e0ca45784c54f0a993ee4b78d28ac4861753f3954c0f7bb0ed78c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODMwOjJBNTU2NjpCOTc1OkVFMTI6NkIwMTdEQTEiLCJ2aXNpdG9yX2lkIjoiNjExNTY2NTYxMDMwMDAzMDM2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | adbc5ab4761f2077a77a701f10b7cffc1693ee6ed1e38bb702462f2bf0d43616 |
| hovercard-subject-tag | issue:2654163562 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/60492/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c070db109d246812d106e16acf9d80315c2fde6db76238fa491420ae327525c3/microsoft/TypeScript/issues/60492 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c070db109d246812d106e16acf9d80315c2fde6db76238fa491420ae327525c3/microsoft/TypeScript/issues/60492 |
| og:image:alt | 🔎 Search Terms "auto-import", "order", "import", "organize imports" 🕗 Version & Regression Information This is the behavior in every version I tried. ⏯ Playground Link No response 💻 Code In a simpl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MariaSolOs |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width