Slide 1

Slide 1 text

Putting the AI in JetBrAIns Marit van Dijk Developer Advocate

Slide 2

Slide 2 text

https://blog.jetbrains.com/blog/2023/12/06/introducing-jetbrains-ai-and-the-in-ide-ai-assistant/

Slide 3

Slide 3 text

https://www.youtube.com/watch?v=SN51H_q9wBg

Slide 4

Slide 4 text

AI has always been a part of JetBrAIns
 — https://www.youtube.com/watch?v=-NnYtfzO7qU

Slide 5

Slide 5 text

Our approach to building AI Assistant into our products has been focused on two main aspects: 1. Weaving the AI assistance into the core IDE user workflows. 2. Building AI features that are deeply infused with an understanding of your code and its context, which has always been a strong suit of JetBrains IDEs. Introducing JetBrains AI

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

With AI Assistant, you can: ● Chat, ask questions, and refine solutions. ● Generate code, tests, commit messages, documentation, and code translations. ● Explain code, commits, runtime errors, SQL queries, regexes and cron fragments. ● Suggest names, refactor, and find issues. ● Resolve merge conflicts, write SQL queries for your database, generate commands in the New Terminal Features

Slide 8

Slide 8 text

Generate and improve commit messages, explain commit(s), resolve merge conflicts Continue prompting, add context & commands Generate, explain, refactor code, write tests & documentation Ask questions, edit & save prompts, see context, use code Explain runtime errors, write commands in new terminal, get help with SQL queries in console

Slide 9

Slide 9 text

JetBrains AI Assistant
 —

Slide 10

Slide 10 text

Plugin

Slide 11

Slide 11 text

Chat
 —

Slide 12

Slide 12 text

Chat ● LLMs are good at chat 😁 ● We can ● Ask how to do things ● Ask follow up questions

Slide 13

Slide 13 text

Chat ● Integrated into the IDE ● Context aware ● Can call back to the IDE

Slide 14

Slide 14 text

Chat ● Ask about your project ● Ask VCS related questions

Slide 15

Slide 15 text

Chat ● Dump chat - see the context

Slide 16

Slide 16 text

Chat ● Can add additional context

Slide 17

Slide 17 text

Chat ● Can add additional context ● Tag files, symbols & more

Slide 18

Slide 18 text

Code from chat ● Use code from chat: ● Copy to Clipboard ● Insert Snippet at Caret ● Create File from Snippet

Slide 19

Slide 19 text

Chat ● Edit original prompt

Slide 20

Slide 20 text

Chat ● Edit original prompt

Slide 21

Slide 21 text

Prompts
 —

Slide 22

Slide 22 text

AI Actions ● Predefined prompts ● Available where you code ● Can add your own!

Slide 23

Slide 23 text

Explain Code
 —

Slide 24

Slide 24 text

Explain code Selected code added to prompt

Slide 25

Slide 25 text

Explain code Files added to prompt x

Slide 26

Slide 26 text

Explain RegExp fragment

Slide 27

Slide 27 text

Explain cron fragment

Slide 28

Slide 28 text

Explain Spring Data QL fragment

Slide 29

Slide 29 text

Chat about code

Slide 30

Slide 30 text

Find and fix problems
 —

Slide 31

Slide 31 text

Find problems

Slide 32

Slide 32 text

Find problems In commit

Slide 33

Slide 33 text

Refactoring

Slide 34

Slide 34 text

Refactor | Rename ● Now with AI generated suggestions!

Slide 35

Slide 35 text

Explain Runtime Error
 —

Slide 36

Slide 36 text

Main point

Slide 37

Slide 37 text

Custom prompts
 —

Slide 38

Slide 38 text

AI Actions Add Your Prompts...

Slide 39

Slide 39 text

AI Actions Add Your Prompts...

Slide 40

Slide 40 text

AI Actions Add Your Prompts...

Slide 41

Slide 41 text

Custom prompts ● Save Current Prompt from chat

Slide 42

Slide 42 text

Custom prompts ● Show in AI Actions ● Use from chat

Slide 43

Slide 43 text

Code generation is important
 —

Slide 44

Slide 44 text

Code completion ● Auto completion while typing ● with syntax highlighting

Slide 45

Slide 45 text

Code completion Cloud completion Local completion

Slide 46

Slide 46 text

