microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.65k stars 28.68k forks source link

Suggest closest files first, when multiple imports available #62037

Closed aghArdeshir closed 5 years ago

aghArdeshir commented 5 years ago

Issue Type: Bug

HI!

I ahve a scenario!

I use Angular and I have lots of modules and each module of mine has lots of components and each one also has a file called <ModuleName>.constants.ts. and in every .constant.ts file there is a an exported array called GridConfig.

When inside componentsof my module, I type GridCon... f... i... g... and I get suggestions of all of the GridConfigs available in all of the modules. That's great! But I expect that the closest one (considering path of the files) be the first one. But it isn't.

Thanks!

VS Code version: Code 1.28.2 (7f3ce96ff4729c91352ae6def877e59c561f4850, 2018-10-17T00:23:51.859Z) OS version: Windows_NT x64 10.0.17134

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz (4 x 1796)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Memory (System)|3.90GB (0.38GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (19) Extension|Author (truncated)|Version ---|---|--- ng-template|Ang|0.1.10 path-intellisense|chr|1.4.2 gitlens|eam|8.5.6 EditorConfig|Edi|0.12.5 tslint|eg2|1.0.40 vscode-npm-script|eg2|0.3.5 prettier-vscode|esb|1.6.1 react-snippets|hks|0.1.2 angular-essentials|joh|0.4.0 Angular2|joh|6.3.0 camelcasenavigation|map|0.3.51 debugger-for-chrome|msj|4.10.2 angular2-inline|nat|0.0.17 material-icon-theme|PKi|3.6.0 vscode-icons|rob|7.27.0 git-merger|sha|0.4.1 hlwd-vscode-react|syl|0.1.6 vscode-react-snippets|ugr|1.3.0 ReactSnippets|xab|2.2.1 (1 theme extensions excluded)
mjbvz commented 5 years ago

Tracked upstream by https://github.com/Microsoft/TypeScript/issues/15024 and https://github.com/Microsoft/TypeScript/issues/29434

There's also the editor.suggest.localityBonus: setting: https://code.visualstudio.com/docs/editor/intellisense#_locality-bonus