@@ -5,10 +5,10 @@ title: Design
55
66This project is implemented as a
77[ Java compiler plugin] ( https://docs.oracle.com/en/java/javase/11/docs/api/jdk.compiler/com/sun/source/util/Plugin.html )
8- that generates one
9- [ SCIP] ( https://scalameta.org/docs/ scip/specification.html ) file for
10- every ` *.java ` source file. After compilation completes, the SCIP files
11- are processed to produce SCIP.
8+ that generates one partial
9+ [ SCIP] ( https://github.com/ scip-code/scip ) index (a "shard") for
10+ every ` *.java ` source file. After compilation completes, the per-file SCIP
11+ shards are merged into a single SCIP index .
1212
1313### Why Java compiler plugin?
1414
@@ -25,20 +25,21 @@ There are several benefits to implementing scip-java as a compiler plugin:
2525 installed system dependencies, custom compiler options and custom annotation
2626 processors.
2727
28- ### Why SCIP?
28+ ### Why per-file SCIP shards ?
2929
30- SCIP is Protobuf schema for information about symbols and types in Java
31- programs and other languages. There are several benefits to using SCIP as
32- an intermediary representation for SCIP:
30+ [ SCIP] ( https://github.com/scip-code/scip ) is a Protobuf schema for information
31+ about symbols and types in Java programs and other languages. There are several
32+ benefits to emitting one SCIP shard per source file and merging them afterwards :
3333
3434- ** Simplicity** : It's easy to translate a single Java source file into a single
35- SCIP file inside a compiler plugin. It's more complicated to produce
36- SCIP because compiler plugins does not have access to a project-wide context,
37- which is necessary to produce accurate definitions and hovers in multi-module
38- projects with external library dependencies.
39- - ** Performance** : SCIP is fast to write and read. Each compilation unit
40- can be processed independently to keep memory usage low. The final conversion
41- from SCIP to SCIP can be safely parallelized.
35+ SCIP shard inside a compiler plugin. It's more complicated to produce a
36+ complete project-wide index directly because compiler plugins do not have
37+ access to a project-wide context, which is necessary to produce accurate
38+ definitions and hovers in multi-module projects with external library
39+ dependencies.
40+ - ** Performance** : SCIP shards are fast to write and read. Each compilation unit
41+ can be processed independently to keep memory usage low. The final merge of
42+ the shards into a single index can be safely parallelized.
4243- ** Cross-repository** : Compiler plugins have access to both source code and the
4344 classpath (compiled bytecode of upstream dependencies). SCIP has been
4445 designed so that it's also possible to generate spec-compliant symbols from
0 commit comments