doc/ide.html
author iklam
Wed, 13 Nov 2019 19:55:11 -0800
changeset 59072 b987ea528c21
parent 55166 2ae056696b15
permissions -rw-r--r--
8234133: VM build broken due to memory/archiveUtils.inline.hpp Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55166
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     1
<!DOCTYPE html>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     2
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     3
<head>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     4
  <meta charset="utf-8" />
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     5
  <meta name="generator" content="pandoc" />
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     6
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     7
  <title>IDE support in the JDK</title>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     8
  <style type="text/css">
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
     9
      code{white-space: pre-wrap;}
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    10
      span.smallcaps{font-variant: small-caps;}
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    11
      span.underline{text-decoration: underline;}
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    12
      div.column{display: inline-block; vertical-align: top; width: 50%;}
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    13
  </style>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    14
  <link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    15
  <!--[if lt IE 9]>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    16
    <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    17
  <![endif]-->
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    18
</head>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    19
<body>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    20
<header id="title-block-header">
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    21
<h1 class="title">IDE support in the JDK</h1>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    22
</header>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    23
<nav id="TOC">
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    24
<ul>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    25
<li><a href="#introduction">Introduction</a><ul>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    26
<li><a href="#ide-support-for-native-code">IDE support for native code</a></li>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    27
<li><a href="#ide-support-for-java-code">IDE support for Java code</a></li>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    28
</ul></li>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    29
</ul>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    30
</nav>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    31
<h2 id="introduction">Introduction</h2>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    32
<p>When you are familiar with building and testing the JDK, you may want to configure an IDE to work with the source code. The instructions differ a bit depending on whether you are interested in working with the native (C/C++) or the Java code.</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    33
<h3 id="ide-support-for-native-code">IDE support for native code</h3>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    34
<p>There are a few ways to generate IDE configuration for the native sources, depending on which IDE to use.</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    35
<h4 id="visual-studio-code">Visual Studio Code</h4>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    36
<p>The make system can generate a <a href="https://code.visualstudio.com">Visual Studio Code</a> workspace that has C/C++ source indexing configured correctly, as well as launcher targets for tests and the Java launcher. After configuring, a workspace for the configuration can be generated using:</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    37
<pre class="shell"><code>make vscode-project</code></pre>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    38
<p>This creates a file called <code>jdk.code-workspace</code> in the build output folder. The full location will be printed after the workspace has been generated. To use it, choose <code>File -&gt; Open Workspace...</code> in Visual Studio Code.</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    39
<h5 id="alternative-indexers">Alternative indexers</h5>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    40
<p>The main <code>vscode-project</code> target configures the default C++ support in Visual Studio Code. There are also other source indexers that can be installed, that may provide additional features. It's currently possible to generate configuration for two such indexers, <a href="https://clang.llvm.org/extra/clangd/">clangd</a> and <a href="https://github.com/Andersbakken/rtags">rtags</a>. These can be configured by appending the name of the indexer to the make target, such as:</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    41
<pre class="shell"><code>make vscode-project-clangd</code></pre>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    42
<p>Additional instructions for configuring the given indexer will be displayed after the workspace has been generated.</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    43
<h4 id="visual-studio">Visual Studio</h4>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    44
<p>This section is a work in progress.</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    45
<pre class="shell"><code>make ide-project</code></pre>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    46
<h4 id="compilation-database">Compilation Database</h4>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    47
<p>The make system can generate generic native code indexing support in the form of a <a href="https://clang.llvm.org/docs/JSONCompilationDatabase.html">Compilation Database</a> that can be used by many different IDEs and source code indexers.</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    48
<pre class="shell"><code>make compile-commands</code></pre>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    49
<p>It's also possible to generate the Compilation Database for the HotSpot source code only, which is a bit faster as it includes less information.</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    50
<pre class="shell"><code>make compile-commands-hotspot</code></pre>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    51
<h3 id="ide-support-for-java-code">IDE support for Java code</h3>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    52
<p>This section is a work in progress.</p>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    53
</body>
2ae056696b15 8223678: Add Visual Studio Code workspace generation support (for native code)
rwestberg
parents:
diff changeset
    54
</html>