Code completion ● Shortcut for auto completion

Slide 47

Slide 47 text

Code completion ● Shortcut to generate code ● According to your prompt

Slide 48

Slide 48 text

Code completion ● Generate code in editor ● Can add a follow-up message

Slide 49

Slide 49 text

Code completion ● Note: Might need small fixes ● (Alt+Enter is your friend)

Slide 50

Slide 50 text

AI Actions Generate Code...

Slide 51

Slide 51 text

AI Actions Generate Code...

Slide 52

Slide 52 text

AI Actions Generate

Slide 53

Slide 53 text

Documentation Write Documentation

Slide 54

Slide 54 text

Tests Generate Unit Tests

Slide 55

Slide 55 text

Tests Generate Unit Tests

Slide 56

Slide 56 text

Work with VCS
 —

Slide 57

Slide 57 text

Generate commit message ● In the commit tool window ● According to default prompt

Slide 58

Slide 58 text

Customize commit message generation

Slide 59

Slide 59 text

Customize commit message generation

Slide 60

Slide 60 text

Improve commit message ● Only for commits you haven't pushed!

Slide 61

Slide 61 text

Explain commit ● Summarize changes in commit(s)

Slide 62

Slide 62 text

Resolve merge conflicts
 —

Slide 63

Slide 63 text

Resolve merge conflicts

Slide 64

Slide 64 text

Resolve merge conflicts

Slide 65

Slide 65 text

Resolve merge conflicts

Slide 66

Slide 66 text

New Terminal
 —

Slide 67

Slide 67 text

New Terminal ● Currently in beta ● Enable in Settings > Tools > Terminal

Slide 68

Slide 68 text

Use AI Assistant in the New Terminal ● Ask AI Assistant to generate command

Slide 69

Slide 69 text

Use AI Assistant in the New Terminal ● Ask AI Assistant to generate command

Slide 70

Slide 70 text

Use AI Assistant in the New Terminal ● Ask AI Assistant to generate command ● And run the command

Slide 71

Slide 71 text

Help with queries —

Slide 72

Slide 72 text

Use AI Assistant to generate queries

Slide 73

Slide 73 text

Use AI Assistant to generate queries

Slide 74

Slide 74 text

Use AI Assistant to generate queries

Slide 75

Slide 75 text

Use AI Assistant to generate queries

Slide 76

Slide 76 text

Use AI Assistant to generate queries ● Attach database schema ● Might still need small fixes ● IntelliJ IDEA has DB support

Slide 77

Slide 77 text

Use AI Assistant to generate queries

Slide 78

Slide 78 text

Convert language —

Slide 79

Slide 79 text

Convert File to Another Language

Slide 80

Slide 80 text

Let's look at an example —

Slide 81

Slide 81 text

Photography EV = Exposure value t = Exposure time N = Focal number = focal lenght / diameter of aperture EV = log2 N2 t

Slide 82

Slide 82 text

Photography ● Let's assume we have some code ● The code is not perfect

Slide 83

Slide 83 text

Photography ● Explain code

Slide 84

Slide 84 text

Photography ● Integrated into the IDE ● Can use it from the editor; no tool-switching ● But doesn't always get the context ● Let's give it a hint

Slide 85

Slide 85 text

Photography ● Rename method ev to exposure

Slide 86

Slide 86 text

Photography ● Let's ask again ● We can use specific instructions...

Slide 87

Slide 87 text

Photography ● Side note: options to use the code

Slide 88

Slide 88 text

Photography ... or use predefined prompt: • Suggest Refactoring

Slide 89

Slide 89 text

Photography Side note: options to use the code, includes Show Diff

Slide 90

Slide 90 text

Photography

Slide 91

Slide 91 text

Photography ● Note this refactor includes renaming ● Can also use Refactor > Rename ● (especially if variables are used outside this file)

Slide 92

Slide 92 text

Photography ● Ask for real world scenarios ● (Prompt engineering is a thing)

Slide 93

Slide 93 text

Photography ● Convert to JUnit 5 tests ● with expressive names

Slide 94

Slide 94 text

Photography ● including exceptions and edge cases ● (Unlike some developers...)

Slide 95

Slide 95 text

Photography ● Might need some small fixes ● Add JUnit 5

Slide 96

Slide 96 text

