IntelliJ IDEA Tips and Tricks 2021. By Hadi Hariri

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] uh i am very happy to introduce hadi hadi and he's not pretty yet just add him to the stream randomly hi hadi hello am i is it live am i on yes is this thing on is this thing i am really happy to introduce hadi as the first speaker of day two hadi is a very good speaker he is the author of many of the code samples we actually use in the intellij idea code sample project he's probably the reason why kotlin is so popular and he's also my boss so he doesn't believe anything i say when i say nice things about him i think you all knew i was going to say nice things and you weren't yeah yeah yeah and uh you also kind of gave me a heads up i'm not being sarcastic okay it's like the story of my life with my kids when i say a compliment to them they're like what have i done wrong this time so yeah thank you um so it's it's great being here uh this is my first uh talk of the year if you know we could call this a talk um are you this in our conference no i'm like i'm just staring at a screen right now uh hi everyone i'm great that all of you could join me on this very early dull morning well it's dull a little bit here in spain where i am i'm at the south of spain and i could say to you that i'm coming to you from sunny spain but no apparently today they decided it needs to be dull and cloudy but it's okay that means that it doesn't shine through the window and you want you know you won't see my my my face with all that wonderful sunshine that i normally get most of the rest of the world doesn't have sun at all yeah don't worry about that climate change will fix that for a little while never mind okay so do i start trisha yes i just i first before you wanted to before you started i wanted to say one more observation you gave me this t-shirt back in 2013. um you gave it to me at java zone before i started working for budget brains so you did a very long slow recruitment process on me and um and i'm wearing it again today that's what that's all i wanted to this is totally not rehearsed as you can tell um great i will let you get on with it i will uh add your stream add your screen to the stream and drop off i'll be asking you questions at the end of the session good luck and goodbye thank you and a couple of disclaimers first of all if this goes wrong this is a live session right if it goes wrong please don't worry and also please don't expect me to record it for you and upload it later on i'm sorry it's it's a live session it's gone wrong it's gone wrong the good news is that i've given uh talks like this before they're all on youtube and if anything is horribly bad here you can just look up the other ones that are pretty decent if i can say so myself which i can i just did also something that trisha pointed out she said that every time she has watched one of my talks she has actually picked up something new so i kind of consider that kind of like a compliment in the sense of if you've ever watched monty python's life of brian you always pick up something new every time no matter how many times you watch it uh so yes and yeah there you go though i don't even need to do a new version of the talk you could just keep watching the other one and pick up something new i mean you're bound to pick up something but anyway as i always say i'm gonna set my bar very very low uh if if you learn one thing that's worth 45 minutes of your time right it could be it could be something life-changing and talking about life-changing we've had a change this is the change as you can see this is the new welcome screen in intel the idea you know that thing that you try and avoid as much as possible this is it uh we've made it easier to or more clearer or bigger to search so i could just type website and see everything this website but there's a there's a couple of things on the left hand side which are kind of nice one of them is this thing called learn intellij idea now i don't know how many of you have actually ever clicked on this don't be scared to do click on it and if you click on start learning what that's going to do is open up intellij idea for you it would be very strange if it opened up something else wouldn't it uh huddy yes mental notes uh and what it does is essentially give you a bunch of steps that you can go through so i can click on context actions and it will show me what it's about to do it tells me like in many cases intelligent idea can guess your intention or propose a fix for warning or error let's invoke one and it will guide you step by step so i will say alt enter you can see that it completes it here and it says now apply the safe delete redundant so i would apply the safe delete redundant and then it tells you what it has done and so on and so forth and you can go step by step through this live interaction with the ide and it's showing you everything that the ide can do right so thank you uh now all you have to do this is a hands-on lab so you can just all open up your ids and click on learn intellij idea bye-bye no okay never mind now another couple of other things we're going to open up our project here and that welcome screen is actually nice why is it nice because you get access to all that wonderful recent projects and you can actually see those recent projects unfortunately it doesn't come with a key map by default but if you click on key map and you search for manage projects i've assigned a key map to it which is shift command p now why did i assign that because that's the only keyboard shortcut that's available right now after everything else has been taken by intellij but also the p p stands for for projects and shift command m was taken so here if i press shift command p you can see that i basically kind of get that same uh feel that i did on the open welcome screen and i can essentially open up any recent projects so you know it's actually quite nice because it lets you go back to recent projects in a quick way now let's start with something very very simple that search everywhere which i always start with and i'm not going to go through it all you know basically what search everywhere does you know what it does it searches absolutely everywhere but there's a couple of things that people still don't know and one of them is that you can actually do other things other than search if you press the command you can actually change things so for example i go to system and from system i can modify anything you don't have to go to preferences i can click on plugins from plugins i can see all of well not plugs that's the type of dock plugins i can see all of my different plugins switch them on and off and now generally i can say that for quite a few number of plugins you don't have to restart intellij id every time you switch them on and off which is kind of nice the other thing that we've added to search everywhere is this concept of searching in git so if i have my git repository in my project i can also look for things on here now notice that when i do a home it says no gift refs found and you're like what what does that mean is that is that gifts because i read gif there i don't know why i read git don't know don't know why i read gif but anyway so notice that there's a little dot here with the filter and what you want to do is if you end up with that situation just make sure that you've got the right filters selected or you could have just hit all and now it will provide you with uh more insight right so now what i'm doing is i'm actually being able to search through my git commit messages and go to a specific one and it will show it up for me inside the git log and who it was and get quick access in that right so it's again one step less that you have to do if you want to search for something in git history if you are uh also interested in doing maths operations don't launch the calculator just write 2 plus 20 plus 400 and that gives you 420 divided by 345 times whatever okay gone too far and that gives you the result which you can also copy to clipboard it also does currency convert no it doesn't do currency conversion but that actually should be could in fact what we should add is kilometers to miles and all of that imperial to to non-imperial uh to the rest of the world imperial to the rest of the world uh conversions in there that that that's that's a good idea trisha i don't know if you're in the background we should we should log that as a future request now this is search everywhere uh another thing that search everywhere is cool about is that it's not only that you have search everywhere in the search everywhere but in intellij you can search everywhere literally everywhere and don't forget that so if i'm in the project window and i can come and say for example qc that's going to allow me to search for uh query completion and in fact using camel case so you can see at the top here that i'm using qc and it's using camel case to search everywhere and this essentially works in any tool window that you have anywhere you can search everywhere and of course you can use search everywhere to search everywhere and enough with search everywhere let's talk about run anything because anything is better than everywhere now with anything run anything if you press double control what that's going to do is allow you to run your project or whatever it is that you're doing from the command line so to speak or from this dialog box and if you have a run configuration uh excuse me if you have a run configuration you could just type the name of that run configuration uh for example i don't know if i have data type rendering so that's a run configuration i can hit enter and that would basically run the data type rendering example for me but in addition to that this is the first time i've compiled so it's a little bit so in addition to that you can also if your project is gradle or maven you can use grade or maven and notice that it says it shows you even an icon and for example if i write gradle it gives me a list of all of the gradle uh syntax options and i can run anything if i run maven type maven i can do maven clean which i will not do at this point in time so it allows you to run maven task gradle tasks run configurations and the cool thing is that once you run something you double click it it's already there so you can easily just run that this is very useful if you have a multi-module project with lots of different things or you're running two a whole bunch of different unit tests to be able to you know return to that specific one that you want to run in addition to the search everywhere which and run anything there is also one of my favorite keyboard shortcuts in intellij idea which is shift command a which is essentially search everywhere but tabbed along to actions and this is very very cool because it essentially allows you to run any action without having to remember the keyboard shortcut if you actually don't like remembering keyboard shortcuts so if i say move it will show me anything that is related to move whether it's a carrot whether it's a refactoring whatever it is if i say for example refactor it will show me the refactoring options and i can say refactor this and it would show me the refactor this menu if you do not know how to find something use shift command a and just type it and the reverse of that sometimes if you don't know what a keyboard shortcut is mapping to don't just randomly execute things you can come here and put the keystroke in keymap so click on this little icon here and let's say if i say command o it will show me what things are being mapped to command o okay and escape obviously showed me everything that mapped to escape last but not least in terms of navigation navigating menus and actions one thing that is also useful is the quick list so if you go to quick lists you know that other thing that you probably never look at this is quite nice in allowing you to create your own quick lists with specific things that you use yourself so for example if i were to make a quick list uh for around uh running for like i wouldn't do something around running because we've already got a bunch of actions for running but i could say okay run run configurations for template new projects for instance and then i could go back to my keymap and assign a keymap shortcut to this quick list and then it would just pop up so for instance in the deployment one if we go back to deployment and we say deployment sorry to keymap we say deployment we can see that we've got a quick list over here and i could add a keyboard shortcut which is like let's play that what is that thing twister now with with our keyboard with our keys shift ctrl alt command w that's not taken there you go shift control now let's remember that shift control everything let's just press every keyboard shortcut that there is and figure out if we can get this to pop up there you go whoa awesome now i gotta remember why things go weird when i press that five keys combination so that is also kind of nice to allow you to navigate quickly across things now let's move on quickly favorites that other thing you probably never open right the command f command two or just you know shift command favor shift command alt uh shift command a and favorites this shows you a bunch of favorites now you say okay big big deal it shows me bookmarks it shows me code samples etc which is the actual project now the the thing about this is the following in that i could actually create my own group of favorites so for instance if i were to say bad code examples right and then inside this bad code examples i could actually uh you know add a specific example to this favorite so for instance i could come to this file that we have open and if i press shift command f not shift command if yeah if i hold on a second my keyboard mapping has been messed up and now i've gone into full screen uh let's find add to favorites add to favorites oh of command okay never mind right there you go add to favorites i can now add it to a new list or i could add it to bad code examples and then as i see here it's expanded and i can see grouping of my files in a specific category which is kind of interesting if you are doing for example an examination of your code base and you want to group specific files together this comes in handy now in terms of files if this is nice for navigation you can also of course set a bookmark so for instance i just press f3 here and it's adding the different bookmarks i can use mnemonics to add bookmarks which is just shift control and the number and i can then see all of these uh entries over here so i could navigate to the different ones and you just press the same number and it just appears and disappears and then of course if you want to set breakpoints you can set breakpoint book favorites as well so kind of useful i use it quite a bit when i'm trying to understand a little bit the code base and i want to focus on a bunch of different files now and i'll i'm going to say something about tabs we'll take a look at that in a moment but let's look at recent files as well recent files here you've got to forgive my little size of window here because i've put the system font very very large so that you see it properly and some things come out strange so recent files command e is very very helpful recent files basically shows you all of the recent files you've been to as well as giving you access to all of the different tool windows so for instance if i open up the structure that's going to give me access to the structure without me having to know the keyboard shortcut for that now shift command e before if you were to press shift command e that would give you recent edited files that behavior has been changed i think it was last year or a little bit earlier than that and now if you want to see the recent changed only as you can see here it says press command e again and this is a common pattern that we have if you press the keyboard shortcut the same keyboard shortcut in a dialog it slightly changes that behavior so in this case i'm going to press command e again and it's going to show me the recent edited files right you've got a little icon here which maybe you don't know about but what that does is open it up in a second tab as opposed sorry in a split window as opposed to the actual window itself now if you want to go to a line number you can also use the double shift and if i'm on files or shift command f and then sorry shift command o and i say for example gsp 10 that will go to the file gsp which is generally switch branches based on camel case and 10 will take me to that specific line number so that's another quick way of navigating through files and talking about navigating through files one thing that we've enabled is there was the option here that before it says auto scroll to source and auto scroll from source that has kind of uh vanished and now you can do this enable preview tab now what does this enable preview tab do well essentially i've got it enabled and then what happens is that you can see i've disabled it and i can go through my different files in the project view let's close the favorites so that we see this better and see that nothing actually happens now if i enable it what's going to happen is that it's going to change the actual displayed file each time i navigate now i i personally i don't like this behavior so i have it disabled but this works well with tabs if tabs are your thing tabs are not my thing but if tabs are your thing you can do that and the behavior is a little bit different so if we go to editor tabs and we put them at the top for instance you can see that there is the enable previews tab over here so now what happens is that you see that this one is in cursive or italics and as i navigate you see that it's using that same tab to show me the preview okay now i don't kind of like doing that the way that i do it and i don't like tabs either so the way that i do it essentially is i've got that disabled if i want to see something i can hit enter and then that will take me to the focus of the file if i just want to see the file without editing it i can well f4 should have done that but now it's defaulting to the same behavior press command 1 always to get back to your project view one interesting thing is if you're using things like recent files and you go to query completion how do you know where this is in your project view that's where i add another key map so if you come to key maps and we go to select in project view select project of view in project so naming these things uh selecting project somewhere there let me actually look it up by keyboard mapping there you go select file in project view so i've assigned the keyboard map control alt l to select in project view that doesn't come by default so what this means is that if i'm in query compression and i press ctrl alt l that will immediately highlight it for me in the project view which is kind of nice so i prefer that type of navigation now a few more things in terms of navigation we can click on a single symbol for example command b and it will show us not only uh navigate to it but it can also show us all of the usages which is kind of nice so here i can see the usages that goes to a declaration from the declaration i can actually navigate to the usages which is everywhere that is being used if you want to navigate back and forth of course you have the command left square brackets or command right square brackets obviously i'm using windows at the bottom here you can see the mapping for wind sorry i'm using mac os at the bottom you can see the mapping for windows and linux but if you want to also look at your recent locations that's one of the things that has changed where i said that we've now replaced the shift command e keyboard mapping we've replaced the recently changed files to recent locations and recent locations essentially is showing me all of the recent locations i've been to which can be in the same file or they can be in different files as can be seen here so you can see that the first ones are the same file and then different files now if i want to do the recently changed locations much the same way as we saw previously use the same keyboard shortcut in the dialog box to get the recently changed locations and here we can see that it goes only to the places that i have recently changed and it gives you a nice breadth cue as well of where you are in your project but of course at any time in your project you could just press ctrl alt l and that will take you to the actual file in your project view now uh one last thing in terms of navigating and finding things in in source code uh shift command f allows me to find things in files now we all know that that's not how we should be doing things and if we want to like you know you generally want to be able to navigate to things or or see the usages etc but sometimes if you want to do a search you can do a search obviously so for example i do move and then it shows me all of the entries for move now if i open this up in a tool window and the keyboard shortcut would be command enter as shown right now it shows me a list of entries that i have recently searched for now why is this useful because if i go back to searching for something and you click on scope you can actually limit that down to the previous search results so you don't have to go through the same process again you can say look i searched for something now i want to limit the search down to the results that i previously got because i started for something i played with something i touched something now i want to go back and look at other things and it will limit that scope to essentially everything that has been shown in the tool window here okay which is also very useful right now that's enough of navigation uh let's take a look a little bit about imperium uh imperials what is empirience hardy i don't know it's when you say appearance in the wrong way right so let's go to appearances plugins it's all about appearances for the record i put on cologne today i want it appear well over youtube so plugins if i go to themes teams we can see that we have in the marketplace a whole bunch of themes so this is something that we added a long a couple of years ago i think and we have the dracula theme which is kind of like darkula but it's actually spelt as dracula hyper b i have not looked through these themes for a while i should actually start looking at these things xcode dark theme nice so if you want to change the appearance of your ide and remember this isn't just about color this is about appearances of even the way the buttons are rendered the toolbars everything you can look through all of the different themes that are available now out of the box of course we have support for some themes as well as you know you can see in appearance i have intellij light mac os light high contrast darkula or sync with os now if you're one of these people that has light themes in the morning or dark themes at night or the other way around i don't know how they do it and your os does that for you you can now enable that in intellij and depending on when you use intellij it will basically switch personally i'm back to kind of the light thing i don't know if it's my eyesight or what it is but i like to see some light okay now maximizing the editor a lot of times when you come to the editor this isn't what you want to see right you don't want to see my tiny little bit of screen where i can edit some code shift command f12 maximizes the editor shift command f12 toggling back and forth you can now access all of your different tool windows without having to open and close them individually and you can maximize the editor screen if you really want to get in the zone then i recommend that you switch off twitter slack and every other tool that you have that is basically drowning you in notifications once you do that then you can also enter the zen mode and what this does is basically make it yeah it just takes away everything else now the one cool thing about the zen mode is that if you hit configure gutter buttons you can actually show the gutter buttons so that means that if i have like a run or a test i can still access that if i'm not familiar with the shortcut and see that and i can still see information about the the code without losing all of that information just because i'm in zen mode so that is very nice to have the gutters uh buttons enabled in zen mode there's another mode that we also have which is called the reader mode now notice how we've got the little comments and no docs here but if i click on uh command string command b to go to string notice this nice little layout that we have this is called the reader mode and the reader mode does a whole bunch of things like make the font bigger it could increase the spacing it renders nicely the data uh sorry the the docs so if i press shift command q not shift command q do not press shift command q control alt q sorry it will show me the actual kind of docs the way they're written in source code and it will toggle it now to a nicer format for me this is very very nice in reader mode and if you go to reader mode here you can see all of the different options that you have available when you are just reading code and you know what they say we should spend more time reading code than writing code or don't they say that or they say you shouldn't spend a lot of time writing reading code you shouldn't spend it never mind right editing let's go to editing see the great thing about doing these is that it doesn't matter even if i make a attempt at being humorous i'm just gonna all assume that you're laughing at my jokes because i can't hear you so i'm just yes and and you're laughing with me yes you're laughing with me now templates templates i'm not gonna go through templates you probably already know they've been around since decades uh or sometimes known as code snippets one cool thing that people used to request and we finally added is support in the case of file templates we've added support for multiple file generations so for instance if i click now uh controller let's say that i want to create a model model view controller kind of template where i generate a model of view and uh controller what i can do is you know enter this one and say for example there's a java file and then enter whatever i want here i don't know public uh public void main whatever well it would be a home controller public uh home controller i don't really write java so and then what i can add here is click on add child template and then as part of that template i can generate multiple files and this comes in really useful for some folks where they want to try and actually have multiple files generated by a single template now the templates of course if you're not familiar make sure that you check out the post fix templates etc when editing code as well we've got the extra uh x the select expanse shrink selection on the text remember that if you want to select the entire line just go to the cursor where there's nothing and then hit alt up to get the entire line selected now when you want to move code around as well you can just you know use shift command and up and down arrows to move code around and when you want to format code you can also just get it formatted quickly by pressing alt command l and that will reformat your code now talking about code formatting you know if you're extremely bored in your life what you can do is go to court formatting over here code style java and then sit through this now personally i think probably making some barbecues is more entertaining than this but the point is that we do want our code formatted and we want it in a specific way but this doesn't give me much insight and it doesn't allow me to have any kind of context beyond the sample that is being shown in the little side here which i can't seem to expand now what you can do is select a piece of code so for example i can select this code and then if i hit alt enter i say adjust code settings it will automatically pick up everything that is applicable to that specific code and allow me to then modify that and you can actually see the results as you're doing it live as well right so i can see how that works and then i'll save it and this is a gradual thing you know it's kind of like refactoring you don't say i'm going to sit down today and refactor the entire project no you do it gradually so as you start the project that you want to standardize on code styles you want to do this and once you've got it done then you can export it you can reuse it and talking about exporting note that we do support editor config both for settings and code styles and things so you can essentially just save that to a file uh in your idea folder and then just use that okay let's move on now let me show you one other thing that i still sometimes forget and do by hand if i come here and i'm splitting up these strings and i want to join them don't do something like this because that's a lot of pain what you can actually do is press shift ctrl j and that is going to join them for you okay so that's a that's the opposite of splitting up strings and in terms of carrots so if you want to have carrots you can just basically place carrots everywhere you want so for example here and then just start typing there if you want to select a word multiple times for example b you can just press go on the word in particular and then just continuously press ctrl g until you get all of the instances that you want highlighted and if you want to get them all highlighted then you would press ctrl command g and that will get all of the instances highlighted now this is great and sometimes you want to use multiple cursors what you should never use multiple cursors for is refactoring like very rarely would i say yes of course you want a refactor you search and replace or multiple cursors no don't there's tons of refactoring built in intellij idea and you know what this is this i i really hope you're sitting down because this might come as a shock there are more refactorings than just rename i know rename is very popular but there are more refactorings but talking about rename one thing that we've done is kind of cool so let's say for instance let's go to something that we want to rename let's uh let's find some um something i don't know let's go to for example no not location uh string refactoring oh let's see where did i have that nicely hippie completion there you go so i want to do this renaming and i can press command shift f6 to do the renaming now notice that this little icon in these icons popped up and you can also navigate to it using the keyboard shortcut that tells you which is alt shift o on mac and what we do is this is going to give you the rename comments and strings and text occurrences right so often times in intellij when you want to rename something then it comes up with this window and says hey do you want to refactor this and do you want me to search across all your strings and then you're going to say oh no no no don't don't don't refactor my strings because sometimes it doesn't make sense to refactor strings now you don't have to have that refactor window you can basically just do it here and say yeah i want comments and strings or no i don't want text occurrences and do the renaming there and intellij idea will do it for you another cool uh thing with refactoring is for instance the extracting functional parameter refactoring which is kind of nice especially if you know you're still not very well versed in functional programming intelligent idea can help you actually create some functions and teach you a little bit so i can say introduce functional parameter and i can say by function uh you know operation function for instance i'm not good at naming and here it will introduce the concept for you it will a little bit teach you as well how to actually pass in a function and create a higher order function in java for instance and then we've also added some improvements to extract methods so here let's go to extract method and then say that i want to select these lines of code and i want to extract this i could just say just not minimize my intellij ctrl t and then i've got mu extract function sorry extract method and it will again make it nicer for me to extract a little less user a little more user-friendly and i can press the gear button to say annotate etc so it's already becoming a little bit smarter in that sense and it's not taking you through this long dialog box of like saying okay now what do you want to do no let's just assume some defaults you do it for me and then if i'm not happy i can go ahead and change it now let's move on to analysis analysis is uh important one thing that we've changed again with uh with intellij id you can see the little tick box here we've always had that that basically is looking through your code as you see when i'm navigating you can see that it's essentially looking at the code and it's finding all of the issues and i could navigate to these issues i can click on them and i will see them at the bottom of all of the different issues that my file in particular has but i can also navigate to them using f2 and shift f2 this will take me through each of these ones and then if there's a corresponding inspection i can highlight that inspection and it will show it to me now this is kind of nice and what other thing that we've added now is that for instance if we go to planet java and let's say that i'm going to make this private okay now what happens is that intellij highlights this related problem there's technically nothing wrong with this refactoring right i mean i've made my constructor private for whatever reason however it says there's a related problem what's that related problem it says you're not going to be able to do that because you're creating an instance of it and it's not going to be valid so it will detect it it's going to inspect obviously not just that file but all of the issues that are happening across your project and of course all of these inspections are the smart things that we are trying to build in and folks are working on and analyzing your code base and you can switch them on and off etc if you want to do your own inspections you can you can build a plug-in or you can use something similar to it which is structural search which i love talking about especially now that we have it even for kotlin and here is the cool thing about a structural search so i'm just writing code here i'm just writing java code and then i say a placeholder if you find some code i don't care what that code is i'm going to call it a placeholder and then if i have catch exception e and i have see i have the full editor here e get message tell me that this is a horrible code it's basically searching for some code and it says yep i found your code and this isn't the type of code that you should be writing now let's go back to that search structurally and i can even make this another piece of placeholder like bad management now find and it will map anything that has that style of code so you can see here that i have uh bad management because it's throwing a new exception or whatever right top point being i don't want to catch top level exp exception now if i do replace structurally replace replace what this will allow me to do is essentially replace that code so in this case i could just say replace that code with code right so if i find that i can now say replace and then i say replace selected and it's basically going to just replace the selected and then go so on and so forth and this is great but it's proactive remember that you can actually do this as part of inspections as well so structural uh structural search there is somewhere there search actually okay well it's somewhere there i'll find it and probably won't do a video about it but you can look it up there somewhere that you can actually add a structural search as an inspection and then it will highlight it at all times so you don't have to do it proactively and talking about inspections obviously we inspect a lot of things look at this we were inspecting my name this was the old days when you actually generated a a template with information there now we've even enhanced the spell checker with a grammar checker so if you go and look up grammar there you go you see that i can now add a whole bunch of files to be checked for grammar so right now by default it only adds markdown but let's enable java right let's enable java and see what happens if i now go to for instance let's look up a symbol java 10 symbols java 10 inspections right i can see that look at this inside an actual comment in my code it's detecting a grammar mistake note that we can use the diamond operator and the type is moved right and the type is moved right that's not an oxford comma but it's a comma and it's an important comma and if we enable this in our different types of files and i don't know why kotlin isn't there we need kotlin people then you will get the grammar checks also in your code base which again is very very nice now very completion if you've ever worked with intellij idea you know that we have some excellent support for database and this is part of what we call language injections right i've added a a source here so basically my database has access to the source to the to the ddl information and it can give me completion i can get this in many places right if i go for instance to json or let's say the regular expressions here you can see that this is just a string but using this concept of language injection which has been around forever uh i say that this is now a regular expression it will highlight it for me and parse it to me as a regular expression and if i type something wrong which we all do when we write regular expressions there is that problem that it will highlight and i can even check regular expressions so here i can for instance type in a number and it's correct and if i type something else it's not matching and of course the json stuff which is awesome as well so we have alt enter inject language reference json i never get tired of using this alt enter edit json fragment and this is how you write json okay don't go doing that manually okay now data flow analysis i believe that uh my colleague taguire was talking a little bit about data flow analysis yesterday i recommend that you watch the session which was great but data flow analysis is really really cool in that basically allows you to understand how data analysis is flowing so let's click for example data analysis flow here and let's take a look at this date get month now if i increase if i select this and i press the information to show me the type it's going to say to me int right which is nice if i put my cursor there it says to me what do you want to know i want to know for example over here that's a boolean okay great that's fine now let's go over here for instance and do the same thing i'm going to press shift command p and i say yes i want to get date month it says ins but now watch shift command p again shift control p sorry and it tells me the actual value it is telling me the actual value and is doing it based on data flow analysis and data flow is fantastic for that because it essentially allows you to go through the code base and understand what type of data is coming in in a specific point and that information has now been even combined with debugging to make it even more solid right because it's again please look up the session by targaryen yesterday about data flow analysis and how that works for more information about that but it is really really good tool to understand the flow of your data instead of you mentally sitting there and saying okay well this is 12 and now if it goes there that it will match the equals to two and how and so forth and of course you can get for example data flow uh let's go to data floor and i can say select here and i the id and say data flow data flow from here or to here and it's showing me all of the places that this data is going to flow to so it says this is all of the functions or the properties or the parameters that this data is going to be flowing to now debugging yesterday again my colleague igor had a fantastic session on debugging really really great and i'm not going to go into too much details because he already showed things like the stream debugger which is really fantastic which allows you to basically uh you know set a breakpoint here and then i'm going to debug this and this should be let's do that properly multi-line expressions uh let's set a debug point here and let's debug this now that's going to do the rendering let's debug the right one so you can see that i get information there and then if i hit the stream debugger it's going to show me information about the actual parts of the stream which is really really cool okay i recommend you watch that talk we've added this inline hints that you know uh that we had before you can of course add your own watches if i were to come here and say new watch this would allow me to add a new watch for example i don't know words and then i don't whatever here let's do it on another example that i have let's go to customer java and let's see what is being used here so let's say for example data rendering right so over here i can add a watch here that is for example full name so let's run this let's debug this and you can see that i have uh i can come over here and say i want to add a new watch and i'll say first name plus last name right now this is always going to be there and it's going to always show me that but it would be nice to get it over here and i can do that by basically saying create renderer not create renderer over here and actually it should allow me to oh sorry add as inline watch and i'll say hold on a second add as inline watch so i can say first name bus last name and that should now add me that watch as inline as well so i can basically customize the inlines as i have them and then if you ever want to remove them you can also remove them obviously you can't remove the default ones but the rest of them you can again highly recommend you watch that talk we've got only a few minutes left so i'm going to just uh wrap up with a few other honorable mentions code with me which is the ability to now uh code you can share code with me is the ability to now code what what kind of language am i speaking hold with me that allows you to actually do pair programming with others there's going to be a session on that by my colleague kirill and he's going to be covering that so i won't be showing it today shared indexes is a feature that we've added to intellij idea which allows you to basically make indexing a little bit faster if you click on shared indexes essentially what it's going to do is across the projects and in in addition to the common libraries that are being used in the jdks we're going to essentially be indexing these once and then being shared across the projects and that's going to drastically cut down the indexing time for you to work on your projects if you are working with gradle or maven and you use dependencies make sure you check out the packages plugin which is an awesome little tool that we've created which allows you to basically add get updates see all of the different packages you have so for instance if i want to install a package i can hit kator that will find me ktor and i can say for instance add it to compile or add it to implementation or runtime or whatever and it will add that for me it will also highlight any versions that need updating so you can see here that it says for example jupyter has been updated to 5801 m1 i do want to actually do perform the update it gives you information about the products as well so the the project the github pages etc make sure you check that out then let's now just quickly switch over to another project which i want to show you some things uh in payment so if you're doing any kind of developments that involves running services et cetera whether they're docker whether they're your self-contained services except or you know based on jar or tomcat or whatever i recommend you check out the the services tab which is very very cool in that it allows you to actually add your services right so let's go ahead over here and add run something so for instance i'm going to go to my payments it's a caterer application and i'm going to run this so let's go ahead and run it and then what this is going to do is essentially run that http server and what it will now allow me to do in the services view is see all of the different applications running right so i can now come here and say run configuration type and or i can edit one configuration type and i'll say gradle and then inside the gradle one i have all of my different uh runs so i can now run that and if i have a docker configuration i can say a docker connection and connect to my docker instance and if i have a container then you see it will show me all of my containers and i can start running all of the different containers and this gives me a wonderful view of all of the services that i'm running so use the services if you're doing that kind of development also if you're doing any kind of web development remember that we've got support for http uh files to to test so i can just hit run localhost test from here a few new additions that we've added which is copy uh the take that and convert it to a command line url so that you can run with carl so if i open up now my terminal and i paste i get my exact same code that i could just easily run with curl and in the search everywhere i can look for uh even urls we support multiple frameworks obviously spring i think my colleague marco also had a session that might be highlighting this a little bit more and then going to spring you see that we even have for example open an http client go to declaration of usages etc so a whole bunch of things around web development and backend and server side development that are also available and as i mentioned there's been a few sessions that have covered this in more detail so make sure you check that out and with that i'm gonna have to wrap up because we're already out of time uh just one last mention regarding the help file that thing again that you never look at i strongly recommend that you look at ide features trainer that i showed you at the beginning and also the productivity guide which is not a pdf but it tells you how many times and what you've been using and what you haven't been using of intellij and you can click through them and see the number of times you've used them etc okay so that is it from my side trisha uh we've got a few minutes left for questions um yeah so um firstly fantastic as always i think you did a great job as well of um adding lots of the new features that uh i was um yeah i was not expecting you to add so many of the new features in there so that was really really cool that like uh related problems for you and the inline watches i'd actually forgotten about inline watches and they're so cool very helpful yeah they are um we also had a a comment that you you said way back at the beginning that you just assumed that everyone was laughing at your jokes and everyone on youtube says they are laughing at your jokes and they do think that you're funny look did you see all this white hair do you know how much stress i've gone through this week just for my jokes and uh it's well rewarded because people did think that you were funny um we um we don't have loads of questions because the moderators have done a really good job of answering most of the questions on on youtube so that's actually quite cool one of the comments was um have we thought about creating and releasing our own keyboard to solve our keyboard shortcut problems i like that idea yeah that's like a really big one that's a good idea did you like my idea about the the currency conversion thing yeah i put that on my list raise a ticket for i bet you any money actually there's probably already a feature for that but i do think it would be a good idea we'll use it when i'm creating my uh my invoices i'll use my use intellij for that as well and we also had a feature request of uh find a free shortcut but then you'd have to find a free shortcut to find a shortcut for find a free shortcut yes and also actually talking about that i forgot to mention the key promoter plugin i think you've maybe mentioned that uh that helps you you know every time you pre use something with the mouse it tells you if you want to use the keyboard here is here's something you can press next time you you make it sound really polite but one of the reasons i like key promoter is because it goes don't use the mouse stupid person here's the keyboard shortcut and it does it so much like this is the keyboard shortcut you're like okay fine i'll just learn it yeah it's the best thing um and also i i wanted to say uh um to my shame i have not investigated package package search very much and um and i was blown away by that i know i'm so sorry because you keep saying you should look at it i'm like yeah yeah i'll get to that but it's really cool i really like that that's okay i won't take it personally not for a while so i quite often spend like every time we do a new release i also check the versions of all my dependencies to make sure they're up to date and um now you could just do updates all with package searching it'll do it i will be doing that so package search looks really cool um that's excellent uh what else let me just quickly see if there's any new questions coming in uh oh there's always last-minute questions something something something gradal no um so i had a question for you which is um what is your favorite keyboard shortcut shift commander and which is also max's favorite keyboard shortcut because he says he can't remember all the the keyboard shortcuts okay yeah no i mean that's the reason like i don't memorize every single keyboard shortcut uh so i just you know mostly default to shift command a and just run it from there i was talking to the the ui ux people last uh yesterday about search everywhere um but i was because we were talking about how could search everywhere be even more helpful but i think when i still even though with such everywhere you can do you search for your keyboard shortcuts shift command a is still better right because you you know you're searching for a command not anything yeah yeah i mean i i have to admit i mean i love search everywhere but i've gotten so used to shift command a or shift command o or the shift uh command uh you know command o to go to symbol file uh type that i just i always default to that and run anything now i do use quite a bit because that is really useful i use that loads because what i used to do is i used to navigate to the thing i wanted to run and then run it um so just run anything saves me at least one keyboard shortcut yeah run anything it's really cool and i like the like you were pointing out i like the fact that it you've got the little icon to show whether you're running maven or gradle or or a run configuration yes yeah very useful one of my top five things um yeah and i was also talking to the the ui ux people about um about muscle memory and about how intellij idea when they're when they're thinking about the design of intellij idea they have to think about the fact that users like us don't know what the keyboard shortcuts are we know it's it's this you have to do this with your hands it's like quake yes wasd like why can't we just do everything around those four keyboard shortcuts w w isd and what is it there oh now i want to play quake thanks for that quake world oh we should do a quick world tournament that's what that's what we should all do in our confinement lockdowns we should like have this world tournament of quake world i think we should implement it inside intellij idea quake world inside into ah i'm game i'm game that's the next hackathon project yeah all right thank you very much i don't think that's thank you any more questions so thank you so much as always an absolutely brilliant session thanks very much thank you take care you
Info
Channel: IntelliJ IDEA by JetBrains
Views: 40,270
Rating: undefined out of 5
Keywords: IntelliJ IDEA, IntelliJ IDEA Conf, intellij java, java, jetbrains, intellij idea tips
Id: 41CC-F6KRP8
Channel Id: undefined
Length: 58min 9sec (3489 seconds)
Published: Wed Mar 24 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.