Affects Version/s: None
Fix Version/s: None
SONARSLANG-491, we added an issue suppression mechanism for Slang. We were able to make it work for Scala. Due to technical limitations, issue suppression for Apex is currently not supported.
The goal of this ticket is exactly to support issue suppressions for Apex, via the SuppressWarnings annotation.
- Annotations parameters are currently naively represented as a List<String> in Slang. We therefore have to recover the original value of an annotation Node as a String, feature not available within the Apex converter. Hopefully, annotations in Apex are pretty strict, we can rebuild it by hand.
- We are relying on annotations TextRange to know which node an annotation refers to. In the Apex converter, the TextRange computation is not precise enough. For example:
In this code, the end of the range will be the one from the last known children ('param'), meaning that the range is excluding the last parenthesis.
We can therefore not rely on this range without further work.