Title: getEditsForRefactor debug failure in js file · Issue #18671 · microsoft/TypeScript · GitHub
Open Graph Title: getEditsForRefactor debug failure in js file · Issue #18671 · microsoft/TypeScript
X Title: getEditsForRefactor debug failure in js file · Issue #18671 · microsoft/TypeScript
Description: TypeScript Version: 2.5.3-insiders Code While investigating #18328 For the JavaScript file: class Foo { constructor(x) { this.x = x; } z() { console.log('1') } } Try to extract the line console.log('1'). After fixing #18328, we will now ...
Open Graph Description: TypeScript Version: 2.5.3-insiders Code While investigating #18328 For the JavaScript file: class Foo { constructor(x) { this.x = x; } z() { console.log('1') } } Try to extract the line console.log...
X Description: TypeScript Version: 2.5.3-insiders Code While investigating #18328 For the JavaScript file: class Foo { constructor(x) { this.x = x; } z() { console.log('1') } } Try to extract the line con...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/18671
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"getEditsForRefactor debug failure in js file","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.3-insiders\r\n\r\n**Code**\r\nWhile investigating #18328\r\n\r\nFor the JavaScript file:\r\n\r\n```ts\r\nclass Foo {\r\n constructor(x) {\r\n this.x = x;\r\n }\r\n\r\n z() {\r\n console.log('1')\r\n }\r\n\r\n}\r\n```\r\n\r\nTry to extract the line `console.log('1')`.\r\n\r\nAfter fixing #18328, we will now try to send the formatting options to TypeScript before requesting the refactoring edits. This change is not checked into VSCode yet because it causes the failure below\r\n\r\n\r\n**Bug**\r\n\r\nThis results in a debug failure. Here's the complete log\r\n\r\n```\r\n[Info - 3:38:49 PM] Using tsserver from: /Users/matb/projects/vscode/extensions/node_modules/typescript/lib\r\n[Info - 3:38:49 PM] TSServer log file: /var/folders/_0/611900jn0yb43f1rc47_2wmh0000gp/T/vscode-tsserver-log-LHRW22/tsserver.log\r\n[Info - 3:38:49 PM] Forking TSServer\r\nPATH: /usr/local/opt/opencv3/bin:/Users/matb/.nvm/versions/node/v7.6.0/bin:/Users/matb/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet\r\n[Trace - 3:38:49 PM] Sending request: configure (0). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"hostInfo\": \"vscode\"\r\n}\r\n[Trace - 3:38:50 PM] Response received: configure (0). Request took 280 ms. Success: true \r\n[Trace - 3:38:50 PM] Sending request: compilerOptionsForInferredProjects (1). Response expected: yes. Current queue length: 3\r\nArguments: {\r\n \"options\": {\r\n \"module\": \"CommonJS\",\r\n \"target\": \"ES6\",\r\n \"allowSyntheticDefaultImports\": true,\r\n \"allowNonTsExtensions\": true,\r\n \"allowJs\": true,\r\n \"jsx\": \"Preserve\",\r\n \"checkJs\": false\r\n }\r\n}\r\n[Trace - 3:38:50 PM] Response received: compilerOptionsForInferredProjects (1). Request took 279 ms. Success: true \r\nResult: true\r\n[Trace - 3:38:50 PM] Sending request: open (2). Response expected: no. Current queue length: 2\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"fileContent\": \"class Foo {\\n constructor(x) {\\n this.x = x;\\n }\\n\\n z() {\\n console.log('1')\\n }\\n\\n}\\n\\n\\nnew Foo(1)\",\r\n \"scriptKindName\": \"JS\",\r\n \"projectRootPath\": \"/Users/matb/projects/san\"\r\n}\r\n[Trace - 3:38:50 PM] Sending request: getSupportedCodeFixes (3). Response expected: yes. Current queue length: 1\r\n[Trace - 3:38:50 PM] TypeScript Service: canceled request with sequence number 5\r\n[Trace - 3:38:50 PM] Event received: configFileDiag (0).\r\nData: {\r\n \"triggerFile\": \"/Users/matb/projects/san/y.js\",\r\n \"diagnostics\": []\r\n}\r\n[Trace - 3:38:50 PM] Response received: getSupportedCodeFixes (3). Request took 694 ms. Success: true \r\nResult: [\r\n \"1002\",\r\n \"1003\",\r\n \"1005\",\r\n \"1006\",\r\n \"1009\",\r\n \"1010\",\r\n \"1012\",\r\n \"1014\",\r\n \"1015\",\r\n \"1016\",\r\n \"1017\",\r\n \"1018\",\r\n \"1019\",\r\n \"1020\",\r\n \"1021\",\r\n \"1022\",\r\n \"1023\",\r\n \"1024\",\r\n \"1028\",\r\n \"1029\",\r\n \"1030\",\r\n \"1031\",\r\n \"1034\",\r\n \"1035\",\r\n \"1036\",\r\n \"1038\",\r\n \"1039\",\r\n \"1040\",\r\n \"1041\",\r\n \"1042\",\r\n \"1043\",\r\n \"1044\",\r\n \"1045\",\r\n \"1046\",\r\n \"1047\",\r\n \"1048\",\r\n \"1049\",\r\n \"1051\",\r\n \"1052\",\r\n \"1053\",\r\n \"1054\",\r\n \"1055\",\r\n \"1056\",\r\n \"1057\",\r\n \"1058\",\r\n \"1059\",\r\n \"1060\",\r\n \"1061\",\r\n \"1062\",\r\n \"1063\",\r\n \"1064\",\r\n \"1066\",\r\n \"1068\",\r\n \"1070\",\r\n \"1071\",\r\n \"1079\",\r\n \"1084\",\r\n \"1085\",\r\n \"1086\",\r\n \"1089\",\r\n \"1090\",\r\n \"1091\",\r\n \"1092\",\r\n \"1093\",\r\n \"1094\",\r\n \"1095\",\r\n \"1096\",\r\n \"1097\",\r\n \"1098\",\r\n \"1099\",\r\n \"1100\",\r\n \"1101\",\r\n \"1102\",\r\n \"1103\",\r\n \"1104\",\r\n \"1105\",\r\n \"1107\",\r\n \"1108\",\r\n \"1109\",\r\n \"1110\",\r\n \"1113\",\r\n \"1114\",\r\n \"1115\",\r\n \"1116\",\r\n \"1117\",\r\n \"1118\",\r\n \"1119\",\r\n \"1120\",\r\n \"1121\",\r\n \"1122\",\r\n \"1123\",\r\n \"1124\",\r\n \"1125\",\r\n \"1126\",\r\n \"1127\",\r\n \"1128\",\r\n \"1129\",\r\n \"1130\",\r\n \"1131\",\r\n \"1132\",\r\n \"1134\",\r\n \"1135\",\r\n \"1136\",\r\n \"1137\",\r\n \"1138\",\r\n \"1139\",\r\n \"1140\",\r\n \"1141\",\r\n \"1142\",\r\n \"1144\",\r\n \"1146\",\r\n \"1147\",\r\n \"1148\",\r\n \"1149\",\r\n \"1150\",\r\n \"1155\",\r\n \"1156\",\r\n \"1157\",\r\n \"1160\",\r\n \"1161\",\r\n \"1162\",\r\n \"1163\",\r\n \"1164\",\r\n \"1165\",\r\n \"1166\",\r\n \"1168\",\r\n \"1169\",\r\n \"1170\",\r\n \"1171\",\r\n \"1172\",\r\n \"1173\",\r\n \"1174\",\r\n \"1175\",\r\n \"1176\",\r\n \"1177\",\r\n \"1178\",\r\n \"1179\",\r\n \"1180\",\r\n \"1181\",\r\n \"1182\",\r\n \"1183\",\r\n \"1184\",\r\n \"1185\",\r\n \"1186\",\r\n \"1187\",\r\n \"1188\",\r\n \"1189\",\r\n \"1190\",\r\n \"1191\",\r\n \"1192\",\r\n \"1193\",\r\n \"1194\",\r\n \"1196\",\r\n \"1197\",\r\n \"1198\",\r\n \"1199\",\r\n \"1200\",\r\n \"1202\",\r\n \"1203\",\r\n \"1205\",\r\n \"1206\",\r\n \"1207\",\r\n \"1208\",\r\n \"1209\",\r\n \"1210\",\r\n \"1211\",\r\n \"1212\",\r\n \"1213\",\r\n \"1214\",\r\n \"1215\",\r\n \"1216\",\r\n \"1218\",\r\n \"1219\",\r\n \"1220\",\r\n \"1221\",\r\n \"1222\",\r\n \"1223\",\r\n \"1224\",\r\n \"1225\",\r\n \"1226\",\r\n \"1227\",\r\n \"1228\",\r\n \"1229\",\r\n \"1230\",\r\n \"1231\",\r\n \"1232\",\r\n \"1233\",\r\n \"1234\",\r\n \"1235\",\r\n \"1236\",\r\n \"1237\",\r\n \"1238\",\r\n \"1239\",\r\n \"1240\",\r\n \"1241\",\r\n \"1242\",\r\n \"1243\",\r\n \"1244\",\r\n \"1245\",\r\n \"1246\",\r\n \"1247\",\r\n \"1248\",\r\n \"1249\",\r\n \"1250\",\r\n \"1251\",\r\n \"1252\",\r\n \"1253\",\r\n \"1254\",\r\n \"1300\",\r\n \"1308\",\r\n \"1312\",\r\n \"1313\",\r\n \"1314\",\r\n \"1315\",\r\n \"1316\",\r\n \"1317\",\r\n \"1318\",\r\n \"1319\",\r\n \"1320\",\r\n \"1321\",\r\n \"1322\",\r\n \"1323\",\r\n \"1324\",\r\n \"1325\",\r\n \"1326\",\r\n \"1327\",\r\n \"1328\",\r\n \"2300\",\r\n \"2301\",\r\n \"2302\",\r\n \"2303\",\r\n \"2304\",\r\n \"2305\",\r\n \"2306\",\r\n \"2307\",\r\n \"2308\",\r\n \"2309\",\r\n \"2310\",\r\n \"2311\",\r\n \"2312\",\r\n \"2313\",\r\n \"2314\",\r\n \"2315\",\r\n \"2316\",\r\n \"2317\",\r\n \"2318\",\r\n \"2319\",\r\n \"2320\",\r\n \"2321\",\r\n \"2322\",\r\n \"2323\",\r\n \"2324\",\r\n \"2325\",\r\n \"2326\",\r\n \"2327\",\r\n \"2328\",\r\n \"2329\",\r\n \"2330\",\r\n \"2331\",\r\n \"2332\",\r\n \"2333\",\r\n \"2334\",\r\n \"2335\",\r\n \"2336\",\r\n \"2337\",\r\n \"2338\",\r\n \"2339\",\r\n \"2340\",\r\n \"2341\",\r\n \"2342\",\r\n \"2343\",\r\n \"2344\",\r\n \"2345\",\r\n \"2346\",\r\n \"2347\",\r\n \"2348\",\r\n \"2349\",\r\n \"2350\",\r\n \"2351\",\r\n \"2352\",\r\n \"2353\",\r\n \"2354\",\r\n \"2355\",\r\n \"2356\",\r\n \"2357\",\r\n \"2358\",\r\n \"2359\",\r\n \"2360\",\r\n \"2361\",\r\n \"2362\",\r\n \"2363\",\r\n \"2364\",\r\n \"2365\",\r\n \"2366\",\r\n \"2368\",\r\n \"2369\",\r\n \"2370\",\r\n \"2371\",\r\n \"2372\",\r\n \"2373\",\r\n \"2374\",\r\n \"2375\",\r\n \"2376\",\r\n \"2377\",\r\n \"2378\",\r\n \"2379\",\r\n \"2380\",\r\n \"2381\",\r\n \"2382\",\r\n \"2383\",\r\n \"2384\",\r\n \"2385\",\r\n \"2386\",\r\n \"2387\",\r\n \"2388\",\r\n \"2389\",\r\n \"2390\",\r\n \"2391\",\r\n \"2392\",\r\n \"2393\",\r\n \"2394\",\r\n \"2395\",\r\n \"2396\",\r\n \"2397\",\r\n \"2399\",\r\n \"2400\",\r\n \"2401\",\r\n \"2402\",\r\n \"2403\",\r\n \"2404\",\r\n \"2405\",\r\n \"2406\",\r\n \"2407\",\r\n \"2408\",\r\n \"2409\",\r\n \"2410\",\r\n \"2411\",\r\n \"2412\",\r\n \"2413\",\r\n \"2414\",\r\n \"2415\",\r\n \"2417\",\r\n \"2420\",\r\n \"2422\",\r\n \"2423\",\r\n \"2424\",\r\n \"2425\",\r\n \"2426\",\r\n \"2427\",\r\n \"2428\",\r\n \"2430\",\r\n \"2431\",\r\n \"2432\",\r\n \"2433\",\r\n \"2434\",\r\n \"2435\",\r\n \"2436\",\r\n \"2437\",\r\n \"2438\",\r\n \"2439\",\r\n \"2440\",\r\n \"2441\",\r\n \"2442\",\r\n \"2443\",\r\n \"2444\",\r\n \"2445\",\r\n \"2446\",\r\n \"2447\",\r\n \"2448\",\r\n \"2449\",\r\n \"2450\",\r\n \"2451\",\r\n \"2452\",\r\n \"2453\",\r\n \"2454\",\r\n \"2455\",\r\n \"2456\",\r\n \"2457\",\r\n \"2458\",\r\n \"2459\",\r\n \"2460\",\r\n \"2461\",\r\n \"2462\",\r\n \"2463\",\r\n \"2464\",\r\n \"2465\",\r\n \"2466\",\r\n \"2467\",\r\n \"2468\",\r\n \"2469\",\r\n \"2470\",\r\n \"2471\",\r\n \"2472\",\r\n \"2473\",\r\n \"2474\",\r\n \"2475\",\r\n \"2476\",\r\n \"2477\",\r\n \"2478\",\r\n \"2479\",\r\n \"2480\",\r\n \"2481\",\r\n \"2483\",\r\n \"2484\",\r\n \"2487\",\r\n \"2488\",\r\n \"2489\",\r\n \"2490\",\r\n \"2491\",\r\n \"2492\",\r\n \"2493\",\r\n \"2494\",\r\n \"2495\",\r\n \"2496\",\r\n \"2497\",\r\n \"2498\",\r\n \"2499\",\r\n \"2500\",\r\n \"2501\",\r\n \"2502\",\r\n \"2503\",\r\n \"2504\",\r\n \"2505\",\r\n \"2506\",\r\n \"2507\",\r\n \"2508\",\r\n \"2509\",\r\n \"2510\",\r\n \"2511\",\r\n \"2512\",\r\n \"2513\",\r\n \"2514\",\r\n \"2515\",\r\n \"2516\",\r\n \"2517\",\r\n \"2518\",\r\n \"2519\",\r\n \"2520\",\r\n \"2521\",\r\n \"2522\",\r\n \"2523\",\r\n \"2524\",\r\n \"2525\",\r\n \"2526\",\r\n \"2527\",\r\n \"2528\",\r\n \"2529\",\r\n \"2530\",\r\n \"2531\",\r\n \"2532\",\r\n \"2533\",\r\n \"2534\",\r\n \"2535\",\r\n \"2536\",\r\n \"2537\",\r\n \"2538\",\r\n \"2539\",\r\n \"2540\",\r\n \"2541\",\r\n \"2542\",\r\n \"2543\",\r\n \"2544\",\r\n \"2545\",\r\n \"2546\",\r\n \"2547\",\r\n \"2548\",\r\n \"2549\",\r\n \"2550\",\r\n \"2551\",\r\n \"2552\",\r\n \"2553\",\r\n \"2554\",\r\n \"2555\",\r\n \"2556\",\r\n \"2557\",\r\n \"2558\",\r\n \"2559\",\r\n \"2560\",\r\n \"2600\",\r\n \"2601\",\r\n \"2602\",\r\n \"2603\",\r\n \"2604\",\r\n \"2605\",\r\n \"2606\",\r\n \"2607\",\r\n \"2608\",\r\n \"2609\",\r\n \"2649\",\r\n \"2651\",\r\n \"2652\",\r\n \"2653\",\r\n \"2654\",\r\n \"2656\",\r\n \"2657\",\r\n \"2658\",\r\n \"2659\",\r\n \"2660\",\r\n \"2661\",\r\n \"2662\",\r\n \"2663\",\r\n \"2664\",\r\n \"2665\",\r\n \"2666\",\r\n \"2667\",\r\n \"2668\",\r\n \"2669\",\r\n \"2670\",\r\n \"2671\",\r\n \"2672\",\r\n \"2673\",\r\n \"2674\",\r\n \"2675\",\r\n \"2676\",\r\n \"2677\",\r\n \"2678\",\r\n \"2679\",\r\n \"2680\",\r\n \"2681\",\r\n \"2682\",\r\n \"2683\",\r\n \"2684\",\r\n \"2685\",\r\n \"2686\",\r\n \"2687\",\r\n \"2688\",\r\n \"2689\",\r\n \"2691\",\r\n \"2692\",\r\n \"2693\",\r\n \"2694\",\r\n \"2695\",\r\n \"2696\",\r\n \"2697\",\r\n \"2698\",\r\n \"2699\",\r\n \"2700\",\r\n \"2701\",\r\n \"2702\",\r\n \"2703\",\r\n \"2704\",\r\n \"2705\",\r\n \"2706\",\r\n \"2707\",\r\n \"2708\",\r\n \"2709\",\r\n \"2710\",\r\n \"2711\",\r\n \"2712\",\r\n \"2713\",\r\n \"4000\",\r\n \"4002\",\r\n \"4004\",\r\n \"4006\",\r\n \"4008\",\r\n \"4010\",\r\n \"4012\",\r\n \"4014\",\r\n \"4016\",\r\n \"4019\",\r\n \"4020\",\r\n \"4022\",\r\n \"4023\",\r\n \"4024\",\r\n \"4025\",\r\n \"4026\",\r\n \"4027\",\r\n \"4028\",\r\n \"4029\",\r\n \"4030\",\r\n \"4031\",\r\n \"4032\",\r\n \"4033\",\r\n \"4034\",\r\n \"4035\",\r\n \"4036\",\r\n \"4037\",\r\n \"4038\",\r\n \"4039\",\r\n \"4040\",\r\n \"4041\",\r\n \"4042\",\r\n \"4043\",\r\n \"4044\",\r\n \"4045\",\r\n \"4046\",\r\n \"4047\",\r\n \"4048\",\r\n \"4049\",\r\n \"4050\",\r\n \"4051\",\r\n \"4052\",\r\n \"4053\",\r\n \"4054\",\r\n \"4055\",\r\n \"4056\",\r\n \"4057\",\r\n \"4058\",\r\n \"4059\",\r\n \"4060\",\r\n \"4061\",\r\n \"4062\",\r\n \"4063\",\r\n \"4064\",\r\n \"4065\",\r\n \"4066\",\r\n \"4067\",\r\n \"4068\",\r\n \"4069\",\r\n \"4070\",\r\n \"4071\",\r\n \"4072\",\r\n \"4073\",\r\n \"4074\",\r\n \"4075\",\r\n \"4076\",\r\n \"4077\",\r\n \"4078\",\r\n \"4081\",\r\n \"4082\",\r\n \"4083\",\r\n \"4091\",\r\n \"4092\",\r\n \"4094\",\r\n \"5001\",\r\n \"5009\",\r\n \"5010\",\r\n \"5011\",\r\n \"5012\",\r\n \"5014\",\r\n \"5023\",\r\n \"5024\",\r\n \"5033\",\r\n \"5042\",\r\n \"5047\",\r\n \"5051\",\r\n \"5052\",\r\n \"5053\",\r\n \"5054\",\r\n \"5055\",\r\n \"5056\",\r\n \"5057\",\r\n \"5058\",\r\n \"5059\",\r\n \"5060\",\r\n \"5061\",\r\n \"5062\",\r\n \"5063\",\r\n \"5064\",\r\n \"5065\",\r\n \"5066\",\r\n \"5067\",\r\n \"6044\",\r\n \"6045\",\r\n \"6046\",\r\n \"6048\",\r\n \"6049\",\r\n \"6050\",\r\n \"6051\",\r\n \"6053\",\r\n \"6054\",\r\n \"6059\",\r\n \"6064\",\r\n \"6082\",\r\n \"6103\",\r\n \"6114\",\r\n \"6129\",\r\n \"6131\",\r\n \"6133\",\r\n \"6137\",\r\n \"6138\",\r\n \"6140\",\r\n \"6142\",\r\n \"6143\",\r\n \"7005\",\r\n \"7006\",\r\n \"7008\",\r\n \"7009\",\r\n \"7010\",\r\n \"7011\",\r\n \"7013\",\r\n \"7015\",\r\n \"7016\",\r\n \"7017\",\r\n \"7018\",\r\n \"7019\",\r\n \"7020\",\r\n \"7022\",\r\n \"7023\",\r\n \"7024\",\r\n \"7025\",\r\n \"7026\",\r\n \"7027\",\r\n \"7028\",\r\n \"7029\",\r\n \"7030\",\r\n \"7031\",\r\n \"7032\",\r\n \"7033\",\r\n \"7034\",\r\n \"7035\",\r\n \"7036\",\r\n \"8000\",\r\n \"8001\",\r\n \"8002\",\r\n \"8003\",\r\n \"8004\",\r\n \"8005\",\r\n \"8006\",\r\n \"8007\",\r\n \"8008\",\r\n \"8009\",\r\n \"8010\",\r\n \"8011\",\r\n \"8012\",\r\n \"8013\",\r\n \"8015\",\r\n \"8016\",\r\n \"8017\",\r\n \"8018\",\r\n \"8020\",\r\n \"9002\",\r\n \"9003\",\r\n \"9004\",\r\n \"17000\",\r\n \"17001\",\r\n \"17002\",\r\n \"17003\",\r\n \"17004\",\r\n \"17005\",\r\n \"17006\",\r\n \"17007\",\r\n \"17008\",\r\n \"17009\",\r\n \"17010\",\r\n \"17011\",\r\n \"17012\",\r\n \"17013\",\r\n \"18000\",\r\n \"18001\",\r\n \"18002\",\r\n \"18003\",\r\n \"90009\",\r\n \"90010\"\r\n]\r\n[Trace - 3:38:50 PM] Sending request: getApplicableRefactors (4). Response expected: yes. Current queue length: 2\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"startLine\": 7,\r\n \"startOffset\": 5,\r\n \"endLine\": 7,\r\n \"endOffset\": 12\r\n}\r\n[Trace - 3:38:50 PM] Response received: getApplicableRefactors (4). Request took 706 ms. Success: true \r\nResult: []\r\n[Trace - 3:38:50 PM] Sending request: geterr (6). Response expected: no. Current queue length: 1\r\nArguments: {\r\n \"delay\": 0,\r\n \"files\": [\r\n \"/Users/matb/projects/san/y.js\"\r\n ]\r\n}\r\n[Trace - 3:38:50 PM] Sending request: navtree (7). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\"\r\n}\r\n[Trace - 3:38:50 PM] Response received: navtree (7). Request took 460 ms. Success: true \r\nResult: {\r\n \"text\": \"\u003cglobal>\",\r\n \"kind\": \"script\",\r\n \"kindModifiers\": \"\",\r\n \"spans\": [\r\n {\r\n \"start\": {\r\n \"line\": 1,\r\n \"offset\": 1\r\n },\r\n \"end\": {\r\n \"line\": 13,\r\n \"offset\": 11\r\n }\r\n }\r\n ],\r\n \"childItems\": [\r\n {\r\n \"text\": \"Foo\",\r\n \"kind\": \"class\",\r\n \"kindModifiers\": \"\",\r\n \"spans\": [\r\n {\r\n \"start\": {\r\n \"line\": 1,\r\n \"offset\": 1\r\n },\r\n \"end\": {\r\n \"line\": 10,\r\n \"offset\": 2\r\n }\r\n }\r\n ],\r\n \"childItems\": [\r\n {\r\n \"text\": \"constructor\",\r\n \"kind\": \"constructor\",\r\n \"kindModifiers\": \"\",\r\n \"spans\": [\r\n {\r\n \"start\": {\r\n \"line\": 2,\r\n \"offset\": 3\r\n },\r\n \"end\": {\r\n \"line\": 4,\r\n \"offset\": 4\r\n }\r\n }\r\n ]\r\n },\r\n {\r\n \"text\": \"z\",\r\n \"kind\": \"method\",\r\n \"kindModifiers\": \"\",\r\n \"spans\": [\r\n {\r\n \"start\": {\r\n \"line\": 6,\r\n \"offset\": 3\r\n },\r\n \"end\": {\r\n \"line\": 8,\r\n \"offset\": 4\r\n }\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n ]\r\n}\r\n[Trace - 3:38:50 PM] Event received: syntaxDiag (0).\r\nData: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"diagnostics\": []\r\n}\r\n[Trace - 3:38:50 PM] Event received: semanticDiag (0).\r\nData: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"diagnostics\": []\r\n}\r\n[Trace - 3:38:50 PM] Event received: requestCompleted (0).\r\nData: {\r\n \"request_seq\": 6\r\n}\r\n[Trace - 3:38:51 PM] Sending request: references (8). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"line\": 1,\r\n \"offset\": 7\r\n}\r\n[Trace - 3:38:51 PM] Response received: references (8). Request took 72 ms. Success: true \r\nResult: {\r\n \"refs\": [\r\n {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"start\": {\r\n \"line\": 1,\r\n \"offset\": 7\r\n },\r\n \"lineText\": \"class Foo {\",\r\n \"end\": {\r\n \"line\": 1,\r\n \"offset\": 10\r\n },\r\n \"isWriteAccess\": true,\r\n \"isDefinition\": true\r\n },\r\n {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"start\": {\r\n \"line\": 13,\r\n \"offset\": 5\r\n },\r\n \"lineText\": \"new Foo(1)\",\r\n \"end\": {\r\n \"line\": 13,\r\n \"offset\": 8\r\n },\r\n \"isWriteAccess\": false,\r\n \"isDefinition\": false\r\n }\r\n ],\r\n \"symbolName\": \"Foo\",\r\n \"symbolStartOffset\": 7,\r\n \"symbolDisplayString\": \"class Foo\"\r\n}\r\n[Trace - 3:38:51 PM] Sending request: references (9). Response expected: yes. Current queue length: 1\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"line\": 2,\r\n \"offset\": 3\r\n}\r\n[Trace - 3:38:51 PM] Response received: references (9). Request took 78 ms. Success: true \r\nResult: {\r\n \"refs\": [\r\n {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"start\": {\r\n \"line\": 2,\r\n \"offset\": 3\r\n },\r\n \"lineText\": \" constructor(x) {\",\r\n \"end\": {\r\n \"line\": 2,\r\n \"offset\": 14\r\n },\r\n \"isWriteAccess\": false,\r\n \"isDefinition\": false\r\n },\r\n {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"start\": {\r\n \"line\": 13,\r\n \"offset\": 5\r\n },\r\n \"lineText\": \"new Foo(1)\",\r\n \"end\": {\r\n \"line\": 13,\r\n \"offset\": 8\r\n },\r\n \"isWriteAccess\": false,\r\n \"isDefinition\": false\r\n }\r\n ],\r\n \"symbolName\": \"constructor\",\r\n \"symbolStartOffset\": 3,\r\n \"symbolDisplayString\": \"constructor Foo(x: any): Foo\"\r\n}\r\n[Trace - 3:38:51 PM] Sending request: references (10). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"line\": 6,\r\n \"offset\": 3\r\n}\r\n[Trace - 3:38:51 PM] Response received: references (10). Request took 95 ms. Success: true \r\nResult: {\r\n \"refs\": [\r\n {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"start\": {\r\n \"line\": 6,\r\n \"offset\": 3\r\n },\r\n \"lineText\": \" z() {\",\r\n \"end\": {\r\n \"line\": 6,\r\n \"offset\": 4\r\n },\r\n \"isWriteAccess\": true,\r\n \"isDefinition\": true\r\n }\r\n ],\r\n \"symbolName\": \"z\",\r\n \"symbolStartOffset\": 3,\r\n \"symbolDisplayString\": \"(method) Foo.z(): void\"\r\n}\r\n[Trace - 3:38:52 PM] Sending request: getApplicableRefactors (11). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"startLine\": 7,\r\n \"startOffset\": 1,\r\n \"endLine\": 7,\r\n \"endOffset\": 21\r\n}\r\n[Trace - 3:38:52 PM] Response received: getApplicableRefactors (11). Request took 4 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 class 'Foo'\",\r\n \"name\": \"scope_0\"\r\n },\r\n {\r\n \"description\": \"Extract function into global scope\",\r\n \"name\": \"scope_1\"\r\n }\r\n ]\r\n }\r\n]\r\n[Trace - 3:38:52 PM] Sending request: getApplicableRefactors (12). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"startLine\": 7,\r\n \"startOffset\": 1,\r\n \"endLine\": 7,\r\n \"endOffset\": 21\r\n}\r\n[Trace - 3:38:52 PM] Response received: getApplicableRefactors (12). 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 class 'Foo'\",\r\n \"name\": \"scope_0\"\r\n },\r\n {\r\n \"description\": \"Extract function into global scope\",\r\n \"name\": \"scope_1\"\r\n }\r\n ]\r\n }\r\n]\r\n[Trace - 3:38:54 PM] Sending request: configure (13). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"formatOptions\": {\r\n \"tabSize\": 2,\r\n \"indentSize\": 2,\r\n \"convertTabsToSpaces\": true,\r\n \"newLineCharacter\": \"\\n\",\r\n \"insertSpaceAfterCommaDelimiter\": true,\r\n \"insertSpaceAfterConstructor\": false,\r\n \"insertSpaceAfterSemicolonInForStatements\": true,\r\n \"insertSpaceBeforeAndAfterBinaryOperators\": true,\r\n \"insertSpaceAfterKeywordsInControlFlowStatements\": true,\r\n \"insertSpaceAfterFunctionKeywordForAnonymousFunctions\": true,\r\n \"insertSpaceBeforeFunctionParenthesis\": false,\r\n \"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis\": false,\r\n \"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets\": false,\r\n \"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces\": true,\r\n \"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces\": false,\r\n \"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces\": false,\r\n \"placeOpenBraceOnNewLineForFunctions\": false,\r\n \"placeOpenBraceOnNewLineForControlBlocks\": false\r\n }\r\n}\r\n[Trace - 3:38:54 PM] Response received: configure (13). Request took 1 ms. Success: true \r\n[Trace - 3:38:54 PM] Sending request: getEditsForRefactor (14). Response expected: yes. Current queue length: 0\r\nArguments: {\r\n \"file\": \"/Users/matb/projects/san/y.js\",\r\n \"startLine\": 7,\r\n \"startOffset\": 1,\r\n \"endLine\": 7,\r\n \"endOffset\": 21,\r\n \"refactor\": \"Extract Method\",\r\n \"action\": \"scope_0\"\r\n}\r\n[Trace - 3:38:54 PM] Response received: getEditsForRefactor (14). Request took 31 ms. Success: false . Message: Error processing request. Debug Failure. False expression.\r\nError: Debug Failure. False expression.\r\n at getPos (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72306:22)\r\n at assignPositionsToNodeArray (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72745:29)\r\n at Object.visitEachChild (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:42481:102)\r\n at assignPositionsToNode (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72733:30)\r\n at getNonformattedText (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72709:52)\r\n at ChangeTracker.getFormattedTextOfNode (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72676:40)\r\n at ChangeTracker.computeNewText (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72670:33)\r\n at /Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72645:44\r\n at Map.forEach (native)\r\n at ChangeTracker.getChanges (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72638:32)\r\n at extractFunctionInScope (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:75053:43)\r\n at getExtractionAtIndex (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:74887:24)\r\n at Object.getEditsForAction (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:74589:24)\r\n at Object.getEditsForRefactor (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72895:41)\r\n at Object.getEditsForRefactor (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:76736:32)\r\n at IOSession.Session.getEditsForRefactor (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82565:59)\r\n at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:81531:61)\r\n at /Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82741:88\r\n at IOSession.Session.executeWithRequestId (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82732:28)\r\n at IOSession.Session.executeCommand (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82741:33)\r\n at IOSession.Session.onMessage (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82761:35)\r\n at Interface.\u003canonymous> (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:83887:27)\r\n at emitOne (events.js:96:13)\r\n at Interface.emit (events.js:191:7)\r\n at Interface._onLine (readline.js:241:10)\r\n at Interface._normalWrite (readline.js:384:12)\r\n at Socket.ondata (readline.js:101:10)\r\n at emitOne (events.js:96:13)\r\n at Socket.emit (events.js:191:7)\r\n at readableAddChunk (_stream_readable.js:178:18)\r\n at Socket.Readable.push (_stream_readable.js:136:10)\r\n at Pipe.onread (net.js:560:20)\r\n[Error - 3:38:54 PM] 'getEditsForRefactor' request failed with error.\r\nError processing request. Debug Failure. False expression.\r\nError: Debug Failure. False expression.\r\n at getPos (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72306:22)\r\n at assignPositionsToNodeArray (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72745:29)\r\n at Object.visitEachChild (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:42481:102)\r\n at assignPositionsToNode (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72733:30)\r\n at getNonformattedText (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72709:52)\r\n at ChangeTracker.getFormattedTextOfNode (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72676:40)\r\n at ChangeTracker.computeNewText (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72670:33)\r\n at /Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72645:44\r\n at Map.forEach (native)\r\n at ChangeTracker.getChanges (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72638:32)\r\n at extractFunctionInScope (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:75053:43)\r\n at getExtractionAtIndex (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:74887:24)\r\n at Object.getEditsForAction (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:74589:24)\r\n at Object.getEditsForRefactor (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:72895:41)\r\n at Object.getEditsForRefactor (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:76736:32)\r\n at IOSession.Session.getEditsForRefactor (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82565:59)\r\n at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:81531:61)\r\n at /Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82741:88\r\n at IOSession.Session.executeWithRequestId (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82732:28)\r\n at IOSession.Session.executeCommand (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82741:33)\r\n at IOSession.Session.onMessage (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:82761:35)\r\n at Interface.\u003canonymous> (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:83887:27)\r\n at emitOne (events.js:96:13)\r\n at Interface.emit (events.js:191:7)\r\n at Interface._onLine (readline.js:241:10)\r\n at Interface._normalWrite (readline.js:384:12)\r\n at Socket.ondata (readline.js:101:10)\r\n at emitOne (events.js:96:13)\r\n at Socket.emit (events.js:191:7)\r\n at readableAddChunk (_stream_readable.js:178:18)\r\n at Socket.Readable.push (_stream_readable.js:136:10)\r\n at Pipe.onread (net.js:560:20)\r\n```","author":{"url":"https://github.com/mjbvz","@type":"Person","name":"mjbvz"},"datePublished":"2017-09-21T22:44:02Z","url":"https://github.com/microsoft/TypeScript/issues/18671"}
| 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:e9ffadff-e464-5c50-c0ed-9caf9f93e5c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA50:1CEA6F:AD9EF4:E72152:6B00EB5F |
| html-safe-nonce | 22f414803c97e022c34a4c2a8de4b90164f42926937aac9f55672bec612dcf68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTUwOjFDRUE2RjpBRDlFRjQ6RTcyMTUyOjZCMDBFQjVGIiwidmlzaXRvcl9pZCI6IjczNzM3NzI3NDQxNTg2ODc2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 468131857df3db01d1359e0c27bc7404da12ed3cc3e395722387c0381cd23d9f |
| hovercard-subject-tag | issue:259654067 |
| 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/18671/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4268e91904641dd66a18c0546f6ae38b218dee7485a6b5c24130e0802d6c1452/microsoft/TypeScript/issues/18671 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4268e91904641dd66a18c0546f6ae38b218dee7485a6b5c24130e0802d6c1452/microsoft/TypeScript/issues/18671 |
| og:image:alt | TypeScript Version: 2.5.3-insiders Code While investigating #18328 For the JavaScript file: class Foo { constructor(x) { this.x = x; } z() { console.log('1') } } Try to extract the line console.log... |
| 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 | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width