1% IDE support in the JDK
2
3## Introduction
4
5When you are familiar with building and testing the JDK, you may want to
6configure an IDE to work with the source code. The instructions differ a bit
7depending on whether you are interested in working with the native (C/C++) or
8the Java code.
9
10### IDE support for native code
11
12There are a few ways to generate IDE configuration for the native sources,
13depending on which IDE to use.
14
15#### Visual Studio Code
16
17The make system can generate a [Visual Studio Code](https://code.visualstudio.com)
18workspace that has C/C++ source indexing configured correctly, as well as
19launcher targets for tests and the Java launcher. After configuring, a workspace
20for the configuration can be generated using:
21
22```shell
23make vscode-project
24```
25
26This creates a file called `jdk.code-workspace` in the build output folder. The
27full location will be printed after the workspace has been generated. To use it,
28choose `File -> Open Workspace...` in Visual Studio Code.
29
30##### Alternative indexers
31
32The main `vscode-project` target configures the default C++ support in Visual
33Studio Code. There are also other source indexers that can be installed, that
34may provide additional features. It's currently possible to generate
35configuration for two such indexers, [clangd](https://clang.llvm.org/extra/clangd/)
36and [rtags](https://github.com/Andersbakken/rtags). These can be configured by
37appending the name of the indexer to the make target, such as:
38
39```shell
40make vscode-project-clangd
41```
42
43Additional instructions for configuring the given indexer will be displayed
44after the workspace has been generated.
45
46#### Visual Studio
47
48This section is a work in progress.
49
50```shell
51make ide-project
52```
53
54#### Compilation Database
55
56The make system can generate generic native code indexing support in the form of
57a [Compilation Database](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
58that can be used by many different IDEs and source code indexers.
59
60```shell
61make compile-commands
62```
63
64It's also possible to generate the Compilation Database for the HotSpot source
65code only, which is a bit faster as it includes less information.
66
67```shell
68make compile-commands-hotspot
69```
70
71### IDE support for Java code
72
73This section is a work in progress.