-
Notifications
You must be signed in to change notification settings - Fork 3
Development
You need to install the following tools for building JavaComp from source code:
- JDK 8 or above
- Bazel
To build the jar, cd
to the directory of the source code, then build it with
the bazel build
command:
bazel build //src/main/java/org/javacomp/server:JavaComp_deploy.jar
The jar file is available at
bazel-bin/src/main/java/org/javacomp/server/JavaComp_deploy.jar
To run all tests, use the bazel test
command:
bazel test ... -k
The -k
option allows skipping failed tests.
JavaComp follows Google Java Style.
Use the Google Java format tool to format the Java code. The fix-format.sh script can help formatting all changed .java files.
Several tools are available for helping development.
This script can fix the code styles for .java files and BUILD files. It requires the following tools:
To run it, cd
to the repository root directory and run
script/fix-format.sh -f -c
Option -f
tells the script to change the files for fixing the style issues.
-c
means only check the files that are changed but not committed yet.
AstPrinter prints the JCCompilationUnit
of a .java file parsed by javac
parser. It's useful for debugging and developing FileContentFixer
.
To run it, make sure your current directory is in the repository and run:
bazel run //src/main/java/org/javacomp/tool:AstPrinter -- [-f] <java-filename>
<java-filename>
is the filename of the .java file. If option -f
is present,
the content of the .java file will be modified by FileContentFixer
before
parsing.
ScopePrinter prints the internal representation of a parsed .java file. It's useful for debugging completion or parsing bugs.
To run it, make sure your current directory is in the repository and run:
bazel run //src/main/java/org/javacomp/tool:ScopePrinter -- [-f] <java-filename>
<java-filename>
is the filename of the .java file. If option -f
is present,
the content of the .java file will be modified by FileContentFixer
before
parsing.