در حال بارگذاری ...

Fast File Navigation0:00

So now that I feel comfortable creating and manipulating files, I still want the process of getting around my project to be as seamless as possible. So yes, coming from Sublime, Command-P is incredibly useful. So if I need to go to a Kernel class, very, very fast. Or maybe the ExampleTest works great. And now notice how the tree view will automatically sync up with the current file. So in this case, I have my feature directory open, but if I switch back to member, the tree view will automatically adjust. And on that note, by the way, this can be useful for creating new files. This is more relevant to the last episode. But real quick, if I go to ExampleTest, well, now I have that feature directory highlighted, which means I could type new file relative to the current view, OtherTest, and

This is more relevant to the last episode. But real quick, if I go to exampleTest, well, now I have that feature directory highlighted, which means I could type new file relative to the current view, otherTest, and that will instantly be created there. So that's a good one to know. But anyways, let's delete that. We don't need it. But now I want you to notice something. Let's go to a few files. We're at Member now. We'll go to Application next, and then we'll go to FooController third. Okay. So now if I hit Command-P again, you'll see it orders the files according to those you most recently visited. And I don't know about you, but I will reach for this all of the time. You're working on files. You want to go back to the one previously or a couple times ago. So keep this in mind. And even better, I can type Command-P, and then I will keep hitting P to browse to a new file.

Browsing by Symbol1:11

You want to go back to the one previously or a couple times ago. So keep this in mind. And even better, I can type Command-P, and then I will keep hitting P to browse to a new file. So once again, Command-P, P, P, P, P, and then you can go there very quickly. So once again, if we have member, example, and then FooController, and I think to myself, oh, I need to go back to member. I'll just hit Command-P, P, P, and I'm there. Now though, what about browsing by symbol? This is another thing I will reach for. And this is going to be dependent upon the language, but we're assuming PHP here. So for example, let's go to... Let's go back to member, and we'll add a method here called age, the user's age. And I'll just hard code it to 32.

Let's go back to Member, and we'll add a method here called age, the user's age. And I'll just hard code it to 32. Okay, often you will want to access this file from one within a current file, but also maybe you don't have that file open at all, but you still know I need to go to the age method. How do we do that? Well, I can go to Member, and if I open the palette, we could try to go to a symbol, and you'll see Shift-Command-O, but no symbol information for the file. And that's because code isn't something like PHPStorm, where it just has inherent knowledge of PHP out-of-the-box. We have to pull in dedicated extensions to add that functionality. So let's give this a shot.

Installing PHP Extensions2:25

We have to pull in dedicated extensions to add that functionality. So let's give this a shot. Shift-Command-X to open my extensions, or once again from the palette, you can type it out. But you know what? You'll reach for that one often enough to the point you need to memorize that. Alright, so here are the three that we have installed so far. Why don't we just look for php? And then I can even say sort by install count, and that will probably show me the most popular ones. Now here's a quick thing. At the time of this recording, you'll see PHP IntelliSense, but from my experiences, there's another one called IntelliFence that actually ends up working a bit better, at least again at the time of this recording. So let's give that an install, because we can see it also, among other things, has built-in symbol support.

Jumping to Symbols2:57

there's another one called IntelliFence that actually ends up working a bit better, at least again at the time of this recording. So let's give that an install, because we can see it also, among other things, has built-in symbol support. And even things like this, where you can add use declarations and stuff like that. We'll dedicate a full video to that. For now, I just want to browse by symbols. So let's give it a reload, and we'll close this out with Command-1, or maybe Command-B for you. Now, let's go back to our member class, and we'll try to browse to that now. So we know it's something like symbol. Go to symbol and file is Shift-Command-0. Alright, well now they pop up, and I can quickly visit age. Now here's a cool thing. As I type in the name, one useful feature of code is it will highlight the relevant portion. So if I look for age, it's going to highlight the entire method, as you can see here. Really useful.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