eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
32 stars 79 forks source link

CTRL+Click functionality stops working in deeper code blocks #1460

Closed laimutisign closed 1 month ago

laimutisign commented 1 month ago

Hello, I have noticed, that CTRL+Click functionality stops working in deeper code blocks. In the example below, the CTRL+Click function stops working at the 6th level of the method code block - CTRL+Click does no navigation to variables 'reader', 'exists', methods 'getAuthorities()', 'size()'. Functionality starts working again when the code is reorganized into a less deep hierarchy of code blocks (e.g., by removing / commenting out the 'if' or 'for' statement).


@Service
public class CtrlClickNotWorking {

    @Autowired
    private PlatformTransactionManager transactionManager;
    private TransactionTemplate template;

    public CtrlClickNotWorking() {
    }

    public void someMethod(List<String> readerDataList) throws IOException {
        template = new TransactionTemplate(transactionManager);

        User reader = new User("username", "password", new ArrayList<>());
        for (GrantedAuthority auth : reader.getAuthorities()) {
            try {
                final boolean[] exists = { false };
                template.execute(new TransactionCallbackWithoutResult() {

                    @Override
                    protected void doInTransactionWithoutResult(TransactionStatus status) {
                        if ("some_auth".equals(auth.getAuthority())) {

                            // !!!!!  CTRL+Click functionality stops working in this block:
                            // - no navigation to 'reader', 'getAuthorities()', 'size()', 'exists' !!!!

                            if (reader.getAuthorities().size() > 0) {
                                exists[0] = true;
                            }
                        }
                    }
                });

            } catch (Exception ex) {
                // do something
            }
        }
    }
}

Eclipse IDE for Enterprise Java and Web Developers Version: 2024-03 (4.31.0) Build id: 20240307-1437

iloveeclipse commented 1 month ago

Couldyou please try with 4.32?

laimutisign commented 1 month ago

Good news - with version 4.32 the problem is gone!

Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components) Version: 2024-06 (4.32.0) Build id: 20240606-1231