WEBVTT

1
00:00:01.600 --> 00:00:04.720
Now, besides this inline chat here,

2
00:00:05.220 --> 00:00:06.800
Cursor, like GitHub Copilot,

3
00:00:06.980 --> 00:00:09.940
also has this separate chat window,

4
00:00:11.540 --> 00:00:15.400
which you can open with this button

5
00:00:15.400 --> 00:00:16.420
if you highlight some code,

6
00:00:16.600 --> 00:00:18.180
or with this shortcut.

7
00:00:18.780 --> 00:00:19.960
If you have some code selected,

8
00:00:20.060 --> 00:00:21.760
it automatically gets pasted in there

9
00:00:21.760 --> 00:00:22.380
as a reference.

10
00:00:23.770 --> 00:00:25.180
If you have no code selected,

11
00:00:25.320 --> 00:00:26.560
it's just a current file

12
00:00:26.560 --> 00:00:27.900
that's added as a reference.

13
00:00:28.000 --> 00:00:29.140
So as context.

14
00:00:30.260 --> 00:00:30.980
And then again,

15
00:00:31.100 --> 00:00:32.420
you can ask anything,

16
00:00:32.900 --> 00:00:35.940
though this is really not chat GPT

17
00:00:35.940 --> 00:00:37.420
in the editor.

18
00:00:37.740 --> 00:00:38.860
Instead, it is a chat

19
00:00:38.860 --> 00:00:41.280
that focuses on coding-related tasks.

20
00:00:41.920 --> 00:00:43.880
So asking about the weather tomorrow

21
00:00:43.880 --> 00:00:45.140
might work,

22
00:00:45.300 --> 00:00:46.560
but it's definitely not

23
00:00:46.560 --> 00:00:48.400
what this chat is optimized for.

24
00:00:49.860 --> 00:00:52.080
Now, you can add more context here

25
00:00:52.080 --> 00:00:54.160
also by pressing add,

26
00:00:54.640 --> 00:00:56.660
or by pressing the plus here,

27
00:00:57.000 --> 00:00:59.840
which allows you to pick files

28
00:00:59.840 --> 00:01:01.700
that you want to add as context,

29
00:01:01.920 --> 00:01:03.500
so that if you have a question

30
00:01:03.500 --> 00:01:06.420
that actually involves multiple files,

31
00:01:06.640 --> 00:01:08.360
the code from multiple files,

32
00:01:08.420 --> 00:01:09.420
you could easily add that.

33
00:01:10.580 --> 00:01:11.460
But alternatively,

34
00:01:11.520 --> 00:01:13.180
you can also use add files here

35
00:01:13.180 --> 00:01:14.640
to add multiple files

36
00:01:14.640 --> 00:01:15.920
if you wanted to.

37
00:01:17.080 --> 00:01:19.560
So all that is, of course, possible.

38
00:01:20.360 --> 00:01:22.500
You can also refer entire folders

39
00:01:22.500 --> 00:01:24.679
to take a look at all the files

40
00:01:24.679 --> 00:01:26.420
in that folder, for example.

41
00:01:27.680 --> 00:01:29.420
And you can also just start

42
00:01:29.420 --> 00:01:32.080
typing a file name after typing add,

43
00:01:32.340 --> 00:01:33.640
for example, index.js,

44
00:01:33.920 --> 00:01:35.980
to use one of these index.js files

45
00:01:35.980 --> 00:01:37.140
as context.

46
00:01:37.960 --> 00:01:40.320
And you get a preview of that file here.

47
00:01:40.480 --> 00:01:41.300
You can open it

48
00:01:41.300 --> 00:01:43.540
so that you see which kind of context

49
00:01:43.540 --> 00:01:44.980
you're adding to the chat.

50
00:01:46.660 --> 00:01:48.200
And then, just as before,

51
00:01:48.520 --> 00:01:49.880
just as with GitHub Copilot,

52
00:01:50.000 --> 00:01:52.240
you can ask any question here

53
00:01:52.000 --> 00:01:54.720
to get answers about your code

54
00:01:54.720 --> 00:01:56.460
or to generate new code

55
00:01:56.460 --> 00:01:57.480
or adjust the code.

56
00:01:57.600 --> 00:01:58.620
All that is possible

57
00:01:58.620 --> 00:02:01.200
and works pretty much as it did

58
00:02:01.200 --> 00:02:02.540
with GitHub Copilot.

59
00:02:03.980 --> 00:02:05.280
For example, here,

60
00:02:05.380 --> 00:02:06.840
I could refer to my,

61
00:02:07.619 --> 00:02:12.020
let's say, tables.js file.

62
00:02:13.460 --> 00:02:17.040
And I could ask a question here

63
00:02:17.040 --> 00:02:18.480
or give an instruction

64
00:02:19.000 --> 00:02:21.240
and say add a route

65
00:02:21.240 --> 00:02:23.780
that allows people

66
00:02:23.780 --> 00:02:26.200
to edit a reservation

67
00:02:26.200 --> 00:02:29.840
and change the number of people,

