Hi all, does anyone know how to search through cod...
# getting-started
j
Hi all, does anyone know how to search through code on Android studio simply like you can on VS code?
j
I'm not familiar with VS code, what kind of search are you looking for? Single-file search? (Ctrl+F) Full-text search across the project/module/directory? (Ctrl+Shift+F) Find usages/go to declaration? (Ctrl+click or Ctrl+B) Structural search? (Edit > Find > Search structurally...) You should be able to discover all options from the
Edit > Find
menu
j
VS code has a simple to use full-text search across the whole project
j
Then you can do the same with Ctrl+Shift+F, which is the
Find in Files
action (on macOS it's Cmd+Shift+F I think)
m
AS has "Find in Files" on the context menu in the project inspector. Really good, really fast. I don't know VS at all so is that what you want? You can ctrl-click on elements to go to their declarations and a host of other things too... Any good?
j
Does that search the whole project though? Doesn't seem to for me
@MarkRS for the file inspector I see the one on the far right and that didn't search the whole project for me
j
Once you open
Find in Files
(Ctrl+Shift+F), you have a tab selection. Make sure it's on `In Project`:
m
^ (which is the default)
m
@Joshua Akinsola, it's a context menu so it searches from the point you invoke it. As @Joffrey illustrates that means you can search the whole project, or part of it.
j
^ (which is the default)
@Michael Böiers it depends on where your current selection is. If you have selected a folder in the project view, the window will open on the
Directory
tab by default
m
Yes, once you’ve clicked a folder and then invoked the search, it’s in directory mode. But if you re-start the IDE, it will search the entire project.
j
I'm using a mac and I don't get the same type of search box you do? (I'm using the Artic fox version)
m
^ That looks like the standard search in the editor (CMD+F) rather than the full search (CMD+SHIFT+F).
1
k
maybe shift+shift is what you are looking for a.k.a. search everywhere
j
Yes that is also a way, but I think @Joshua Akinsola really is looking for full text search of project files, not search among actions etc. on top of the full text search (which might be undesirably wide). But judging by the last screenshot it looks like he's just using Cmd+F instead of Cmd+Shift+F, which is the essence of the problem here
m
It works just the same on a Mac @Joshua Akinsola, so perhaps you're not accessing it from the project viewer, the one (coincidentally) shown in the top left of pavi2410's message below yours
j
The Cmd+Shift+F is what i'm looking for. Thanks!