Android Studio's search scope for files located in certain directories (in particular androidTest) - android-studio

I have a very big android project and I want to search for all the entries in androidTest for certain lines of code. In this project I have a separate folder with a big amount of modules grouped up in different directories.
I'm trying to write a scope that will show only entries located in folders called androidTest.
The scope, I suppose, is file:*androidTest*/, but it does not find all the entries (does not search through all the files in project)
Did someone entered this problem?
I tried to use file:*androidTest*/ pattern but it definitely does not work properly.

Related

Search for files in folders that have a dot in their name

1st, I want to cover what this question is not about. There are 100's of articles that talk about how to search for folders with dots within their names. This is not the question. This is about searching for files within a folder that has dots in its name.
Say I have a folder
c:\public\dev\process.ui.help\
I have another folder
c:\public\processuihelp\
I have exact copies of the same files in each folder
help.csproj
help.cs
help.cs has a line in it like
//find this - SearchForMe
if in explorer and I search "SearchForMe", then explorer only returns help.cs from the 2nd folder but not the first. It may be treating the dotted folder names as extensions.
Edit: in the index options, any folders with extensions are automatically being de-selected. If I reselect them and save, they are de-selected again.
Is there any work-around or alternative search?
Why? : In this large development project (10's of projects, 1000's of folders), I am using dotted folder names to organise namespaces without creating a deep hierarchy of folders. Windows allows dotted folder names.
I haven't searched with built-in windows searches for a long time.
I just replicated your situation and tried searching with "Search My Files" and with "Everything", two tools I use frequently and both found both files immediately. Maybe give either or both of them a try and see if they do what you are looking for.
Edit: Everything is by voidtools, search my files by nirsoft, both are freeware.

Haskell Extension for Visual Studio Code starts a new Haskell Language Server for each file

I recently installed the Haskell extension in Visual Studio Code which is powered by the Haskell Language Server. Each time I open a different Haskell file in the editor a new process named "haskell-language-server-1.0.0-linux-8.6.5" is created. The result of this is that each time I hover over a word in my program I see everything, like types or errors written two times. More important each of these processes consumes about 1 Gb of RAM and eventually my system crashes. Is there anything I could do to avoid all of this?
I encountered The same problem.
To solve this problem, I opened the folder containing all wanted files, i.e.,File -> Open Folder. This solution is sufficient if you have all wanted files located within a single folder. This folder can contain other folders that also contain haskell files (or any similiar recursive file structure), and still only one language server will be created
If you want to use files that are located in different folders, there are two options depending on how many language servers you are willing to tolerate:
Single Language Server: Move all folders containing wanted files to a new folder; as visual studio code views this as a single folder, only a single language server is spawned.
Specific Limit of Language Servers: Create a workspace and add folders containing wanted files to it. More specifically: a) Close any current workspace, folder, or file( these actions can be found at the bottom of the file menu), b) add wanted folders to workspace by File->Add Folder to Workspace, c)(optional) If you want to use such a setup in the future you can save this workspace by File -> Save WorkSpace as. Each added folder that is added directly through the Add folder to Workspace action will spawn a new language server;it is the number of folders opened this way that determines the amount, not the total amount of folders open.

Can I filter sidebar directories by name (in sublime text 3) to quickly find node module, for example?

Here is my example, where I could have some input to filter directory subfolders.
The direct answer to the question is that this is not possible; the list of files and folders in the side bar is controlled by what folders you add and the settings that you include/exclude files and folders from within those folders. In theory you could try to modify the settings to change what appears in the side bar, but every time those settings change the file catalog needs to be rebuilt, which is something that can take some time (particularly in something with a large node_modules folder). It also causes all of the folders in the side bar to fold up.
The expected workflow is more designed around working with files than with working with groups of folders and that workflow centers around the Goto Anything panel. Choosing Goto > Goto Anything in the menu will open a panel showing you a list of every file that is currently contained in the side bar (except binary files).
The panel can filter text via fuzzy matching using as many search terms as you want (in any order you want) and will move the most likely matches closer to the top of the list. It also learns over time what files you pick when you use certain filters.
For your use case here you can open the panel and use a filter like node_modules or nmod/ to filter to files in the node_modules/ directory, acorn/ to see only files that exist in folders that match acorn, or a combination. You can also include fragments of filenames like lodash/ indjs to bring the index.js of the `lodash/ package to the top of the list.
The best way to get a feel for how this works is to play with it a little bit. Note also that the context menu in open files has a Reveal in side bar command that will focus the side bar on that file, which can be a handy way to see the other siblings of files you have open.

Adding two existing projects of the same name but located in different folders

I have 2 projects that are structured somewhat like:
FolderA
|
\--> Project1.vcxproj
FolderB
|
\--> Project1.vcxproj
The two Project1s are actually different projects.
When I right-click on my solution and Add -> Existing Project, I get the following error.
The solution already contains an item named 'Project1'.
Given that I can't rename the actual project files and that I want them both added to the same solution, is there any way I could do it?
I've tried many things:
Renaming the project file in Visual Studio.
Deleting the .suo file and restarting VS.
Editing the .sln/.vcxproj files using a text editor (but there was nothing relevant that I could find).
All of the above resulted in the same error.
I would think that since the project files are in separate folders, VS would treat them as separate projects, but there must be something I'm overlooking.
The problem occurs when you have two project files with the same name (not projects with the same name, but project files). In your case they are Project1.vcxproj and Project1.vcxproj. Therefore, you have to rename one of them (and do not forget to rename the corresponding Project1.vcxproj.filters file) and only after this add this project to the solution as an existent project.
Maybe the problem can be solved somehow else, without renaming the files, but I do not know how.

Check that no file is forgotten for the installshield project

we actually build an InstallShield project for our application with the functionality to include files dynamic into a component. All files will be taken which are in a specific place.
Because of problems, which are not part of this question, we want to change this to components where we add files explicit to custom separated components.
The question is, is there a best practice for this? We have the small fear that we easily can forget to add files to the component we new created. These can be dll files, .config files, pdfs or just xml.
(We build the installer every night using TFS.)
We found a solution for the problem.
What we wanted to solve:
During the build we want to be informed if files got removed
During the build we want to be informed if new files are missing
we solved this by two more or less easy things.
1. Information if a file is removed
This is easy sone, we have all files added explicitly, each single file is an own component now, if one file is missing the whole project does not build with the exact error message.
2. Information for missing files
For this we wrote a small tool which runs by a prebuild event of the installshield project.
There it opens the *.ism file as an xml file and searches for the "Files" table.
Than it takes all files from the drop folder and looks if all files are in there.
If there are files missing but we don't expect them, like pdb files or test dlls, we have an additional text file we just called "IgnoreList".
The tool skips these files by the check.
Now we are on a very good state to get informed directly on the next morning if the project was able to build or not, and if not what happened, so we can be sure that in the final target application are files are there :-)

Resources