Tags: sourcegraph/scip-java
Tags
Allow passing JVM args to javac in ScipBuildTool (#728) A canonical usage for this is passing `--add-opens` flags to the _launcher_ of javac to make sure annotation processors work. To pass these arguments to the launcher, they have to be perfixed with -J – but arguments like this cannot be passed through the argfile that we use for javacOptions (see https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#command-line-argument-files) so we need to pass them to the command itself. For that purpose, we add a `jvmOptions` field to scip-java.json config – these options will have `-J` added to them and passed to the `javac` command. The test to verify this behaviour relies on an [old version of lombok that requires these options](projectlombok/lombok#2681 (comment)) Additionally, a hidden option `--strict-compilation` is added to the CLI, to prevent error recovery: sometimes scip-java can just ignore javac errors and produce semanticdb artifacts regardless. This complicates testing, so I need an escape hatch). ### Test plan - New test to ScipBuildToolSuite
New SCIP fields: kind, enclosing_symbol, signature_documentation, dis… …play_name (#677 #707) * Update Document from upstream scip.proto This copies the latest additions to the Document message: * a new language field and Language enum * a new text field, to embed the document content itself. This is meant for the new SymbolInformation::signature_documentation field. This also updates some documentation comments. * Update SymbolInformation from upstream scip.proto This copies the latest additions to the SymbolInformation message: * the documentation field is explicitly not meant for signature documentation anymore, instead a new signature_documentation field is added * a new display_name field is added * a new enclosing_symbol field is added for local symbols * a new kind field is added along with a Kind enum to have a finer-grained classification than the one provided by descriptor suffixes (and is especially useful for local symbols which don't have suffixes) * Forward display_name from SemanticDB to SCIP The SemanticDB schema already provides a display_name field, forward it to the SCIP output in scip-semanticdb. This also adds support to the ScipPrinters testing utility and updates the tests accordingly. * Move signature documentation to its new dedicated field SemanticDB provides a structured version of the signature in the signature field. Instead of turning it into a markdown-encoded string for the documentation field, this builds a Document for the signature_documentation field. This also updates the ScipPrinters testing utility and the tests accordingly. * Add back SemanticDB SymbolInformation::owner field SemanticDB used to have a SymbolInformation::owner field with id 15. This re-introduces the field with the same semantics under the name enclosing_symbol. To be able to re-use the field 15, this moves the out-of-spec definition_relationships field to id 21. * Forward enclosing_symbol from SemanticDB to SCIP This also adds support to the ScipPrinters testing utility. * Populate SymbolInformation::enclosing_symbol in semanticdb-javac This only populates the enclosing_symbol for local symbols, and updates the tests accordingly. * Build SCIP kind from SematicDB kind and properties This also updates the ScipPrinters testing utility and the tests accordingly. * semanticdb-javac: set kind to Variable for local variables --------- Co-authored-by: Nicolas Guichard <nicolas.guichard@kdab.com>
PreviousNext