Skip to content

Commit

Permalink
moved page over to the misc group
Browse files Browse the repository at this point in the history
  • Loading branch information
JR1811 committed Jul 18, 2024
1 parent 19882d2 commit 5dc4146
Show file tree
Hide file tree
Showing 24 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .vitepress/sidebars/develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ export default [
{
text: "develop.gettingStarted.launchGame",
link: "/develop/getting-started/launching-the-game"
},
{
text: "develop.gettingStarted.ideTipsAndTricks",
link: "/develop/getting-started/ide-tips-and-tricks"
}
]
},
Expand Down Expand Up @@ -202,6 +198,10 @@ export default [
{
text: "develop.misc.text-and-translations",
link: "/develop/text-and-translations"
},
{
text: "develop.misc.ideTipsAndTricks",
link: "/develop/ide-tips-and-tricks"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ Refer to the `File > Setings > Keymap` Settings or search for the functionality
IntelliJ has many different ways of traversing projects. If you have generated sources using the `./gradlew genSources` commands in the terminal or used the `Tasks > fabric > genSources` Gradle Tasks in the Gradle Window, you can manually go through the source files of Minecraft in the
Project Window's External Libraries.

![Gradle Task](/assets/develop/getting-started/using-the-ide/traversing_01.png)
![Gradle Task](/assets/develop/misc/using-the-ide/traversing_01.png)

The Minecraft Source code can be found if you look for `net.minecraft` in the Project Window's External Libraries. If your project uses split sources from the online [Template mod generator](https://fabricmc.net/develop/template/), there will be two sources, as indicated by the name (client/common). Additionally other sources of projects, libraries and dependencies, which are imported via the `build.gradle` file
will also be available. This method is often used when browsing for assets, tags and other files.

![External Library](/assets/develop/getting-started/using-the-ide/traversing_02_1.png)
![External Library](/assets/develop/misc/using-the-ide/traversing_02_1.png)

![Split sources](/assets/develop/getting-started/using-the-ide/traversing_02_2.png)
![Split sources](/assets/develop/misc/using-the-ide/traversing_02_2.png)

### Search{#search}

Pressing <kbd>Shift</kbd> twice opens up a Search window. In there you can search for your project's files and classes. When Activating the checkbox `include non-project items`
or by pressing <kbd>Shift</kbd> two times again, the search will look not only in your own project, but also in other's, such as the External Libraries.

![Search Window](/assets/develop/getting-started/using-the-ide/traversing_03.png)
![Search Window](/assets/develop/misc/using-the-ide/traversing_03.png)

### Recent Window{#recent-window}

Another useful tool in IntelliJ is the `Recent` window. You can open it with the Shortcut <kbd>CTRL</kbd> + <kbd>E</kbd>. In there you can jump to the files, which you have already visited and open tool windows, such as the [Structure](#structure-of-a-class) or [Bookmarks](#bookmarks) window.

![Recent window](/assets/develop/getting-started/using-the-ide/traversing_04.png)
![Recent window](/assets/develop/misc/using-the-ide/traversing_04.png)

## Traversing Code{#traversing-code}

Expand All @@ -60,12 +60,12 @@ Especially when researching source codes, it can help out to mark spots which yo
Either right click a file in the `Project` window, an editor tab or the line number in a file.
Creating `Mnemonic Bookmarks` enables you to quickly switch back to those bookmarks using their hotkeys, <kbd>CTRL</kbd> and the digit, which you have chosen for it.

![set Bookmark](/assets/develop/getting-started/using-the-ide/traversing_05.png)
![set Bookmark](/assets/develop/misc/using-the-ide/traversing_05.png)

It is possible to create multiple Bookmark lists at the same time if you need to separate or order them, in the `Bookmarks` window.
[Breakpoints](./basic-problem-solving#breakpoint) will also be displayed in there.

![Bookmark window](/assets/develop/getting-started/using-the-ide/traversing_06.png)
![Bookmark window](/assets/develop/misc/using-the-ide/traversing_06.png)

## Analyzing Classes{#analyzing-classes}

Expand All @@ -77,13 +77,13 @@ are located in that file, which methods have been implemented and which fields a
Sometimes it can be helpful,
to activate the `Inherited` option at the top in the View options as well, when looking for potential methods to override.

![Structure window](/assets/develop/getting-started/using-the-ide/analyzing_01.png)
![Structure window](/assets/develop/misc/using-the-ide/analyzing_01.png)

### Type Hierarchy of a Class{#type-hierarchy-of-a-class}

By placing the cursor on a class name and pressing <kbd>CTRL</kbd> + <kbd>H</kbd> you can open a new Type Hierarchy window, which shows all parent and child classes.

![Type Hierarchy window](/assets/develop/getting-started/using-the-ide/analyzing_02.png)
![Type Hierarchy window](/assets/develop/misc/using-the-ide/analyzing_02.png)

## Code Utility{#code-utility}

Expand All @@ -94,7 +94,7 @@ accident or just moved your cursor to a new place, you can use <kbd>CTRL</kbd> +

For example, when using Lambdas, you can write them quickly using this method.

![Lambda with many parameters](/assets/develop/getting-started/using-the-ide/util_01.png)
![Lambda with many parameters](/assets/develop/misc/using-the-ide/util_01.png)

### Displaying Parameters{#displaying-parameters}

Expand All @@ -104,7 +104,7 @@ If you closed them by accident or just moved your cursor to a new place, you can
Methods and classes can have multiple implementations with different parameters, also known as Overloading. This way you can decide on which
implementation you want to use, while writing the method call.

![Displaying method parameters](/assets/develop/getting-started/using-the-ide/util_02.png)
![Displaying method parameters](/assets/develop/misc/using-the-ide/util_02.png)

### Refactoring{#refactoring}

Expand All @@ -113,7 +113,7 @@ but things like extracting parts of the code into separate methods and introduci

Many IDEs have an extensive tool kit to aid in this process. In IntelliJ simply right click files or parts of the code to get access to the available refactoring tools.

![Refactoring](/assets/develop/getting-started/using-the-ide/refactoring_01.png)
![Refactoring](/assets/develop/misc/using-the-ide/refactoring_01.png)

It is especially useful to get used to the `Rename` refactoring tool's key bind, <kbd>Shift</kbd> + <kbd>F6</kbd>, since you will rename many things in the future. Using this feature,
every code occurrence of the renamed code will be renamed and will stay functionally the same.
Expand All @@ -131,7 +131,7 @@ Sometimes simpler tools are needed to edit code occurrences.

If enabled, all of those tools allow for a more specific pattern matching using "[Regex](https://en.wikipedia.org/wiki/Regular_expression)".

![Regex replace](/assets/develop/getting-started/using-the-ide/search_and_replace_01.png)
![Regex replace](/assets/develop/misc/using-the-ide/search_and_replace_01.png)

## Comments{#comments}

Expand All @@ -143,7 +143,7 @@ comments are necessary to leave notes or **temporarily** disable code for testin
To comment out code faster, open IntelliJ's Settings, look for the `Comment with Line Comment`
and the `Comment with Block Comment` entries, and set their Key binds to your preferences.

![Keymap settings](/assets/develop/getting-started/using-the-ide/comments_01.png)
![Keymap settings](/assets/develop/misc/using-the-ide/comments_01.png)

Now you can highlight the necessary code and use the shortcuts, to comment the section out.

Expand Down Expand Up @@ -181,7 +181,7 @@ if you are not actively working on them. To create a custom block which can be c
// endregion
```

![Region collapse](/assets/develop/getting-started/using-the-ide/comments_02.png)
![Region collapse](/assets/develop/misc/using-the-ide/comments_02.png)

::: warning
If you notice that you are using too many of them, consider refactoring your code to make it more readable!
Expand All @@ -193,14 +193,14 @@ When working on code, it can come in handy to leave notes, on what still needs t
a potential issue in the code, but you don't want to stop focusing on the current problem. In this case, use the
`TODO` or `FIXME` comments.

![TODO and FIXME comments](/assets/develop/getting-started/using-the-ide/comments_03.png)
![TODO and FIXME comments](/assets/develop/misc/using-the-ide/comments_03.png)

IntelliJ will keep track of them in the `TODO` window and may notify you, if you commit code,
which uses those type of comments.

![TODO and FIXME comments](/assets/develop/getting-started/using-the-ide/comments_04.png)
![TODO and FIXME comments](/assets/develop/misc/using-the-ide/comments_04.png)

![Commit with TODO](/assets/develop/getting-started/using-the-ide/comments_05.png)
![Commit with TODO](/assets/develop/misc/using-the-ide/comments_05.png)

### Javadocs{#javadocs}

Expand All @@ -209,14 +209,14 @@ deeply integrated into IntelliJ.

When hovering over method or class names, which have JavaDoc comments added to them, they will display this information in their information window.

![JavaDoc](/assets/develop/getting-started/using-the-ide/comments_06.png)
![JavaDoc](/assets/develop/misc/using-the-ide/comments_06.png)

To get started, simply write `/**` above the method or class definition and press enter. IntelliJ will automatically generate lines for the return value
and the parameters but you can change them however you want. There are many custom functionalities available and you can also use HTML if needed.

Minecraft's `ScreenHandler` class has some examples. To toggle the render view, use the pen button near the line numbers.

![JavaDoc editing](/assets/develop/getting-started/using-the-ide/comments_07.png)
![JavaDoc editing](/assets/develop/misc/using-the-ide/comments_07.png)

## Optimizing IntelliJ Further{#optimizing-intellij-further}

Expand Down
2 changes: 1 addition & 1 deletion sidebar_translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"develop.gettingStarted.creatingProject": "Creating a Project",
"develop.gettingStarted.projectStructure": "Project Structure",
"develop.gettingStarted.launchGame": "Launching the Game",
"develop.gettingStarted.ideTipsAndTricks": "IDE Tips and Tricks",
"develop.gettingStarted.solvingProblems": "Basic Problem-Solving",
"develop.items": "Items",
"develop.items.first-item": "Creating Your First Item",
Expand Down Expand Up @@ -52,6 +51,7 @@
"develop.misc.codecs": "Codecs",
"develop.misc.events": "Events",
"develop.misc.text-and-translations": "Text and Translations",
"develop.misc.ideTipsAndTricks": "IDE Tips and Tricks",
"develop.sounds": "Sounds",
"develop.sounds.using-sounds": "Playing Sounds",
"develop.sounds.custom": "Creating Custom Sounds"
Expand Down

0 comments on commit 5dc4146

Please sign in to comment.