Skip to content

Odd implementation of partial analysis in VectorDrawableCompatDetector #73

Open
@Lingviston

Description

@Lingviston

Hi!
Please, read the whole issue, before rejecting it, as I think at least part of it is directly related to this project.

The chapter about partial analysis says, that we must fill the partialResult map and then process it in the checkPartialResults method. However, VectorDrawableCompatDetector seems to do it the other way around.

It fills the map in visitElement method, but processes it within the visitAttribute method. The oddest thing is that inside of the visitAttribute method the partial results of other projects are checked as well, however in my experiment (I copied the source code to my project and added some extra logging) at this point partial results were only containing the results of the scanned module. It makes the usage of the partial results redundant, doesn't it?

I wonder, if this VectorDrawableCompatDetector uses partial results in the expected manner. If yes, then could you also clarify the following:

  • When partial results are checked out of the checkPartialResults method, results of which projects must be available? All of those, on which the scanned project depend?
  • Does access to partial results break the highlighting in the Android Studio? In the custom detector of mine just adding a call to getPartialResult removed the highlighting immediately. My detector check issues in multiple types of files, in some of which the data from the other modules is required, but in some it is not. The documentation has the following section, which made me think that maybe, to make the detector work under the AS I need to protect those branches, which don't need data from all modules, with isGlobalAnalysis check. If my assumption is correct, then it might make a good addition to the doc.

Thanks in advance for the answers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions