generated from jetbrains-academy/kotlin-course-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from jetbrains-academy/stephen-hero-patch-1
Update task.md
- Loading branch information
Showing
20 changed files
with
104 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ | |
[![Gradle Build With Detekt](https://github.com/jetbrains-academy/kotlin-course-template/actions/workflows/gradle-build-with-detekt.yml/badge.svg)](https://github.com/jetbrains-academy/kotlin-course-template/actions/workflows/gradle-build-with-detekt.yml) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
|
||
This course is designed for novices in plugin development for JetBrains IDEs. It covers the basics of plugin development and provides a hands-on experience in working with PSI (Program Structure Interface) elements. | ||
The main goal of the course is not to rewrite the existing documentation, but rather to cover popular topics and provide links to the official documentation, so that the students can get used to reading the documentation and searching for the necessary information. | ||
This course is designed for novices in plugin development for JetBrains IDEs. It covers the basics of plugin development and provides hands-on experience in working with PSI (Program Structure Interface) elements. | ||
The main goal of the course is not to rewrite the existing documentation but rather to cover popular topics and provide links to the official documentation so that students can get used to reading the documentation and searching for necessary information. | ||
|
||
Each lesson of the course consist of a theoretical task and a few programming tasks. The theoretical tasks are designed to help you understand the topic, while the programming tasks aim to apply the acquired knowledge. | ||
At the end of each chapter, an additional final project will be offered. It includes all the topics of the lesson but does not contain theory part. It is divided into multiple tasks, and by completing them step by step, you will get a finished small project in the end. | ||
Each lesson of the course consists of a theoretical task and a few programming tasks. The theoretical tasks are designed to help you understand the topic, while the programming tasks aim to apply the acquired knowledge. | ||
At the end of each chapter, an additional final project will be offered. It includes all the topics of the lesson but does not contain a theory part. It is divided into multiple tasks, and by completing them step by step, you will get a finished small project in the end. | ||
|
||
Topics covered: | ||
* Accessing PSI elements | ||
|
@@ -18,14 +18,14 @@ Topics covered: | |
|
||
## Technical requirements | ||
|
||
Before starting this course, check the following requirements. | ||
Before starting this course, please check the following requirements: | ||
|
||
1. Your computer needs to have a stable internet connection. | ||
2. Git version control system needs to be installed on your computer (link to the git site: https://git-scm.com/). | ||
3. Make sure that the path to the root folder of the course does not contain spaces, special characters, or non-Latin characters. | ||
4. Make sure that you use the [Intellij IDEA](https://www.jetbrains.com/idea/download/?_ga=2.189310830.494255415.1682514714-1823138827.1669894241&_gac=1.83806948.1682684894.Cj0KCQjw3a2iBhCFARIsAD4jQB3QkDU43KtbIx2HzEz02KvcN7Ma3QGzkIbyX4KS3H4x8b2bl9p4EfYaAvWsEALw_wcB&_gl=1*1h13lr8*_ga*MTgyMzEzODgyNy4xNjY5ODk0MjQx*_ga_9J976DJZ68*MTY4MjY5NDIyMy4xMjUuMS4xNjgyNjk0MjM4LjQ1LjAuMA..#section=windows) with version at least `2023.1.1`. | ||
5. Make sure that you use the [JetBrains Academy](https://plugins.jetbrains.com/plugin/10081-jetbrains-academy) plugin with version at least `2023.1`. | ||
1. Ensure that your computer has a stable internet connection. | ||
2. Install the Git version control system on your computer (link to the Git site: https://git-scm.com/). | ||
3. Ensure that the path to the root folder of the course does not contain spaces, special characters, or non-Latin characters. | ||
4. Make sure you are using [IntelliJ IDEA](https://www.jetbrains.com/idea/download/?_ga=2.189310830.494255415.1682514714-1823138827.1669894241&_gac=1.83806948.1682684894.Cj0KCQjw3a2iBhCFARIsAD4jQB3QkDU43KtbIx2HzEz02KvcN7Ma3QGzkIbyX4KS3H4x8b2bl9p4EfYaAvWsEALw_wcB&_gl=1*1h13lr8*_ga*MTgyMzEzODgyNy4xNjY5ODk0MjQx*_ga_9J976DJZ68*MTY4MjY5NDIyMy4xMjUuMS4xNjgyNjk0MjM4LjQ1LjAuMA..#section=windows) with a version of at least `2023.1.1`. | ||
5. Ensure that you are using the [JetBrains Academy](https://plugins.jetbrains.com/plugin/10081-jetbrains-academy) plugin with a version of at least `2023.1`. | ||
|
||
The course is integrated into the [Intellij Idea IDE](https://www.jetbrains.com/idea/), which has a free Community license. | ||
The course is integrated into the [IntelliJ IDEA IDE](https://www.jetbrains.com/idea/), which has a free Community license. | ||
You can use this license to complete the course. | ||
If you have some troubles with the course installation, feel free to contact us by email at [email protected]. | ||
If you encounter any issues with the course installation, feel free to contact us by email at [email protected]. |
8 changes: 4 additions & 4 deletions
8
introductionSection/setupLesson/internalModeSetupTask/task.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Setup | ||
|
||
To have access to some internal actions you need to enable `Internal Mode`. | ||
Please, follow steps in internal mode instruction configuration [by this link](https://plugins.jetbrains.com/docs/intellij/enabling-internal.html) and enable it in your IDE. | ||
To access some internal actions, you need to enable `Internal Mode`. | ||
Please follow the steps in the internal mode instruction configuration [at this link](https://plugins.jetbrains.com/docs/intellij/enabling-internal.html) and enable it in your IDE. | ||
|
||
**Do not forget to restart you IDE after changing idea.properties file!!!** | ||
**Do not forget to restart you IDE after changing the idea.properties file!!!** | ||
|
||
Also, following gif will show you how Helena done this in her IDE. | ||
Also, the following GIF will show you how Helena did this in her IDE. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Say hello to Helena! Add implementation to method `helloHelena` method which should return “Hello, Helena!” given number of times, separated by new line. | ||
Say hello to Helena! Add an implementation to the `helloHelena` method, which should return “Hello, Helena!” a given number of times. Each greeting should be separated by a newline. | ||
|
||
<div class="hint" title="How to get platform-specific new line symbol?"> | ||
<div class="hint" title="How to get a platform-specific newline symbol?"> | ||
|
||
Use `System.lineSeparator()` to get platform-specific new line symbol | ||
</div> | ||
Use `System.lineSeparator()` to get a platform-specific newline symbol. | ||
</div> |
4 changes: 2 additions & 2 deletions
4
introductionSection/welcomeLesson/helloHelenaTheoryTask/task.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Hi! My name is Helena. I’m working in the Plugin Development Team. We have just hired a new young developer, Jonsi, so I’ve prepared lots of amazing projects for him to do. | ||
Hi! My name is Helena. I’m working in the Plugin Development Team. We have just hired a new young developer, Jonsi, so I’ve prepared lots of amazing projects for him to tackle. | ||
|
||
But wait, he has never worked with IntelliJ Platform before?! So well, I’ll try to teach him all important things during one week of his probation. | ||
But wait, he has never worked with the IntelliJ Platform before?! Well, I’ll try to teach him all the important things during the one week of his probation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Hi! My name is Jonsi! It’s my first day at JetBrains, and I’m ready to start! But I’m really nervous of my probation week as I have no idea, how IDE works behind and what is more, how to write plugins for it. | ||
Hi! My name is Jonsi! It’s my first day at JetBrains, and I’m ready to get started! But I’m really nervous about my probation week, since I have no idea how an IDE works behind the scenes, and what's more, I don't know how to write plugins for it. | ||
|
||
So I really need someone's help!!! | ||
So, I really need someone's help!!! | ||
|
||
Maybe you can help me? |
10 changes: 5 additions & 5 deletions
10
psiSection/accessingPsiElementsLesson/accessingPsiElementsProgrammingTask/task.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 13 additions & 13 deletions
26
psiSection/editingPsiElementsLesson/editingPsiElementsTheoryTask/task.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
All operations with code like adding, deleting or moving methods, renaming variable, you name it, are implemented as PSI editions. | ||
Please skim the [Modify the PSI](https://plugins.jetbrains.com/docs/intellij/modifying-psi.html) documentation. | ||
All operations involving code modifications, such as adding, deleting, or moving methods, renaming variables, etc., are implemented as PSI edits. | ||
Please review the [Modify the PSI](https://plugins.jetbrains.com/docs/intellij/modifying-psi.html) documentation. | ||
|
||
Common methods to edit PSI Element: | ||
* [`PsiElement.copy()`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L293) - to copy PSI Element subtree | ||
* [`PsiElement.replace()`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L402) - to replace PSI Element in tree | ||
* [`PsiElement.delete()`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L373) - to delete PSI Element from tree | ||
* [`PsiElement:add`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L302) - to add a child into the PSI Element subtree | ||
* [`PsiElement:addBefore`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L312C14-L312C23) / [`PsiElement:addAfter`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L322) - to add a child into the PSI Element subtree before / after the specified anchor element | ||
* [`PsiElement:addRange`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L343) - to add a list of children into the PSI Element subtree | ||
* [`PsiElement:addRangeBefore`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L354) / [`PsiElement:addRangeAfter`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L365)- to add a list of children into the PSI Element subtree before / after the specified anchor element | ||
Common methods to edit PSI elements include: | ||
* [`PsiElement.copy()`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L293) - Copies the PSI element subtree. | ||
* [`PsiElement.replace()`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L402) - Replaces the PSI element in the tree. | ||
* [`PsiElement.delete()`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L373) - Deletes the PSI element from the tree. | ||
* [`PsiElement:add`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L302) - Adds a child to the PSI element subtree. | ||
* [`PsiElement:addBefore`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L312C14-L312C23) / [`PsiElement:addAfter`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L322) - Adds a child to the PSI element subtree before/after the specified anchor element. | ||
* [`PsiElement:addRange`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L343) - Adds a list of children to the PSI element subtree. | ||
* [`PsiElement:addRangeBefore`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L354) / [`PsiElement:addRangeAfter`](https://github.com/JetBrains/intellij-community/blob/19d9a1cc2d9c14df9c3bdee391e9e4795ac25cb9/platform/core-api/src/com/intellij/psi/PsiElement.java#L365)- Adds a list of children to the PSI element subtree before/after the specified anchor element. | ||
|
||
|
||
Moreover, there are some PisElement-specific methods like [`KtNamedFunction:setName`](https://github.com/JetBrains/intellij-community/blob/bf3083ca66771e038eb1c64128b4e508f52acfad/platform/core-api/src/com/intellij/psi/PsiNamedElement.java#L39) or as well as all `PsiNamedElement` inheritors. | ||
Moreover, there are some PsiElement-specific methods like [`KtNamedFunction:setName`](https://github.com/JetBrains/intellij-community/blob/bf3083ca66771e038eb1c64128b4e508f52acfad/platform/core-api/src/com/intellij/psi/PsiNamedElement.java#L39) and methods available to all `PsiNamedElement` inheritors. | ||
|
||
**IMPORTANT!** | ||
|
||
Every PSI modifications need to be wrapped in a [write action and in command](https://github.com/JetBrains/intellij-community/blob/master/platform/core-api/src/com/intellij/openapi/command/WriteCommandAction.java) | ||
Every PSI modification needs to be wrapped in a [write action and command](https://github.com/JetBrains/intellij-community/blob/master/platform/core-api/src/com/intellij/openapi/command/WriteCommandAction.java) | ||
|
||
```kotlin | ||
WriteCommandAction.runWriteCommandAction(project) { | ||
// Here you can modify PSI Elements | ||
// Here you can modify PSI elements | ||
} | ||
``` |
18 changes: 9 additions & 9 deletions
18
psiSection/editingPsiElementsLesson/renameFunctionProgrammingTask/task.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
Sometimes, switching between Python and Kotlin leeds to following code style mistake: | ||
Sometimes, switching between Python and Kotlin leads to the following code style mistake: | ||
|
||
Python developers usually use `snake_case` for methods naming like | ||
Python developers usually use `snake_case` for method naming, like: | ||
```python | ||
def sort_values(values): | ||
``` | ||
While in Kotlin or Java `camelCase` is commonly used | ||
In contrast, Kotlin and Java commonly use `camelCase`: | ||
```Kotlin | ||
fun sortValues(values: List<Int>) {...} | ||
``` | ||
|
||
**Your task will be** to help such multi-language programmers and | ||
implement method which renames `snake_case` named method to `camelCase`. | ||
**Your task will be** to assist multi-language programmers by | ||
implementing a method that renames `snake_case` methods to `camelCase`. | ||
|
||
So before your method invocation method looked like: | ||
Before your method invocation, the method might look like: | ||
```Kotlin | ||
fun sort_values(values: List<Int>) {...} | ||
``` | ||
but after | ||
After: | ||
```Kotlin | ||
fun sortValues(values: List<Int>) {...} | ||
``` | ||
|
||
<div class="hint" title="How to get project for WriteActionCommand?"> | ||
<div class="hint" title="How to get the project for WriteActionCommand?"> | ||
|
||
Every PSI element has link to project, just try `psiElement.project` | ||
Every PSI element has a link to the project; just try `psiElement.project`. | ||
</div> |
Oops, something went wrong.