Photography ● Might need some small fixes ● Add JUnit 5 ● Import statements

Slide 97

Slide 97 text

Photography ● The numbers don't add up

Slide 98

Slide 98 text

Photography Large Language Models ... are not good at math https://www.youtube.com/watch?v=0xENpeGTEZ0

Slide 99

Slide 99 text

Photography ● Get real world data ● Talk to some users

Slide 100

Slide 100 text

Photography ● AI Actions > Generate unit tests

Slide 101

Slide 101 text

Photography ● Tests generated in existing test file or new file

Slide 102

Slide 102 text

Photography ● Add additional specifications...

Slide 103

Slide 103 text

Photography ... for better results

Slide 104

Slide 104 text

Photography These tests also fail.. (Remember: LLMs are not good at math)

Slide 105

Slide 105 text

Photography But are generated in the right place

Slide 106

Slide 106 text

Photography ● You can specify how to generate unit tests ● Customize prompt in Settings: ● Tools > AI Assistant > Prompt Library

Slide 107

Slide 107 text

Photography ● Generate commit message

Slide 108

Slide 108 text

Productivity —

Slide 109

Slide 109 text

AI Assistant ● Can save time ● Boilerplate code / typing ● Tasks we don't like to do ● Understanding existing code!

Slide 110

Slide 110 text

Productivity boost https://blog.jetbrains.com/ai/2024/04/developers-save-up-to-8-hours-per-week-with-jetbrains-ai-assistant/

Slide 111

Slide 111 text

Time saved https://blog.jetbrains.com/ai/2024/04/developers-save-up-to-8-hours-per-week-with-jetbrains-ai-assistant/

Slide 112

Slide 112 text

Productivity boost https://blog.jetbrains.com/ai/2024/04/developers-save-up-to-8-hours-per-week-with-jetbrains-ai-assistant/

Slide 113

Slide 113 text

Top 5 Features https://blog.jetbrains.com/ai/2024/04/developers-save-up-to-8-hours-per-week-with-jetbrains-ai-assistant/

Slide 114

Slide 114 text

Top 5 Features Personal observation: This does not include generating code! https://blog.jetbrains.com/ai/2024/04/developers-save-up-to-8-hours-per-week-with-jetbrains-ai-assistant/

Slide 115

Slide 115 text

The journey —

Slide 116

Slide 116 text

JetBrains AI Service API API Security & Anti-Fraud 3rd Party LLM API Plugin Project Context

Slide 117

Slide 117 text

https://blog.jetbrains.com/blog/2024/04/04/full-line-code-completion-in-jetbrains-ides-all-you-need-to-know/

Slide 118

Slide 118 text

https://www.youtube.com/watch?v=DLBiJ5kYUFg Full line code completion
 —

Slide 119

Slide 119 text

JetBrains AI Service API API Security & Anti-Fraud 3rd Party LLM API Plugin Project Context FLCC Context

Slide 120

Slide 120 text

JetBrains AI Service Kotlin LM API API Security & Anti-Fraud 3rd Party LLM API Plugin Project Context FLCC Context

Slide 121

Slide 121 text

https://www.youtube.com/watch?v=1ipJ-tdcmwE

Slide 122

Slide 122 text

https://www.jetbrains.com/ai/enterprise/ JetBrains AI Enterprise
 —

Slide 123

Slide 123 text

https://www.jetbrains.com/ai/enterprise/ JetBrains AI Enterprise
 —

Slide 124

Slide 124 text

JetBrains AI Service Kotlin LM API API Security & Anti-Fraud API Plugin Project Context FLCC Context Alibaba (China) API API

Slide 125

Slide 125 text

https://blog.jetbrains.com/idea/2024/09/intellij-idea-2024-3-eap-3/ New features
 —

Slide 126

Slide 126 text

More information —

Slide 127

Slide 127 text

https://www.jetbrains.com/ai/

Slide 128

Slide 128 text

https://www.jetbrains.com/ai/

Slide 129

Slide 129 text

https://www.jetbrains.com/ai/enterprise/

Slide 130

Slide 130 text

https://www.jetbrains.com/guide/ai/

Slide 131

Slide 131 text

Slides & more — https://maritvandijk.com/presentations/putting-the-ai-in-jetbrains/

Slide 132

Slide 132 text

Thank you! Marit van Dijk Developer Advocate