@zzzen/pyright-internal 1.2.0-dev.20230205 → 1.2.0-dev.20230219

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/analyzer/backgroundAnalysisProgram.d.ts +1 -0
  2. package/dist/analyzer/backgroundAnalysisProgram.js +5 -0
  3. package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
  4. package/dist/analyzer/checker.js +8 -5
  5. package/dist/analyzer/checker.js.map +1 -1
  6. package/dist/analyzer/commentUtils.d.ts +6 -1
  7. package/dist/analyzer/commentUtils.js +100 -25
  8. package/dist/analyzer/commentUtils.js.map +1 -1
  9. package/dist/analyzer/constraintSolver.js +83 -67
  10. package/dist/analyzer/constraintSolver.js.map +1 -1
  11. package/dist/analyzer/dataClasses.js +9 -2
  12. package/dist/analyzer/dataClasses.js.map +1 -1
  13. package/dist/analyzer/declaration.d.ts +1 -0
  14. package/dist/analyzer/declaration.js.map +1 -1
  15. package/dist/analyzer/importStatementUtils.d.ts +1 -0
  16. package/dist/analyzer/importStatementUtils.js +14 -1
  17. package/dist/analyzer/importStatementUtils.js.map +1 -1
  18. package/dist/analyzer/parameterUtils.d.ts +2 -0
  19. package/dist/analyzer/parameterUtils.js +20 -0
  20. package/dist/analyzer/parameterUtils.js.map +1 -0
  21. package/dist/analyzer/parseTreeUtils.d.ts +6 -2
  22. package/dist/analyzer/parseTreeUtils.js +52 -14
  23. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  24. package/dist/analyzer/parseTreeWalker.d.ts +1 -1
  25. package/dist/analyzer/patternMatching.js +25 -5
  26. package/dist/analyzer/patternMatching.js.map +1 -1
  27. package/dist/analyzer/program.d.ts +9 -2
  28. package/dist/analyzer/program.js +106 -8
  29. package/dist/analyzer/program.js.map +1 -1
  30. package/dist/analyzer/service.d.ts +1 -4
  31. package/dist/analyzer/service.js +16 -36
  32. package/dist/analyzer/service.js.map +1 -1
  33. package/dist/analyzer/sourceFile.d.ts +4 -0
  34. package/dist/analyzer/sourceFile.js +82 -16
  35. package/dist/analyzer/sourceFile.js.map +1 -1
  36. package/dist/analyzer/testWalker.js +23 -15
  37. package/dist/analyzer/testWalker.js.map +1 -1
  38. package/dist/analyzer/typeEvaluator.js +122 -71
  39. package/dist/analyzer/typeEvaluator.js.map +1 -1
  40. package/dist/analyzer/typeEvaluatorTypes.d.ts +2 -1
  41. package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
  42. package/dist/analyzer/typePrinter.d.ts +2 -1
  43. package/dist/analyzer/typePrinter.js +13 -0
  44. package/dist/analyzer/typePrinter.js.map +1 -1
  45. package/dist/analyzer/typeUtils.d.ts +1 -1
  46. package/dist/analyzer/typeUtils.js +189 -142
  47. package/dist/analyzer/typeUtils.js.map +1 -1
  48. package/dist/analyzer/typeVarContext.d.ts +31 -14
  49. package/dist/analyzer/typeVarContext.js +158 -79
  50. package/dist/analyzer/typeVarContext.js.map +1 -1
  51. package/dist/analyzer/types.d.ts +2 -1
  52. package/dist/analyzer/types.js +1 -0
  53. package/dist/analyzer/types.js.map +1 -1
  54. package/dist/backgroundAnalysisBase.d.ts +2 -1
  55. package/dist/backgroundAnalysisBase.js +15 -1
  56. package/dist/backgroundAnalysisBase.js.map +1 -1
  57. package/dist/backgroundThreadBase.js +1 -0
  58. package/dist/backgroundThreadBase.js.map +1 -1
  59. package/dist/common/commandLineOptions.d.ts +2 -0
  60. package/dist/common/commandLineOptions.js.map +1 -1
  61. package/dist/common/configOptions.d.ts +3 -0
  62. package/dist/common/configOptions.js +10 -1
  63. package/dist/common/configOptions.js.map +1 -1
  64. package/dist/common/core.d.ts +2 -0
  65. package/dist/common/core.js +9 -1
  66. package/dist/common/core.js.map +1 -1
  67. package/dist/common/diagnostic.d.ts +15 -3
  68. package/dist/common/diagnostic.js +13 -4
  69. package/dist/common/diagnostic.js.map +1 -1
  70. package/dist/common/editAction.d.ts +1 -0
  71. package/dist/common/editAction.js +8 -0
  72. package/dist/common/editAction.js.map +1 -1
  73. package/dist/common/extensibility.d.ts +34 -11
  74. package/dist/common/extensibility.js +63 -18
  75. package/dist/common/extensibility.js.map +1 -1
  76. package/dist/common/pathUtils.d.ts +3 -0
  77. package/dist/common/pathUtils.js +18 -0
  78. package/dist/common/pathUtils.js.map +1 -1
  79. package/dist/common/textEditUtils.d.ts +26 -9
  80. package/dist/common/textEditUtils.js +218 -41
  81. package/dist/common/textEditUtils.js.map +1 -1
  82. package/dist/common/textRangeCollection.d.ts +1 -0
  83. package/dist/common/textRangeCollection.js +54 -20
  84. package/dist/common/textRangeCollection.js.map +1 -1
  85. package/dist/languageServerBase.d.ts +3 -0
  86. package/dist/languageServerBase.js +90 -1
  87. package/dist/languageServerBase.js.map +1 -1
  88. package/dist/languageService/analyzerServiceExecutor.js +1 -0
  89. package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
  90. package/dist/languageService/completionProvider.js +13 -7
  91. package/dist/languageService/completionProvider.js.map +1 -1
  92. package/dist/languageService/definitionProvider.js +1 -1
  93. package/dist/languageService/definitionProvider.js.map +1 -1
  94. package/dist/languageService/documentSymbolCollector.js +1 -1
  95. package/dist/languageService/documentSymbolCollector.js.map +1 -1
  96. package/dist/languageService/hoverProvider.js +10 -6
  97. package/dist/languageService/hoverProvider.js.map +1 -1
  98. package/dist/languageService/importAdder.d.ts +4 -0
  99. package/dist/languageService/importAdder.js +50 -13
  100. package/dist/languageService/importAdder.js.map +1 -1
  101. package/dist/languageService/insertionPointUtils.js +28 -7
  102. package/dist/languageService/insertionPointUtils.js.map +1 -1
  103. package/dist/languageService/renameModuleProvider.d.ts +12 -10
  104. package/dist/languageService/renameModuleProvider.js +240 -229
  105. package/dist/languageService/renameModuleProvider.js.map +1 -1
  106. package/dist/languageService/signatureHelpProvider.js +20 -3
  107. package/dist/languageService/signatureHelpProvider.js.map +1 -1
  108. package/dist/languageService/tooltipUtils.js +1 -1
  109. package/dist/languageService/tooltipUtils.js.map +1 -1
  110. package/dist/localization/localize.d.ts +10 -1
  111. package/dist/localization/localize.js +6 -1
  112. package/dist/localization/localize.js.map +1 -1
  113. package/dist/localization/package.nls.en-us.json +8 -2
  114. package/dist/tests/checker.test.js +5 -0
  115. package/dist/tests/checker.test.js.map +1 -1
  116. package/dist/tests/fourslash/completions.params.fourslash.js +37 -0
  117. package/dist/tests/fourslash/completions.params.fourslash.js.map +1 -1
  118. package/dist/tests/fourslash/hover.inferred.fourslash.d.ts +1 -0
  119. package/dist/tests/fourslash/hover.inferred.fourslash.js +24 -0
  120. package/dist/tests/fourslash/hover.inferred.fourslash.js.map +1 -0
  121. package/dist/tests/fourslash/signature.complicated.fourslash.js +31 -1
  122. package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -1
  123. package/dist/tests/hoverProvider.test.js +27 -0
  124. package/dist/tests/hoverProvider.test.js.map +1 -1
  125. package/dist/tests/importAdder.test.js +39 -2
  126. package/dist/tests/importAdder.test.js.map +1 -1
  127. package/dist/tests/insertionPointUtils.test.js +70 -3
  128. package/dist/tests/insertionPointUtils.test.js.map +1 -1
  129. package/dist/tests/{updateSymbolReference.test.d.ts → moveSymbol.importAdder.test.d.ts} +0 -0
  130. package/dist/tests/moveSymbol.importAdder.test.js +139 -0
  131. package/dist/tests/moveSymbol.importAdder.test.js.map +1 -0
  132. package/dist/tests/moveSymbol.insertion.test.d.ts +1 -0
  133. package/dist/tests/moveSymbol.insertion.test.js +360 -0
  134. package/dist/tests/moveSymbol.insertion.test.js.map +1 -0
  135. package/dist/tests/moveSymbol.misc.test.d.ts +1 -0
  136. package/dist/tests/moveSymbol.misc.test.js +37 -0
  137. package/dist/tests/moveSymbol.misc.test.js.map +1 -0
  138. package/dist/tests/moveSymbol.updateReference.test.d.ts +1 -0
  139. package/dist/tests/{updateSymbolReference.test.js → moveSymbol.updateReference.test.js} +235 -158
  140. package/dist/tests/moveSymbol.updateReference.test.js.map +1 -0
  141. package/dist/tests/parseTreeUtils.test.js +36 -13
  142. package/dist/tests/parseTreeUtils.test.js.map +1 -1
  143. package/dist/tests/renameModuleTestUtils.js +9 -3
  144. package/dist/tests/renameModuleTestUtils.js.map +1 -1
  145. package/dist/tests/testStateUtils.d.ts +2 -0
  146. package/dist/tests/testStateUtils.js +25 -22
  147. package/dist/tests/testStateUtils.js.map +1 -1
  148. package/dist/tests/textEditUtil.test.d.ts +1 -0
  149. package/dist/tests/textEditUtil.test.js +107 -0
  150. package/dist/tests/textEditUtil.test.js.map +1 -0
  151. package/dist/tests/typeEvaluator1.test.js +4 -0
  152. package/dist/tests/typeEvaluator1.test.js.map +1 -1
  153. package/dist/tests/typeEvaluator3.test.js +2 -2
  154. package/dist/tests/typeEvaluator3.test.js.map +1 -1
  155. package/dist/tests/typeEvaluator4.test.js +10 -2
  156. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  157. package/dist/workspaceMap.d.ts +0 -1
  158. package/dist/workspaceMap.js +0 -11
  159. package/dist/workspaceMap.js.map +1 -1
  160. package/package.json +1 -1
  161. package/dist/tests/updateSymbolReference.test.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * moveSymbolAtPosition.test.ts
