Is it possible to rank search results lower based on the file path in VS Code? - visual-studio-code

There are certain files that I'd like to always appear below other files in the search results. E.g. generated files and tests. I don't want to exclude them from the search results. Usually, I'd be searching for files that aren't generated or tests. There's a setting called "Search: Sort Order", but none of them work because the files I want to de-rank are interspersed with other files.
Is there a setting or extension that could work?

I'm not sure this is possible with the current LTS version of Visual Studio Code.
However, if you want the feature to be available, and many people also want it, you can make a new GitHub Issue with the tag feature-request. Microsoft might review it (if there are many people who want it too), and add the feature.
Edit: This link at Visual Studio Code might help. Click here for the documentation.

Related

VSC: Refactor in user source folders only

In Visual Studio Code 1.68.1. under Ubuntu 22.04, whenever I try to refactor (rename, F2) a variable, it searches through all the files under the project tree. Then it suggests in the preview the ones that are actually involved. It's correct, but exploring all the files may take a lot of time.
Is there a way to tell VSC to look at the user source files only? I mean the ones under include and src? Or, even better, select (or exclude) directories for refactoring?
I read this question, but it's related to a search rather than a refactoring.

How to expand VScode directories

I know this has been answered somewhere before, but for the life of me I cannot figure out how to properly Google this query. I got a new computer and I've mostly setup my Visual Studio Code environment, but I have never liked the shorthand directory structure if defaults to. I want to change my directories to be full dropdowns and not a one-line somedirectory/subdirectory/subdirectory/something.js
Apparently there is some fancy word for it but I have no idea what that word is and it's making my searching surprisingly difficult.
So, what setting do I need to change in VScode to make all of my directories follow the format that Collection has in the example below and not like lessons/flashcards?
Thanks!
TLDR; I want every directory to be a full dropdown. None of this lessons/flashcards nonsense.
To Achieve this go to your vs code settings and search Compact Folders. It will be checked by default. Uncheck that and it will work.

How to use vs code to manage scattered files?

Most of my projects have files scattered in different directories. I am just checking out vs code and am wondering if there are sufficient project management features to suit this need.
Ideally, it would have a way to place files from different locations into a named 'group'. The group could be opened and closed (I mean brought in to view, or loaded into vs code) easily via a pick list. A file could be moved from group A to group B; the file location on disk would remain the same, just it's membership in a group would change. I would want the relationsip between the groups and the related files to be savable so that the same groups and associated files would be accessible after vs code as been closed and the opened again.
vs code looks very capable, but I've only gone over a few tutorials and haven't use it for anything real yet. It does say it's file and folder centric, and OS level folders are not how these files are organized. Maybe there is a feature I've not seen yet or a plugin.
I too was looking for something similar, but unable to find a solution. I did find a work-around though. There is an extension called File Group that allows creating a group of file with full path to locations of each file. New to vsCode myself, it took me a while to figure it out, but worth the effort. Hint, once installed, go to settings, Extensions, File Group and Edit in settings.json to add your file list.

How do you get #Recomended to work in VS Code?

I can get#recommended:workspace extensions to work correctly but I am unsure as to why I cannot get the general #recommended to show anything. Where am I supposed to put the extensions.json file?
My goal here is to have PowerShell install VSCode, copy over some JSON files for specific settings and then have the user shown the companies recommended extensions to install once they open up VSCode.
I know I can force them installed with code --install-extensions but I want the user to be able to pick and choose from the companies recommended list based on what kind of files they'll be working on. What I can't seem to figure out is how to get that list to show except within a workspace.
For example, we have a Chef team, an Azure team, Linux team, etc. each needing different extensions.
The #recommended option has no config. VS Code decides which extension to recommend based on the file types that exists in the folder/workspace that you opened (official release info).
So, in your scenario, I guess the best option is to use Workspace Recommendations (#recommended:workspace), using a different recommendation for each team/project.

Finding previously deleted code in RTC later?

Conventional wisdom says to delete code once you don't need it -- as opposed to leaving it in the codebase as a comment -- because you can always find it later in the repository.
Let's say I need a line of code from the past which I remember to contain a very memorable substring ("XYZ", for discussion's sake).
What are my options for finding the previously deleted code using the Visual Studio 2010 Rational Team Concert (3.x) client? Can I search only the revisions of a single file (I might not know what file it was in)? Can I search quickly/easily across many files (w/o pulling those files out of the repository)?
I am not sure there is an easy way to get back the exact file with that missing string.
You can select show the history on a component of a Stream, in order to "Show the History files" for a given change set.
From there, you can do some "compare with Local File".
However, the Visual Studio integration might be less complete than the eclipse one, as this thread shows (where the "Show History" shows only the history of Deliver's).
Even though the following article uses the Eclipse GUI, have also a look at "Practicing source control archaeology with Rational Team Concert", which has other ideas for you to try.