JavaComp implements Language Server Protocol for Java language. It provides language editing features such as code completion, showing method signatures and jumping to definitions to editors that support the protocol.
See the installation guide for your editor:
- Emacs: lsp-javacomp
- Visual Studio Code: javacomp-vscode
You can put a javacomp.json
file under the project root directory to customize
the behavior of JavaComp.
Example javacomp.json
file content:
{
"logPath": "/tmp/javacomp.log",
"logLevel": "fine",
"typeIndexFiles": ["typeindeces/guava.json"],
"ignorePaths": ["*.bak", ".*"]
}
The schema of the JSON is defined by the InitializationOptions
class in
InitializeParams.java. The initializationOptions
field of the initialize
Request accepts the same format
as javacomp.json
. Editor plugins can set initializationOptions
to customize
JavaComp. If both javacomp.json
and initializationOptions
exist,
initializationOptions
overrides javacomp.json
.
Below are supported options. The source of truth of the supported options is the
(String) Path of the log file. If not set, logs are not written to any file.
(String) The minimum log level. Logs with the level and above will be logged.
Possible values are: severe
, warning
, info
, fine
, finer
, finest
.
(String) Pattern of paths that JavaComp should ignore.
The patterns are valid Java path glob patterns defined by the documentation of
java.nio.file.FileSystem#getPathMatcher
without glob:
prefix.
When determing whether a path of a file or directory should be ignored, the path
is converted into 2 froms: the filename and pseudo absolute path. A pseudo
absolute path is the path without the prefix of project root path. For example,
if a path is /root/path/foo/bar
and the project root path is /root/path
, its
pseudo absolute path is /foo/bar
. If a path is not under project root, its
pseudo absolute path is itself.
Both filename of the path and its pseudo absolute path are checked by all ignore path patterns. If either form matches any of the patterns, the path is ignored.
(Array of strings) A list of file paths that contains additional type indeces generated by the Indexer tool.
The path can be either relative to the project root path, or an absolute path.
See our Wiki page.