apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.65k stars 850 forks source link

Duplicate text in hint tooltip #7647

Closed troizet closed 1 month ago

troizet commented 2 months ago

Apache NetBeans version

Apache NetBeans 23 release candidate

What happened

Duplicate text in hint tooltip:

PHP examples: hint_tooltip_bug_php_1 hint_tooltip_bug_php_2 hint_tooltip_bug_php_3

JS example: hint_tooltip_bug_js

Language / Project Type / NetBeans Component

PHP, JavaScript

How to reproduce

<?php

function func($param) {
    $var = 2;
    $var = 3;
}

?>

Did this work correctly in an earlier version?

Apache NetBeans 22

Operating System

Ubuntu 22.04.4 LTS

JDK

17.0.11; OpenJDK 64-Bit Server VM 17.0.11+9-Ubuntu-122.04.1

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

troizet commented 2 months ago

This bug seems to have appeared in PR #7579.

matthiasblaesing commented 2 months ago

@troizet your analysis is spot on. The problem as I see it is, that #7579 removed the default registration of JavaErrorProvider in NetBeans IDE and registers it only in NetBeans VSCode. But that fix is incomplete, as the NB Codebase holds other ErrorProvider implementations, that need to be removed also. A quick grep hints:

Some of these are covered, but they need to be checked.

For PHP the errors flow through the GsfErrorProvider.

@jtulach can you provide a fix?

jtulach commented 2 months ago

Thank you for the report. I'll take a look over the weekend and see how to eliminate the duplicated hints for PHP & co.

jtulach commented 2 months ago

CCing @jlahoda, @ppisl, @dbalek..

@troizet your analysis is spot on. The problem as I see it is, that #7579 removed the default registration of JavaErrorProvider in NetBeans IDE and registers it only in NetBeans VSCode. But that fix is incomplete, as the NB Codebase holds other ErrorProvider implementations, that need to be removed also. ... Some of these are covered, but they need to be checked.

For PHP the errors flow through the GsfErrorProvider.

Yes, the flow goes thru GsfErrorProvider. The PHPLanguage uses @LanguageRegistration(mimeType=PHP_MIME_TYPE...) registration which registers ErrorProvider as well as a Gsf own implementation that fills the HintsCollector.setErrors.

I somehow need to find out in the ErrorProviderBridge that the delegation shouldn't happen. If we want to do it in really compatible way, then:

@jtulach can you provide a fix?

7659 is my attempt to make the #7579 support change as compatible as possible.

mbien commented 2 months ago

the PR in question got reverted and the change is merged to delivery.

Would be good if someone could verify that everything is ok again once NB 23 rc3 is built and close this issue. Github often forgets about issues if PRs aren't merged to master in the most direct way and leaves them open.

troizet commented 1 month ago

Would be good if someone could verify that everything is ok again once NB 23 rc3 is built and close this issue.

Tried NB 23 rc3. No duplicate text in the hint.