3
+ * moveSymbol.updateReference.test.ts
4
4
  * Copyright (c) Microsoft Corporation.
5
5
  * Licensed under the MIT license.
6
6
  *
@@ -12,10 +12,10 @@ const renameModuleTestUtils_1 = require("./renameModuleTestUtils");
12
12
  test('move symbol to another file - simple from import', () => {
13
13
  const code = `
14
14
  // @filename: test.py
15
- //// def [|/*marker*/foo|](): pass
15
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
16
16
 
17
17
  // @filename: moved.py
18
- //// [|/*dest*/|]
18
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
19
19
 
20
20
  // @filename: used.py
21
21
  //// from [|{|"r":"moved"|}test|] import foo
@@ -25,10 +25,10 @@ test('move symbol to another file - simple from import', () => {
25
25
  test('move symbol to another file - nested file', () => {
26
26
  const code = `
27
27
  // @filename: test.py
28
- //// def [|/*marker*/foo|](): pass
28
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
29
29
 
30
30
  // @filename: nested/moved.py
31
- //// [|/*dest*/|]
31
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
32
32
 
33
33
  // @filename: used.py
34
34
  //// from [|{|"r":"nested.moved"|}test|] import foo
@@ -38,10 +38,10 @@ test('move symbol to another file - nested file', () => {
38
38
  test('move symbol to another file - parent file', () => {
39
39
  const code = `
40
40
  // @filename: nested/test.py
41
- //// def [|/*marker*/foo|](): pass
41
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
42
42
 
43
43
  // @filename: moved.py
44
- //// [|/*dest*/|]
44
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
45
45
 
46
46
  // @filename: used.py
47
47
  //// from [|{|"r":"moved"|}nested.test|] import foo
@@ -51,12 +51,12 @@ test('move symbol to another file - parent file', () => {
51
51
  test('move symbol to another file - multiple import', () => {
52
52
  const code = `
53
53
  // @filename: test.py
54
- //// def [|/*marker*/foo|](): pass
54
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
55
55
  ////
56
- //// def stay(): pass
56
+ //// |]def stay(): pass
57
57
 
58
58
  // @filename: moved.py
59
- //// [|/*dest*/|]
59
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
60
60
 
61
61
  // @filename: used.py
62
62
  //// [|{|"r":"from moved import foo!n!"|}|]from test import [|{|"r":""|}foo, |]stay
@@ -66,13 +66,13 @@ test('move symbol to another file - multiple import', () => {
66
66
  test('move symbol to another file - multiple import with submodules', () => {
67
67
  const code = `
68
68
  // @filename: nested/__init__.py
69
- //// def [|/*marker*/foo|](): pass
69
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
70
70
 
71
71
  // @filename: nested/test.py
72
72
  //// # empty
73
73
 
74
74
  // @filename: moved.py
75
- //// [|/*dest*/|]
75
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
76
76
 
77
77
  // @filename: used.py
78
78
  //// [|{|"r":"from moved import foo!n!"|}|]from nested import [|{|"r":""|}foo, |]test
@@ -82,11 +82,10 @@ test('move symbol to another file - multiple import with submodules', () => {
82
82
  test('move symbol to another file - no merge with existing imports', () => {
83
83
  const code = `
84
84
  // @filename: test.py
85
- //// def [|/*marker*/foo|](): pass
85
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
86
86
 
87
87
  // @filename: moved.py
88
- //// [|/*dest*/|]
89
- //// def stay(): pass
88
+ //// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|]
90
89
 
91
90
  // @filename: used.py
92
91
  //// from [|{|"r":"moved"|}test|] import foo
@@ -97,12 +96,11 @@ test('move symbol to another file - no merge with existing imports', () => {
97
96
  test('move symbol to another file - merge with existing imports', () => {
98
97
  const code = `
99
98
  // @filename: test.py
100
- //// def [|/*marker*/foo|](): pass
101
- //// def bar(): pass
99
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
100
+ //// |]def bar(): pass
102
101
 
103
102
  // @filename: moved.py
104
- //// [|/*dest*/|]
105
- //// def stay(): pass
103
+ //// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|]
106
104
 
107
105
  // @filename: used.py
108
106
  //// from test import bar[|{|"r":""|}, foo|]
@@ -113,12 +111,12 @@ test('move symbol to another file - merge with existing imports', () => {
113
111
  test('move symbol to another file - multiple import - nested folder', () => {
114
112
  const code = `
115
113
  // @filename: test.py
116
- //// def [|/*marker*/foo|](): pass
114
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
117
115
  ////
118
- //// def stay(): pass
116
+ //// |]def stay(): pass
119
117
 
120
118
  // @filename: nested/moved.py
121
- //// [|/*dest*/|]
119
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
122
120
 
123
121
  // @filename: used.py
124
122
  //// [|{|"r":"from nested.moved import foo!n!"|}|]from test import [|{|"r":""|}foo, |]stay
@@ -128,13 +126,13 @@ test('move symbol to another file - multiple import - nested folder', () => {
128
126
  test('move symbol to another file - multiple import with submodules - parent folder', () => {
129
127
  const code = `
130
128
  // @filename: nested/__init__.py
131
- //// def [|/*marker*/foo|](): pass
129
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
132
130
 
133
131
  // @filename: nested/test.py
134
132
  //// # empty
135
133
 
136
134
  // @filename: moved.py
137
- //// [|/*dest*/|]
135
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
138
136
 
139
137
  // @filename: used.py
140
138
  //// [|{|"r":"from moved import foo!n!"|}|]from nested import [|{|"r":""|}foo, |]test
@@ -144,11 +142,10 @@ test('move symbol to another file - multiple import with submodules - parent fol
144
142
  test('move symbol to another file - no merge with existing imports - nested folder', () => {
145
143
  const code = `
146
144
  // @filename: test.py
147
- //// def [|/*marker*/foo|](): pass
145
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
148
146
 
149
147
  // @filename: nested/moved.py
150
- //// [|/*dest*/|]
151
- //// def stay(): pass
148
+ //// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|]
152
149
 
153
150
  // @filename: used.py
154
151
  //// from [|{|"r":"nested.moved"|}test|] import foo
@@ -159,12 +156,11 @@ test('move symbol to another file - no merge with existing imports - nested fold
159
156
  test('move symbol to another file - merge with existing imports - nested folder', () => {
160
157
  const code = `
161
158
  // @filename: test.py
162
- //// def [|/*marker*/foo|](): pass
163
- //// def bar(): pass
159
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
160
+ //// |]def bar(): pass
164
161
 
165
162
  // @filename: nested/moved.py
166
- //// [|/*dest*/|]
167
- //// def stay(): pass
163
+ //// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|]
168
164
 
169
165
  // @filename: used.py
170
166
  //// from test import bar[|{|"r":""|}, foo|]
@@ -175,12 +171,12 @@ test('move symbol to another file - merge with existing imports - nested folder'
175
171
  test('move symbol to another file - multiple import - parent folder', () => {
176
172
  const code = `
177
173
  // @filename: nested/test.py
178
- //// def [|/*marker*/foo|](): pass
174
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
179
175
  ////
180
- //// def stay(): pass
176
+ //// |]def stay(): pass
181
177
 
182
178
  // @filename: moved.py
183
- //// [|/*dest*/|]
179
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
184
180
 
185
181
  // @filename: used.py
186
182
  //// [|{|"r":"from moved import foo!n!"|}|]from nested.test import [|{|"r":""|}foo, |]stay
@@ -190,13 +186,13 @@ test('move symbol to another file - multiple import - parent folder', () => {
190
186
  test('move symbol to another file - multiple import with submodules - sibling folder', () => {
191
187
  const code = `
192
188
  // @filename: nested/__init__.py
193
- //// def [|/*marker*/foo|](): pass
189
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
194
190
 
195
191
  // @filename: nested/test.py
196
192
  //// # empty
197
193
 
198
194
  // @filename: nested/moved.py
199
- //// [|/*dest*/|]
195
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
200
196
 
201
197
  // @filename: used.py
202
198
  //// from nested import [|{|"r":""|}foo, |]test[|{|"r":"!n!from nested.moved import foo"|}|]
@@ -206,11 +202,10 @@ test('move symbol to another file - multiple import with submodules - sibling fo
206
202
  test('move symbol to another file - no merge with existing imports - parent folder', () => {
207
203
  const code = `
208
204
  // @filename: nested/test.py
209
- //// def [|/*marker*/foo|](): pass
205
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
210
206
 
211
207
  // @filename: moved.py
212
- //// [|/*dest*/|]
213
- //// def stay(): pass
208
+ //// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|]
214
209
 
215
210
  // @filename: used.py
216
211
  //// from [|{|"r":"moved"|}nested.test|] import foo
@@ -221,12 +216,11 @@ test('move symbol to another file - no merge with existing imports - parent fold
221
216
  test('move symbol to another file - merge with existing imports - parent folder', () => {
222
217
  const code = `
223
218
  // @filename: nested/test.py
224
- //// def [|/*marker*/foo|](): pass
225
- //// def bar(): pass
219
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
220
+ //// |]def bar(): pass
226
221
 
227
222
  // @filename: moved.py
228
- //// [|/*dest*/|]
229
- //// def stay(): pass
223
+ //// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|]
230
224
 
231
225
  // @filename: used.py
232
226
  //// from nested.test import bar[|{|"r":""|}, foo|]
@@ -237,10 +231,10 @@ test('move symbol to another file - merge with existing imports - parent folder'
237
231
  test('move symbol to another file - simple from import - relative path', () => {
238
232
  const code = `
239
233
  // @filename: test.py
240
- //// def [|/*marker*/foo|](): pass
234
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
241
235
 
242
236
  // @filename: moved.py
243
- //// [|/*dest*/|]
237
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
244
238
 
245
239
  // @filename: used.py
246
240
  //// from [|{|"r":".moved"|}.test|] import foo
@@ -250,10 +244,10 @@ test('move symbol to another file - simple from import - relative path', () => {
250
244
  test('move symbol to another file - nested file - relative path', () => {
251
245
  const code = `
252
246
  // @filename: test.py
253
- //// def [|/*marker*/foo|](): pass
247
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
254
248
 
255
249
  // @filename: nested/moved.py
256
- //// [|/*dest*/|]
250
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
257
251
 
258
252
  // @filename: nested/used.py
259
253
  //// from [|{|"r":".moved"|}..test|] import foo
@@ -263,10 +257,10 @@ test('move symbol to another file - nested file - relative path', () => {
263
257
  test('move symbol to another file - parent file - relative path', () => {
264
258
  const code = `
265
259
  // @filename: nested/test.py
266
- //// def [|/*marker*/foo|](): pass
260
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
267
261
 
268
262
  // @filename: moved.py
269
- //// [|/*dest*/|]
263
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
270
264
 
271
265
  // @filename: used.py
272
266
  //// from [|{|"r":".moved"|}.nested.test|] import foo
@@ -276,12 +270,12 @@ test('move symbol to another file - parent file - relative path', () => {
276
270
  test('move symbol to another file - multiple import - relative path', () => {
277
271
  const code = `
278
272
  // @filename: test.py
279
- //// def [|/*marker*/foo|](): pass
273
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
280
274
  ////
281
- //// def stay(): pass
275
+ //// |]def stay(): pass
282
276
 
283
277
  // @filename: moved.py
284
- //// [|/*dest*/|]
278
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
285
279
 
286
280
  // @filename: nested/used.py
287
281
  //// [|{|"r":"from ..moved import foo!n!"|}|]from ..test import [|{|"r":""|}foo, |]stay
@@ -291,13 +285,13 @@ test('move symbol to another file - multiple import - relative path', () => {
291
285
  test('move symbol to another file - multiple import with submodules - relative path', () => {
292
286
  const code = `
293
287
  // @filename: nested/__init__.py
294
- //// def [|/*marker*/foo|](): pass
288
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
295
289
 
296
290
  // @filename: nested/test.py
297
291
  //// # empty
298
292
 
299
293
  // @filename: moved.py
300
- //// [|/*dest*/|]
294
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
301
295
 
302
296
  // @filename: used.py
303
297
  //// [|{|"r":"from .moved import foo!n!"|}|]from .nested import [|{|"r":""|}foo, |]test
@@ -307,11 +301,10 @@ test('move symbol to another file - multiple import with submodules - relative p
307
301
  test('move symbol to another file - no merge with existing imports - relative path', () => {
308
302
  const code = `
309
303
  // @filename: test.py
310
- //// def [|/*marker*/foo|](): pass
304
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
311
305
 
312
306
  // @filename: moved.py
313
- //// [|/*dest*/|]
314
- //// def stay(): pass
307
+ //// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|]
315
308
 
316
309
  // @filename: used.py
317
310
  //// from [|{|"r":".moved"|}.test|] import foo
@@ -322,12 +315,11 @@ test('move symbol to another file - no merge with existing imports - relative pa
322
315
  test('move symbol to another file - merge with existing imports - relative path', () => {
323
316
  const code = `
324
317
  // @filename: test.py
325
- //// def [|/*marker*/foo|](): pass
326
- //// def bar(): pass
318
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
319
+ //// |]def bar(): pass
327
320
 
328
321
  // @filename: moved.py
329
- //// [|/*dest*/|]
330
- //// def stay(): pass
322
+ //// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|]
331
323
 
332
324
  // @filename: used.py
333
325
  //// from .test import bar[|{|"r":""|}, foo|]
@@ -338,10 +330,10 @@ test('move symbol to another file - merge with existing imports - relative path'
338
330
  test('member off import', () => {
339
331
  const code = `
340
332
  // @filename: test.py
341
- //// def [|/*marker*/foo|](): pass
333
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
342
334
 
343
335
  // @filename: moved.py
344
- //// [|/*dest*/|]
336
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
345
337
 
346
338
  // @filename: used.py
347
339
  //// import [|{|"r":"moved"|}test|]
@@ -352,10 +344,10 @@ test('member off import', () => {
352
344
  test('member off import with existing import', () => {
353
345
  const code = `
354
346
  // @filename: test.py
355
- //// def [|/*marker*/foo|](): pass
347
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
356
348
 
357
349
  // @filename: moved.py
358
- //// [|/*dest*/|]
350
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
359
351
 
360
352
  // @filename: used.py
361
353
  //// [|{|"r":""|}import test
@@ -367,10 +359,10 @@ test('member off import with existing import', () => {
367
359
  test('member off import with existing import with alias', () => {
368
360
  const code = `
369
361
  // @filename: test.py
370
- //// def [|/*marker*/foo|](): pass
362
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
371
363
 
372
364
  // @filename: moved.py
373
- //// [|/*dest*/|]
365
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
374
366
 
375
367
  // @filename: used.py
376
368
  //// [|{|"r":""|}import test
@@ -382,10 +374,10 @@ test('member off import with existing import with alias', () => {
382
374
  test('member off import with existing import - multiple imports', () => {
383
375
  const code = `
384
376
  // @filename: test.py
385
- //// def [|/*marker*/foo|](): pass
377
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
386
378
 
387
379
  // @filename: moved.py
388
- //// [|/*dest*/|]
380
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
389
381
 
390
382
  // @filename: used.py
391
383
  //// import moved[|{|"r":""|}, test|]
@@ -396,10 +388,10 @@ test('member off import with existing import - multiple imports', () => {
396
388
  test('member off import with existing import - multiple imports with alias', () => {
397
389
  const code = `
398
390
  // @filename: test.py
399
- //// def [|/*marker*/foo|](): pass
391
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
400
392
 
401
393
  // @filename: moved.py
402
- //// [|/*dest*/|]
394
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
403
395
 
404
396
  // @filename: used.py
405
397
  //// import moved as m[|{|"r":""|}, test|]
@@ -410,10 +402,10 @@ test('member off import with existing import - multiple imports with alias', ()
410
402
  test('member off from import with existing import', () => {
411
403
  const code = `
412
404
  // @filename: test.py
413
- //// def [|/*marker*/foo|](): pass
405
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
414
406
 
415
407
  // @filename: moved.py
416
- //// [|/*dest*/|]
408
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
417
409
 
418
410
  // @filename: used.py
419
411
  //// [|{|"r":""|}from . import test
@@ -425,10 +417,10 @@ test('member off from import with existing import', () => {
425
417
  test('member off from import with existing import with alias', () => {
426
418
  const code = `
427
419
  // @filename: test.py
428
- //// def [|/*marker*/foo|](): pass
420
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
429
421
 
430
422
  // @filename: moved.py
431
- //// [|/*dest*/|]
423
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
432
424
 
433
425
  // @filename: used.py
434
426
  //// [|{|"r":""|}from . import test
@@ -440,10 +432,10 @@ test('member off from import with existing import with alias', () => {
440
432
  test('member off from import with existing from import', () => {
441
433
  const code = `
442
434
  // @filename: test.py
443
- //// def [|/*marker*/foo|](): pass
435
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
444
436
 
445
437
  // @filename: moved.py
446
- //// [|/*dest*/|]
438
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
447
439
 
448
440
  // @filename: used.py
449
441
  //// [|{|"r":""|}from . import test
@@ -455,10 +447,10 @@ test('member off from import with existing from import', () => {
455
447
  test('member off from import with existing from import with alias', () => {
456
448
  const code = `
457
449
  // @filename: test.py
458
- //// def [|/*marker*/foo|](): pass
450
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
459
451
 
460
452
  // @filename: moved.py
461
- //// [|/*dest*/|]
453
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
462
454
 
463
455
  // @filename: used.py
464
456
  //// [|{|"r":""|}from . import test
@@ -470,10 +462,10 @@ test('member off from import with existing from import with alias', () => {
470
462
  test('member off from import with existing import - multiple imports', () => {
471
463
  const code = `
472
464
  // @filename: test.py
473
- //// def [|/*marker*/foo|](): pass
465
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
474
466
 
475
467
  // @filename: moved.py
476
- //// [|/*dest*/|]
468
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
477
469
 
478
470
  // @filename: used.py
479
471
  //// from . import moved[|{|"r":""|}, test|]
@@ -484,10 +476,10 @@ test('member off from import with existing import - multiple imports', () => {
484
476
  test('member off from import with existing import - multiple imports with alias', () => {
485
477
  const code = `
486
478
  // @filename: test.py
487
- //// def [|/*marker*/foo|](): pass
479
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
488
480
 
489
481
  // @filename: moved.py
490
- //// [|/*dest*/|]
482
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
491
483
 
492
484
  // @filename: used.py
493
485
  //// from . import moved as m[|{|"r":""|}, test|]
@@ -498,10 +490,10 @@ test('member off from import with existing import - multiple imports with alias'
498
490
  test('member off submodule', () => {
499
491
  const code = `
500
492
  // @filename: test.py
501
- //// def [|/*marker*/foo|](): pass
493
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
502
494
 
503
495
  // @filename: moved.py
504
- //// [|/*dest*/|]
496
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
505
497
 
506
498
  // @filename: used.py
507
499
  //// from . import [|{|"r":"moved"|}test|]
@@ -512,10 +504,10 @@ test('member off submodule', () => {
512
504
  test('member off import - dotted name', () => {
513
505
  const code = `
514
506
  // @filename: test.py
515
- //// def [|/*marker*/foo|](): pass
507
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
516
508
 
517
509
  // @filename: nested/moved.py
518
- //// [|/*dest*/|]
510
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
519
511
 
520
512
  // @filename: used.py
521
513
  //// import [|{|"r":"nested.moved"|}test|]
@@ -526,10 +518,10 @@ test('member off import - dotted name', () => {
526
518
  test('member off submodule - dotted name', () => {
527
519
  const code = `
528
520
  // @filename: test.py
529
- //// def [|/*marker*/foo|](): pass
521
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
530
522
 
531
523
  // @filename: nested/moved.py
532
- //// [|/*dest*/|]
524
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
533
525
 
534
526
  // @filename: used.py
535
527
  //// from [|{|"r":".nested"|}.|] import [|{|"r":"moved"|}test|]
@@ -540,10 +532,10 @@ test('member off submodule - dotted name', () => {
540
532
  test('member off import with alias', () => {
541
533
  const code = `
542
534
  // @filename: test.py
543
- //// def [|/*marker*/foo|](): pass
535
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
544
536
 
545
537
  // @filename: moved.py
546
- //// [|/*dest*/|]
538
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
547
539
 
548
540
  // @filename: used.py
549
541
  //// import [|{|"r":"moved"|}test|] as t
@@ -554,10 +546,10 @@ test('member off import with alias', () => {
554
546
  test('member off submodule with alias', () => {
555
547
  const code = `
556
548
  // @filename: test.py
557
- //// def [|/*marker*/foo|](): pass
549
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
558
550
 
559
551
  // @filename: moved.py
560
- //// [|/*dest*/|]
552
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
561
553
 
562
554
  // @filename: used.py
563
555
  //// from . import [|{|"r":"moved"|}test|] as test
@@ -568,10 +560,10 @@ test('member off submodule with alias', () => {
568
560
  test('member off import with alias - dotted name', () => {
569
561
  const code = `
570
562
  // @filename: test.py
571
- //// def [|/*marker*/foo|](): pass
563
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
572
564
 
573
565
  // @filename: nested/moved.py
574
- //// [|/*dest*/|]
566
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
575
567
 
576
568
  // @filename: used.py
577
569
  //// import [|{|"r":"nested.moved"|}test|] as t
@@ -582,10 +574,10 @@ test('member off import with alias - dotted name', () => {
582
574
  test('member off submodule with alias - dotted name', () => {
583
575
  const code = `
584
576
  // @filename: nested/test.py
585
- //// def [|/*marker*/foo|](): pass
577
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
586
578
 
587
579
  // @filename: sub/moved.py
588
- //// [|/*dest*/|]
580
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
589
581
 
590
582
  // @filename: used.py
591
583
  //// from [|{|"r":"sub"|}nested|] import [|{|"r":"moved"|}test|] as test
@@ -596,11 +588,11 @@ test('member off submodule with alias - dotted name', () => {
596
588
  test('member off import - multiple symbols', () => {
597
589
  const code = `
598
590
  // @filename: test.py
599
- //// def [|/*marker*/foo|](): pass
600
- //// def bar(): pass
591
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
592
+ //// |]def bar(): pass
601
593
 
602
594
  // @filename: moved.py
603
- //// [|/*dest*/|]
595
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
604
596
 
605
597
  // @filename: used.py
606
598
  //// [|{|"r":"import moved!n!"|}|]import test
@@ -612,11 +604,11 @@ test('member off import - multiple symbols', () => {
612
604
  test('member off import - multiple symbols - existing import', () => {
613
605
  const code = `
614
606
  // @filename: test.py
615
- //// def [|/*marker*/foo|](): pass
616
- //// def bar(): pass
607
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
608
+ //// |]def bar(): pass
617
609
 
618
610
  // @filename: moved.py
619
- //// [|/*dest*/|]
611
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
620
612
 
621
613
  // @filename: used.py
622
614
  //// import moved
@@ -630,11 +622,11 @@ test('member off import - multiple symbols - existing import', () => {
630
622
  test('member off import - multiple symbols - existing import with alias', () => {
631
623
  const code = `
632
624
  // @filename: test.py
633
- //// def [|/*marker*/foo|](): pass
634
- //// def bar(): pass
625
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
626
+ //// |]def bar(): pass
635
627
 
636
628
  // @filename: moved.py
637
- //// [|/*dest*/|]
629
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
638
630
 
639
631
  // @filename: used.py
640
632
  //// import moved as m
@@ -648,11 +640,11 @@ test('member off import - multiple symbols - existing import with alias', () =>
648
640
  test('member off import - multiple symbols with alias - existing import', () => {
649
641
  const code = `
650
642
  // @filename: test.py
651
- //// def [|/*marker*/foo|](): pass
652
- //// def bar(): pass
643
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
644
+ //// |]def bar(): pass
653
645
 
654
646
  // @filename: moved.py
655
- //// [|/*dest*/|]
647
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
656
648
 
657
649
  // @filename: used.py
658
650
  //// import moved
@@ -666,11 +658,11 @@ test('member off import - multiple symbols with alias - existing import', () =>
666
658
  test('member off import - multiple symbols with alias - new import', () => {
667
659
  const code = `
668
660
  // @filename: test.py
669
- //// def [|/*marker*/foo|](): pass
670
- //// def bar(): pass
661
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
662
+ //// |]def bar(): pass
671
663
 
672
664
  // @filename: moved.py
673
- //// [|/*dest*/|]
665
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
674
666
 
675
667
  // @filename: used.py
676
668
  //// [|{|"r":"import moved!n!"|}|]import test as t
@@ -683,11 +675,11 @@ test('member off import - multiple symbols with alias - new import', () => {
683
675
  test('member off import - multiple symbols with alias - existing import with alias', () => {
684
676
  const code = `
685
677
  // @filename: test.py
686
- //// def [|/*marker*/foo|](): pass
687
- //// def bar(): pass
678
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
679
+ //// |]def bar(): pass
688
680
 
689
681
  // @filename: moved.py
690
- //// [|/*dest*/|]
682
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
691
683
 
692
684
  // @filename: used.py
693
685
  //// import moved as m
@@ -701,11 +693,11 @@ test('member off import - multiple symbols with alias - existing import with ali
701
693
  test('member off import - multiple symbols - existing from import', () => {
702
694
  const code = `
703
695
  // @filename: test.py
704
- //// def [|/*marker*/foo|](): pass
705
- //// def bar(): pass
696
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
697
+ //// |]def bar(): pass
706
698
 
707
699
  // @filename: moved.py
708
- //// [|/*dest*/|]
700
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
709
701
 
710
702
  // @filename: used.py
711
703
  //// from . import moved
@@ -719,11 +711,11 @@ test('member off import - multiple symbols - existing from import', () => {
719
711
  test('member off import - multiple symbols - existing from import with alias', () => {
720
712
  const code = `
721
713
  // @filename: test.py
722
- //// def [|/*marker*/foo|](): pass
723
- //// def bar(): pass
714
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
715
+ //// |]def bar(): pass
724
716
 
725
717
  // @filename: moved.py
726
- //// [|/*dest*/|]
718
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
727
719
 
728
720
  // @filename: used.py
729
721
  //// from . import moved as m
@@ -737,11 +729,11 @@ test('member off import - multiple symbols - existing from import with alias', (
737
729
  test('member off import - multiple symbols - existing from import', () => {
738
730
  const code = `
739
731
  // @filename: test.py
740
- //// def [|/*marker*/foo|](): pass
741
- //// def bar(): pass
732
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
733
+ //// |]def bar(): pass
742
734
 
743
735
  // @filename: moved.py
744
- //// [|/*dest*/|]
736
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
745
737
 
746
738
  // @filename: used.py
747
739
  //// from . import moved
@@ -755,11 +747,11 @@ test('member off import - multiple symbols - existing from import', () => {
755
747
  test('member off import - multiple symbols - existing from import with alias', () => {
756
748
  const code = `
757
749
  // @filename: test.py
758
- //// def [|/*marker*/foo|](): pass
759
- //// def bar(): pass
750
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
751
+ //// |]def bar(): pass
760
752
 
761
753
  // @filename: moved.py
762
- //// [|/*dest*/|]
754
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
763
755
 
764
756
  // @filename: used.py
765
757
  //// from . import moved as m
@@ -773,11 +765,11 @@ test('member off import - multiple symbols - existing from import with alias', (
773
765
  test('member off from import - multiple symbols', () => {
774
766
  const code = `
775
767
  // @filename: test.py
776
- //// def [|/*marker*/foo|](): pass
777
- //// def bar(): pass
768
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
769
+ //// |]def bar(): pass
778
770
 
779
771
  // @filename: moved.py
780
- //// [|/*dest*/|]
772
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
781
773
 
782
774
  // @filename: used.py
783
775
  //// [|{|"r":"import moved!n!"|}|]from . import test
@@ -789,11 +781,11 @@ test('member off from import - multiple symbols', () => {
789
781
  test('member off from import - multiple symbols - existing import', () => {
790
782
  const code = `
791
783
  // @filename: test.py
792
- //// def [|/*marker*/foo|](): pass
793
- //// def bar(): pass
784
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
785
+ //// |]def bar(): pass
794
786
 
795
787
  // @filename: moved.py
796
- //// [|/*dest*/|]
788
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
797
789
 
798
790
  // @filename: used.py
799
791
  //// import moved
@@ -807,11 +799,11 @@ test('member off from import - multiple symbols - existing import', () => {
807
799
  test('member off from import - multiple symbols - existing import with alias', () => {
808
800
  const code = `
809
801
  // @filename: test.py
810
- //// def [|/*marker*/foo|](): pass
811
- //// def bar(): pass
802
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
803
+ //// |]def bar(): pass
812
804
 
813
805
  // @filename: moved.py
814
- //// [|/*dest*/|]
806
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
815
807
 
816
808
  // @filename: used.py
817
809
  //// import moved as m
@@ -825,11 +817,11 @@ test('member off from import - multiple symbols - existing import with alias', (
825
817
  test('member off from import - multiple symbols with alias - existing import', () => {
826
818
  const code = `
827
819
  // @filename: test.py
828
- //// def [|/*marker*/foo|](): pass
829
- //// def bar(): pass
820
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
821
+ //// |]def bar(): pass
830
822
 
831
823
  // @filename: moved.py
832
- //// [|/*dest*/|]
824
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
833
825
 
834
826
  // @filename: used.py
835
827
  //// import moved
@@ -843,11 +835,11 @@ test('member off from import - multiple symbols with alias - existing import', (
843
835
  test('member off from import - multiple symbols with alias - new import', () => {
844
836
  const code = `
845
837
  // @filename: test.py
846
- //// def [|/*marker*/foo|](): pass
847
- //// def bar(): pass
838
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
839
+ //// |]def bar(): pass
848
840
 
849
841
  // @filename: moved.py
850
- //// [|/*dest*/|]
842
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
851
843
 
852
844
  // @filename: used.py
853
845
  //// [|{|"r":"import moved!n!"|}|]from . import test as t
@@ -860,11 +852,11 @@ test('member off from import - multiple symbols with alias - new import', () =>
860
852
  test('member off from import - multiple symbols with alias - existing import with alias', () => {
861
853
  const code = `
862
854
  // @filename: test.py
863
- //// def [|/*marker*/foo|](): pass
864
- //// def bar(): pass
855
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
856
+ //// |]def bar(): pass
865
857
 
866
858
  // @filename: moved.py
867
- //// [|/*dest*/|]
859
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
868
860
 
869
861
  // @filename: used.py
870
862
  //// import moved as m
@@ -878,11 +870,11 @@ test('member off from import - multiple symbols with alias - existing import wit
878
870
  test('member off from import - multiple symbols - existing from import', () => {
879
871
  const code = `
880
872
  // @filename: test.py
881
- //// def [|/*marker*/foo|](): pass
882
- //// def bar(): pass
873
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
874
+ //// |]def bar(): pass
883
875
 
884
876
  // @filename: moved.py
885
- //// [|/*dest*/|]
877
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
886
878
 
887
879
  // @filename: used.py
888
880
  //// from . import moved
@@ -896,11 +888,11 @@ test('member off from import - multiple symbols - existing from import', () => {
896
888
  test('member off from import - multiple symbols - existing from import with alias', () => {
897
889
  const code = `
898
890
  // @filename: test.py
899
- //// def [|/*marker*/foo|](): pass
900
- //// def bar(): pass
891
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass
892
+ //// |]def bar(): pass
901
893
 
902
894
  // @filename: moved.py
903
- //// [|/*dest*/|]
895
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
904
896
 
905
897
  // @filename: used.py
906
898
  //// from . import moved as m
@@ -916,13 +908,13 @@ test('member off import - error case that we dont touch - function return module
916
908
  // for now, we won't handle such corner case.
917
909
  const code = `
918
910
  // @filename: test.py
919
- //// def [|/*marker*/foo|](): pass
911
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
920
912
 
921
913
  // @filename: test2.py
922
914
  //// def foo(): pass
923
915
 
924
916
  // @filename: moved.py
925
- //// [|/*dest*/|]
917
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
926
918
 
927
919
  // @filename: used.py
928
920
  //// from test
@@ -939,13 +931,13 @@ test('member off import - error case that we dont touch - field return module',
939
931
  // for now, we won't handle such corner case.
940
932
  const code = `
941
933
  // @filename: test.py
942
- //// def [|/*marker*/foo|](): pass
934
+ //// [|{|"r":""|}def [|/*marker*/foo|](): pass|]
943
935
 
944
936
  // @filename: test2.py
945
937
  //// def foo(): pass
946
938
 
947
939
  // @filename: moved.py
948
- //// [|/*dest*/|]
940
+ //// [|{|"r":"def foo(): pass", "name": "dest"|}|]
949
941
 
950
942
  // @filename: used.py
951
943
  //// from test
@@ -959,22 +951,107 @@ test('member off import - error case that we dont touch - field return module',
959
951
  test('simple symbol reference', () => {
960
952
  const code = `
961
953
  // @filename: test.py
962
- //// def [|/*marker*/foo|]():
954
+ //// [|{|"r":""|}def [|/*marker*/foo|]():
955
+ //// return 1|]
956
+
957
+ // @filename: moved.py
958
+ //// [|{|"r":"def foo():!n! return 1", "name": "dest"|}|]
959
+
960
+ // @filename: used.py
961
+ //// from [|{|"r":"moved"|}test|] import foo
962
+ ////
963
+ //// foo()
964
+ //// b = foo().real
965
+ `;
966
+ testFromCode(code);
967
+ });
968
+ test('handle __all__ - at the original file', () => {
969
+ const code = `
970
+ // @filename: test.py
971
+ //// [|{|"r":""|}def [|/*marker*/foo|]():
963
972
  //// return 1
973
+ //// |]__all__ = [[|{|"r":""|}"foo"|]]
964
974
 
965
975
  // @filename: moved.py
966
- //// [|/*dest*/|]
976
+ //// [|{|"r":"def foo():!n! return 1", "name": "dest"|}|]
967
977
 
968
978
  // @filename: used.py
969
979
  //// from [|{|"r":"moved"|}test|] import foo
980
+ //// foo()
981
+ //// b = foo().real
970
982
  ////
983
+ //// __all__ = ["foo"]
984
+ `;
985
+ testFromCode(code);
986
+ });
987
+ test('handle wildcard import - new import', () => {
988
+ const code = `
989
+ // @filename: test.py
990
+ //// [|{|"r":""|}def [|/*marker*/foo|]():
991
+ //// return 1|]
992
+
993
+ // @filename: moved.py
994
+ //// [|{|"r":"def foo():!n! return 1", "name": "dest"|}|]
995
+
996
+ // @filename: used.py
997
+ //// [|{|"r":"from moved import foo!n!"|}|]from test import *
998
+ //// foo()
999
+ //// b = foo().real
1000
+ `;
1001
+ testFromCode(code);
1002
+ });
1003
+ test('handle wildcard import with existing import', () => {
1004
+ const code = `
1005
+ // @filename: test.py
1006
+ //// [|{|"r":""|}def [|/*marker*/foo|]():
1007
+ //// return 1|]
1008
+
1009
+ // @filename: moved.py
1010
+ //// def bar():
1011
+ //// pass[|{|"r":"!n!!n!!n!def foo():!n! return 1", "name": "dest"|}|]
1012
+
1013
+ // @filename: used.py
1014
+ //// from moved import bar[|{|"r":", foo"|}|]
1015
+ //// from test import *
971
1016
  //// foo()
972
1017
  //// b = foo().real
973
1018
  `;
974
1019
  testFromCode(code);
975
1020
  });
1021
+ test('handle wildcard import with existing wildcard import', () => {
1022
+ const code = `
1023
+ // @filename: test.py
1024
+ //// [|{|"r":""|}def [|/*marker*/foo|]():
1025
+ //// return 1|]
1026
+
1027
+ // @filename: moved.py
1028
+ //// def bar():
1029
+ //// pass[|{|"r":"!n!!n!!n!def foo():!n! return 1", "name": "dest"|}|]
1030
+
1031
+ // @filename: used.py
1032
+ //// from moved import *[|{|"r":"!n!from moved import foo"|}|]
1033
+ //// from test import *
1034
+ //// foo()
1035
+ //// b = foo().real
1036
+ `;
1037
+ testFromCode(code);
1038
+ });
1039
+ test('handle wildcard import in destination file', () => {
1040
+ const code = `
1041
+ // @filename: test.py
1042
+ //// [|{|"r":""|}def [|/*marker*/foo|]():
1043
+ //// return 1|]
1044
+
1045
+ // @filename: moved.py
1046
+ //// from test import *
1047
+ ////
1048
+ //// def bar():
1049
+ //// pass[|{|"r":"!n!!n!!n!def foo():!n! return 1", "name": "dest"|}|]
1050
+ `;
1051
+ testFromCode(code);
1052
+ });
976
1053
  function testFromCode(code) {
977
1054
  const state = (0, testState_1.parseAndGetTestState)(code).state;
978
1055
  (0, renameModuleTestUtils_1.testMoveSymbolAtPosition)(state, state.getMarkerByName('marker').fileName, state.getMarkerByName('dest').fileName, state.getPositionRange('marker').start);
979
1056
  }
980
- //# sourceMappingURL=updateSymbolReference.test.js.map
1057
+ //# sourceMappingURL=moveSymbol.updateReference.test.js.map