Title: Extract method refactoring incorrectly shown for import statement · Issue #17997 · microsoft/TypeScript · GitHub
Open Graph Title: Extract method refactoring incorrectly shown for import statement · Issue #17997 · microsoft/TypeScript
X Title: Extract method refactoring incorrectly shown for import statement · Issue #17997 · microsoft/TypeScript
Description: TypeScript Version: 2.5.1 Code import _ from 'lodash' Place cursor at start of line. Expected behavior: No refactorings are provided Actual behavior: An extract method refactoring is provided: [Trace - 5:37:09 PM] Sending request: getApp...
Open Graph Description: TypeScript Version: 2.5.1 Code import _ from 'lodash' Place cursor at start of line. Expected behavior: No refactorings are provided Actual behavior: An extract method refactoring is provided: [Tra...
X Description: TypeScript Version: 2.5.1 Code import _ from 'lodash' Place cursor at start of line. Expected behavior: No refactorings are provided Actual behavior: An extract method refactoring is provid...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/17997
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Extract method refactoring incorrectly shown for import statement","articleBody":"\u003c!-- BUGS: Please use this template. -->\r\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:** 2.5.1\r\n**Code**\r\n\r\n```ts\r\nimport _ from 'lodash'\r\n```\r\nPlace cursor at start of line.\r\n\r\n**Expected behavior:**\r\nNo refactorings are provided\r\n\r\n**Actual behavior:**\r\nAn extract method refactoring is provided:\r\n\r\n```\r\n[Trace - 5:37:09 PM] Sending request: getApplicableRefactors (44). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san2/bar.js\",\r\n \"startLine\": 1,\r\n \"startOffset\": 1,\r\n \"endLine\": 1,\r\n \"endOffset\": 7\r\n}\r\n[Trace - 5:37:09 PM] Response received: getApplicableRefactors (44). Request took 2 ms. Success: true \r\nResult: [\r\n {\r\n \"name\": \"Extract Method\",\r\n \"description\": \"Extract function\",\r\n \"inlineable\": true,\r\n \"actions\": [\r\n {\r\n \"description\": \"Extract function into 'file '/Users/matb/projects/san2/bar.js''\",\r\n \"name\": \"scope_0\"\r\n }\r\n ]\r\n }\r\n]\r\n```\r\n\r\nApplying the refactoring results in:\r\n\r\n```ts\r\nnewFunction() _ from 'lodash'\r\nfunction newFunction() {\r\n return import ;\r\n}\r\n```\r\n","author":{"url":"https://github.com/mjbvz","@type":"Person","name":"mjbvz"},"datePublished":"2017-08-24T00:38:32Z","url":"https://github.com/microsoft/TypeScript/issues/17997"}
| 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:edec1714-ac28-2e6b-2f43-add2eb6c7e8e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87DC:2D96F1:E8950E:134F77C:6B01022B |
| html-safe-nonce | e73a19905e623a655db80fd931a28e083a9b53200350e735d3b6a5992b8aad2b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0RDOjJEOTZGMTpFODk1MEU6MTM0Rjc3Qzo2QjAxMDIyQiIsInZpc2l0b3JfaWQiOiI4OTM1MjY3NTM5Mzk5ODAzNDM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ad92db61d57e75d91843607c0e5d3af81652c856d79afd965b1958791e8546e6 |
| hovercard-subject-tag | issue:252454944 |
| 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/17997/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8761c5db8d92afec39c4f28ac5e9705fc7c771a3499f713afd25832207dbf843/microsoft/TypeScript/issues/17997 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8761c5db8d92afec39c4f28ac5e9705fc7c771a3499f713afd25832207dbf843/microsoft/TypeScript/issues/17997 |
| og:image:alt | TypeScript Version: 2.5.1 Code import _ from 'lodash' Place cursor at start of line. Expected behavior: No refactorings are provided Actual behavior: An extract method refactoring is provided: [Tra... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mjbvz |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width