Commit 304fcee
authored
Updated: Only auto-import from package.json (#32517)
* Move package.json related utils to utilities
* Add failing test
* Make first test pass
* Don’t filter when there’s no package.json, fix scoped package imports
* Use type acquisition as a heuristic for whether a JS project is using node core
* Make same fix in getCompletionDetails
* Fix re-exporting
* Change JS node core module heuristic to same-file utilization
* Remove unused method
* Remove other unused method
* Remove unused triple-slash ref
* Update comment
* Refactor findAlias to forEachAlias to reduce iterations
* Really fix re-exporting
* Use getModuleSpecifier instead of custom hack
* Fix offering auto imports to paths within node modules
* Rename things and make comments better
* Add another reexport test
* Inline `symbolHasBeenSeen`
* Simplify forEachAlias to findAlias
* Add note that symbols is mutated
* Symbol order doesn’t matter here
* Style nits
* Add test with nested package.jsons
* Fix and add tests for export * re-exports
* Don’t fail when alias isn’t found
* Make some easy optimizations
* Clean up memoization when done
* Remove unnecessary semicolon
* Make getSymbolsFromOtherSourceFileExports pure
* Cache auto imports
* Revert "Cache auto imports"
This reverts commit 8ea4829.
* Handle merged symbols through cache
* Be safer with symbol declarations, add logging
* Improve cache invalidation for imports and exports
* Check symbol presence first
* Only run cache invalidation logic if there’s something to clear
* Consolidate cache invalidation logic
* Fix reuseProgramStructure test
* Add more logging
* Only clear cache if symbols are different
* Refactor ambient module handling
* Start caching package.json stuff
* Support package.json searching in fourslash
* Move import suggestions cache to Project
* Start making more module specifier work available without having the importing file
* Going to backtrack some from here
* Get rid of dumb cache, fix node core modules stuff
* Start determining changes to a file have invalidated its own auto imports
* Move package.json related utils to utilities
* Add failing test
* Make first test pass
* Don’t filter when there’s no package.json, fix scoped package imports
* Use type acquisition as a heuristic for whether a JS project is using node core
* Make same fix in getCompletionDetails
* Fix re-exporting
* Change JS node core module heuristic to same-file utilization
* Remove unused method
* Remove other unused method
* Remove unused triple-slash ref
* Update comment
* Refactor findAlias to forEachAlias to reduce iterations
* Really fix re-exporting
* Use getModuleSpecifier instead of custom hack
* Fix offering auto imports to paths within node modules
* Rename things and make comments better
* Add another reexport test
* Inline `symbolHasBeenSeen`
* Simplify forEachAlias to findAlias
* Add note that symbols is mutated
* Symbol order doesn’t matter here
* Style nits
* Add test with nested package.jsons
* Fix and add tests for export * re-exports
* Don’t fail when alias isn’t found
* Make some easy optimizations
* Clean up memoization when done
* Remove unnecessary semicolon
* Make getSymbolsFromOtherSourceFileExports pure
* Cache auto imports
* Revert "Cache auto imports"
This reverts commit 8ea4829.
* Handle merged symbols through cache
* Be safer with symbol declarations, add logging
* Improve cache invalidation for imports and exports
* Check symbol presence first
* Only run cache invalidation logic if there’s something to clear
* Consolidate cache invalidation logic
* Fix reuseProgramStructure test
* Add more logging
* Only clear cache if symbols are different
* Refactor ambient module handling
* Finish(?) sourceFileHasChangedOwnImportSuggestions
* Make package.json info model better
* Fix misplaced paren
* Use file structure cache for package.json detection when possible
* Revert unnecessary changes in moduleSpecifiers
* Revert more unnecessary changes
* Don’t watch package.jsons inside node_modules, fix tests
* Work around declaration emit bug
* Sync submodules?
* Delete unused type
* Add server cache tests
* Fix server fourslash editing
* Fix packageJsonInfo tests
* Add node core modules cache test and fix more fourslash
* Clean up symlink caching
* Improve logging
* Function name doesn’t make any sense anymore
* Move symlinks cache to host
* Fix markFileAsDirty from ScriptInfo
* Mark new Project members internal
* Use Path instead of fileName
* Rename AutoImportSuggestionsCache
* Improve WatchType description
* Remove entries() from packageJsonCache
* Fix path/fileName bug
* Also cache symlinks on Program for benefit of d.ts emit
* Let language service use Program’s symlink cache1 parent 558ece7 commit 304fcee
File tree
42 files changed
+1964
-211
lines changed- src
- compiler
- harness
- server
- services
- codefixes
- testRunner
- unittests/tsserver
- tests
- baselines/reference/api
- cases/fourslash
- server
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
42 files changed
+1964
-211
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3682 | 3682 | | |
3683 | 3683 | | |
3684 | 3684 | | |
3685 | | - | |
| 3685 | + | |
| 3686 | + | |
3686 | 3687 | | |
3687 | 3688 | | |
3688 | 3689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
67 | 81 | | |
68 | 82 | | |
69 | 83 | | |
| |||
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
82 | | - | |
| 96 | + | |
83 | 97 | | |
84 | 98 | | |
85 | 99 | | |
| |||
152 | 166 | | |
153 | 167 | | |
154 | 168 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | 169 | | |
190 | 170 | | |
191 | 171 | | |
| |||
207 | 187 | | |
208 | 188 | | |
209 | 189 | | |
210 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
211 | 193 | | |
212 | 194 | | |
213 | 195 | | |
| |||
299 | 281 | | |
300 | 282 | | |
301 | 283 | | |
302 | | - | |
| 284 | + | |
303 | 285 | | |
304 | 286 | | |
305 | 287 | | |
| |||
308 | 290 | | |
309 | 291 | | |
310 | 292 | | |
| 293 | + | |
311 | 294 | | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
328 | 313 | | |
329 | 314 | | |
330 | 315 | | |
331 | 316 | | |
332 | 317 | | |
333 | 318 | | |
334 | | - | |
| 319 | + | |
335 | 320 | | |
336 | 321 | | |
337 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| 718 | + | |
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
| |||
973 | 974 | | |
974 | 975 | | |
975 | 976 | | |
976 | | - | |
| 977 | + | |
| 978 | + | |
977 | 979 | | |
978 | 980 | | |
979 | 981 | | |
| |||
1472 | 1474 | | |
1473 | 1475 | | |
1474 | 1476 | | |
| 1477 | + | |
1475 | 1478 | | |
1476 | 1479 | | |
1477 | 1480 | | |
| |||
3358 | 3361 | | |
3359 | 3362 | | |
3360 | 3363 | | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
3361 | 3374 | | |
3362 | 3375 | | |
3363 | 3376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3068 | 3068 | | |
3069 | 3069 | | |
3070 | 3070 | | |
| 3071 | + | |
3071 | 3072 | | |
3072 | 3073 | | |
3073 | 3074 | | |
| |||
4885 | 4886 | | |
4886 | 4887 | | |
4887 | 4888 | | |
4888 | | - | |
| 4889 | + | |
| 4890 | + | |
4889 | 4891 | | |
4890 | 4892 | | |
4891 | 4893 | | |
| |||
5335 | 5337 | | |
5336 | 5338 | | |
5337 | 5339 | | |
| 5340 | + | |
5338 | 5341 | | |
5339 | 5342 | | |
5340 | 5343 | | |
| |||
6020 | 6023 | | |
6021 | 6024 | | |
6022 | 6025 | | |
6023 | | - | |
| 6026 | + | |
6024 | 6027 | | |
6025 | 6028 | | |
6026 | 6029 | | |
6027 | 6030 | | |
| 6031 | + | |
| 6032 | + | |
6028 | 6033 | | |
6029 | 6034 | | |
6030 | 6035 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4624 | 4624 | | |
4625 | 4625 | | |
4626 | 4626 | | |
4627 | | - | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
4628 | 4630 | | |
4629 | 4631 | | |
4630 | 4632 | | |
| |||
7627 | 7629 | | |
7628 | 7630 | | |
7629 | 7631 | | |
7630 | | - | |
| 7632 | + | |
7631 | 7633 | | |
7632 | 7634 | | |
7633 | 7635 | | |
| |||
7638 | 7640 | | |
7639 | 7641 | | |
7640 | 7642 | | |
7641 | | - | |
| 7643 | + | |
7642 | 7644 | | |
7643 | 7645 | | |
7644 | 7646 | | |
| |||
7773 | 7775 | | |
7774 | 7776 | | |
7775 | 7777 | | |
| 7778 | + | |
| 7779 | + | |
| 7780 | + | |
| 7781 | + | |
| 7782 | + | |
| 7783 | + | |
| 7784 | + | |
| 7785 | + | |
| 7786 | + | |
| 7787 | + | |
| 7788 | + | |
| 7789 | + | |
| 7790 | + | |
| 7791 | + | |
| 7792 | + | |
| 7793 | + | |
| 7794 | + | |
| 7795 | + | |
| 7796 | + | |
| 7797 | + | |
| 7798 | + | |
| 7799 | + | |
| 7800 | + | |
| 7801 | + | |
| 7802 | + | |
| 7803 | + | |
| 7804 | + | |
| 7805 | + | |
| 7806 | + | |
| 7807 | + | |
7776 | 7808 | | |
7777 | 7809 | | |
7778 | 7810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
127 | 134 | | |
128 | 135 | | |
129 | 136 | | |
| |||
0 commit comments