68
00:02:30.440 --> 00:02:32.120
time, or date.

69
00:02:33.620 --> 00:02:35.140
Now, if you hit enter,

70
00:02:35.500 --> 00:02:36.800
you confirm this.

71
00:02:37.180 --> 00:02:39.080
If you, however, hit command

72
00:02:39.080 --> 00:02:40.160
or control enter

73
00:02:40.160 --> 00:02:42.240
or whichever shortcut you see here,

74
00:02:42.920 --> 00:02:46.580
then you will also send this message

75
00:02:46.580 --> 00:02:47.540
to cursor,

76
00:02:47.140 --> 00:02:48.840
but it will automatically

77
00:02:48.840 --> 00:02:50.620
take your entire code base

78
00:02:50.620 --> 00:02:51.320
as context.

79
00:02:52.380 --> 00:02:53.820
So then you don't even need

80
00:02:53.820 --> 00:02:55.860
to add a specific file,

81
00:02:56.180 --> 00:02:57.460
at least that's the theory,

82
00:02:57.720 --> 00:02:59.240
because it will automatically

83
00:02:59.240 --> 00:03:01.460
take a look at all your files

84
00:03:01.460 --> 00:03:03.080
or it will automatically try

85
00:03:03.080 --> 00:03:04.680
to use your entire code base

86
00:03:04.680 --> 00:03:05.520
as context.

87
00:03:06.680 --> 00:03:08.220
So that's what I'll do here.

88
00:03:08.740 --> 00:03:09.380
And therefore,

89
00:03:09.500 --> 00:03:10.240
it now takes a look

90
00:03:10.240 --> 00:03:11.620
at these different files,

91
00:03:12.820 --> 00:03:13.920
as you can tell,

92
00:03:14.260 --> 00:03:15.540
and it identifies

93
00:03:15.540 --> 00:03:17.720
the tables.js file correctly.

94
00:03:19.600 --> 00:03:20.240
And in there,

95
00:03:20.400 --> 00:03:22.040
it's now updating the code

96
00:03:22.040 --> 00:03:25.620
to also add a route,

97
00:03:26.080 --> 00:03:26.960
a put route here,

98
00:03:27.120 --> 00:03:28.260
which allows me to edit

99
00:03:28.260 --> 00:03:29.400
an existing reservation.

100
00:03:30.840 --> 00:03:33.840
Now I can click on tables.js

101
00:03:33.840 --> 00:03:34.800
to be taken there

102
00:03:34.800 --> 00:03:36.740
and I can click apply

103
00:03:37.760 --> 00:03:38.980
and then, of course,

104
00:03:39.080 --> 00:03:40.600
I see which changes

105
00:03:40.600 --> 00:03:41.900
are about to be made

106
00:03:43.000 --> 00:03:45.080
so that I can validate them.

107
00:03:45.280 --> 00:03:46.220
I can reject them,

108
00:03:46.700 --> 00:03:47.580
I can accept them,

109
00:03:47.920 --> 00:03:48.940
also by pressing

110
00:03:49.680 --> 00:03:51.020
this shortcut here.

111
00:03:51.580 --> 00:03:52.560
So I'll accept them here

112
00:03:52.560 --> 00:03:54.200
and I added this route.

113
00:03:55.460 --> 00:03:56.440
Now, as always,

114
00:03:56.720 --> 00:03:57.540
you're a developer,

115
00:03:57.720 --> 00:03:59.560
you should take a closer look

116
00:03:59.560 --> 00:04:00.120
at the code

117
00:04:00.120 --> 00:04:01.620
that's generated by AI.

118
00:04:01.860 --> 00:04:02.660
You should make sure

119
00:04:02.660 --> 00:04:03.760
that it works the way it should.

120
00:04:04.040 --> 00:04:04.820
You should feel free

121
00:04:04.820 --> 00:04:05.460
to tweak it.

122
00:04:05.920 --> 00:04:06.480
But of course,

123
00:04:06.620 --> 00:04:07.380
as you can tell,

124
00:04:07.720 --> 00:04:09.420
that's a pretty quick way

125
00:04:09.420 --> 00:04:10.620
of adding code,

126
00:04:10.740 --> 00:04:11.620
in this case,

127
00:04:11.980 --> 00:04:12.660
through the chat.

128
00:04:12.460 --> 00:04:14.040
Instead of through

129
00:04:14.040 --> 00:04:15.400
the suggestions mode.

130
00:04:16.920 --> 00:04:18.019
Both is fine.

131
00:04:18.380 --> 00:04:19.839
It comes down to preference

132
00:04:19.839 --> 00:04:21.440
and to the specific use case,

133
00:04:21.740 --> 00:04:22.440
what you want to use.

134
00:04:22.560 --> 00:04:23.400
And of course,

135
00:04:23.540 --> 00:04:24.900
you'll see more examples later

136
00:04:24.900 --> 00:04:26.940
once we build a complete application

137
00:04:26.940 --> 00:04:27.800
with cursor.

