reactjsvisual-studio-codenaming-conventionsfile-search

How can I change the ranking of a file in the Quick Open search results listing?


I am following the Airbnb naming convention https://airbnb.io/javascript/react/#naming Thus, I am using the index.tsx file to define my custom React Component but, I have an issue when searching for that component in VSCode.

When looking for icon the file that I am looking for appears at the end of the results list.

Is there any way to improve the search or customize it to enhance the rank of the index.tsx files?

enter image description here


Solution

  • I think the best you can do as a user is use the search.quickOpen.history.filterSortOrder setting. It has two options:

    • "default": History entries are sorted by relevance based on the filter value used. More relevant entries appear first.
    • "recency": History entries are sorted by recency. More recently opened entries appear first.

    VS Code's Quick Open UI always (as far as I know) shows recently matching files in a top section called "Recently Opened". So regardless of what setting value you chose from the above, you'll get recently opened files in that top section. The value you choose will further change the "Recently Opened" and "file results" sections of the results based on which files you have opened more/most recently.

    So if you have opened the file that you want to show higher up, and next time you search with something that it matches on, it will show in the "Recently Opened" section. Setting "recency" or search.quickOpen.history.filterSortOrder will make it show up higher in the list than other matches that you opened less recently than it.