Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

CHECK_63: Error message not displayed correctly #1112

Closed
ConjuringCoffee opened this issue Jul 14, 2023 · 18 comments · Fixed by #1114 or #1128
Closed

CHECK_63: Error message not displayed correctly #1112

ConjuringCoffee opened this issue Jul 14, 2023 · 18 comments · Fixed by #1114 or #1128
Labels

Comments

@ConjuringCoffee
Copy link
Collaborator

I activated CHECK_63 (ABAP Doc - Check parameter consistency) but the errors are not displayed properly. The message of each finding is "Unknown error code" and the navigation always leads to the start of the class, not the abap Doc parameter.

Here's an example (the faulty parameter is param_3):

CLASS ycl_aoc_test DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC.

  PUBLIC SECTION.
    "! @parameter param_1 |
    "! @parameter param_3 |
    METHODS example
      IMPORTING
        param_1 TYPE i
        param_2 TYPE i.

  PROTECTED SECTION.

  PRIVATE SECTION.
ENDCLASS.


CLASS ycl_aoc_test IMPLEMENTATION.
  METHOD example.
    RETURN.
  ENDMETHOD.
ENDCLASS.

image

Any idea why this happens? Thanks!

@larshp
Copy link
Owner

larshp commented Jul 16, 2023

guess something changed in the abapdoc api, try setting a breakpoint

@ConjuringCoffee
Copy link
Collaborator Author

The check successfully reaches method INFORM with the following text in p_param_1:

inconsistency ABAP Doc comment - parameter interface of element EXAMPLE

So it doesn't seem like this is a problem with the abap Doc API to me. Any other ideas?

@MiLiCLN
Copy link
Collaborator

MiLiCLN commented Jul 17, 2023

I suspect the problem comes from the defined error code-number "003" in the constructor and the passed code-number in "inform" (001).
Can you try to make "003" into "001" in the constructor at "insert_scimessage"?
image

@ConjuringCoffee
Copy link
Collaborator Author

This is the result now:

image

I think we're on the right path, but we're not quite there yet. Any chance we can exchange the very generic message for a more specific message? The more specific message can only be seen in SAP GUI:

image

@MiLiCLN
Copy link
Collaborator

MiLiCLN commented Jul 19, 2023

Ok, step by step a little further. :-)
Unfortunately, I can't test it. But what can be seen in the Detail view?

@ConjuringCoffee
Copy link
Collaborator Author

The detail view looks good:

image

Compared to before:

image

@MiLiCLN MiLiCLN added the bug label Jul 19, 2023
@MiLiCLN
Copy link
Collaborator

MiLiCLN commented Jul 19, 2023

A PR is welcome. :-)

@ConjuringCoffee
Copy link
Collaborator Author

I didn't submit a pull request because I'm not happy yet with how the text turns out. Compare it to check 001 for example:

image

How can this text be changed? I tried to change iv_text like this, but it had no effect:

    insert_scimessage(
        iv_code = '001'
        iv_text = 'ABAP Doc parameter name is inconsistent' ).

@MiLiCLN
Copy link
Collaborator

MiLiCLN commented Jul 25, 2023

What is your goal? To change the highlighted text in the screenshot?
image
This text is from the class description; the check-title.

@ConjuringCoffee
Copy link
Collaborator Author

I want to change the other text 😊

image

@MiLiCLN
Copy link
Collaborator

MiLiCLN commented Jul 27, 2023

I had now also the possibility to test this with eclipse. For me the result looks like this (with the latest PR):
image

@ConjuringCoffee
Copy link
Collaborator Author

That's weird! I'll check the installation and report back. (Could take a while, I'm having some authorization problems right now...)

@ConjuringCoffee ConjuringCoffee changed the title CHECK_63: "Unknown error code" CHECK_63: Error message not displayed correctly Aug 4, 2023
@ConjuringCoffee
Copy link
Collaborator Author

My authorization problems are fixed and I'm running the latest version now. The message still isn't displayed correctly.

Can anyone please re-open this issue?

I also tried it using SAP GUI, same result:
image

@MiLiCLN MiLiCLN reopened this Aug 4, 2023
@MiLiCLN
Copy link
Collaborator

MiLiCLN commented Aug 9, 2023

Is it ok to change the text of the check message from "&1" to "ABAP Doc: &1"?
This would then look like this:
abap doc change

For the findings list, the text of the check message is used; however, the variables are replaced by "..." and only added later, e.g. in the details.

@ConjuringCoffee
Copy link
Collaborator Author

Are we still talking about the same problem? I'd be actually okay with the way it already works in your previous screenshots, it just doesn't seem to work on my system. 😅

  • On your system: inconsistency ABAP Doc comment - parameter interface of [...] (cut off in the screenshot)
    image
  • On my system: Check: ZCL_AOC_CHECK_63, Rule: 001
    image

@ConjuringCoffee
Copy link
Collaborator Author

ConjuringCoffee commented Jan 11, 2024

Right, so I have a bit more experience with ATC checks now and I think I know what's going on now.

  • The ATC check message is only defined with a message variable: &1
  • The actual text (inconsistency ABAP Doc comment - parameter interface [...]) is put into the message variable when calling method INFORM
  • For some reason, the behavior of MiLiCLN's system is different to mine: On his system, ADT already shows the complete message. On my system, it shows Check: ZCL_AOC_CHECK_63, Rule: 001
  • I conclude that my system replaces the complete message text with Check: ZCL_AOC_CHECK_63, Rule: 001 if it only consists of a single message variable. If I include any other text in the message, then it works as expected.

I'll provide a pull request to fix this.

@ConjuringCoffee
Copy link
Collaborator Author

image

I've changed the message from &1 to ABAP Doc: &1 and it works in the SAP GUI:

image

However, it doesn't work in ADT:

image

If I change the error code from '001' to '002' (both in the constructor and in the run method), then it works in ADT too:

image

Restarting my own PC didn't help, and it also behaves the same for colleagues. Maybe there is some kind of additional caching for the ATC message check? I'll keep an eye on it.

@ConjuringCoffee ConjuringCoffee linked a pull request Jan 11, 2024 that will close this issue
@ConjuringCoffee
Copy link
Collaborator Author

Maybe there is some kind of additional caching for the ATC message check? I'll keep an eye on it.

I suspect that this was the case. The error message is correctly displayed for '001' now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants