Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Groovy plugin in CLion: how can I highlight problems in a source file? #153

Open
ssproessig-thales opened this issue Jan 16, 2023 · 0 comments

Comments

@ssproessig-thales
Copy link

Follow up to #152: I'm able to parse the JSON file in groovy out-of-the-box.

I'd like to highlight those findings in the currently open CLion project.

I saw https://github.com/dkandalov/live-plugin/blob/master/plugin-examples/groovy/java-inspection/plugin.groovy#L18 but am not sure how I can port this to CLion.

Assume I have

  • a warning in file XXX on line LL1 and column CC1
  • an error in file XXX on line LL2 and column CC2

Any tips how I can do this from a LivePlugin?

Thank you!
Sören

ps: raw input looks like this

{
    "version": "2.1.0",
    "runs": [
        {
            "tool": {
                "driver": {
                    "name": "lint4jsondb / PC-lint plus",
                    "semanticVersion": "1.0.0"
                }
            },
            "results": [
                {
                    "ruleId": "PCLP-72",
                    "level": "error",
                    "message": {
                        "text": "bad option '!1788': not recognized"
                    },
                    "locations": [
                        {
                            "physicalLocation": {
                                "artifactLocation": {
                                    "uri": "file:///C:/Code/xxx/CoreTests.cpp"
                                },
                                "region": {
                                    "startLine": "1849",
                                    "startColumn": "82"
                                }
                            }
                        }
                    ]
                },
                {
                    "ruleId": "PCLP-1788",
                    "level": "note",
                    "message": {
                        "text": "variable 'msg' of type 'QString' is referenced only by its constructor/destructor"
                    },
                    "locations": [
                        {
                            "physicalLocation": {
                                "artifactLocation": {
                                    "uri": "file:///C:/Code/xxx/CoreTests.cpp"
                                },
                                "region": {
                                    "startLine": "1849",
                                    "startColumn": "16"
                                }
                            }
                        }
                    ]
                }
            ]
        }
    ]
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant