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

Added go to test ability for test/tested class in lsp server #6834

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

Achal1607
Copy link
Collaborator

Netbeans IDE provided navigation option from test file to source file and vice versa, but this option was not present in the java extensions that use netbeans java lsp server. So, created an api module in gototest library which in turn is used by java lsp server for implementing go to test feature.

refer to javavscode-56 for more info

@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests labels Dec 12, 2023
@apache apache locked and limited conversation to collaborators Dec 12, 2023
@apache apache unlocked this conversation Dec 12, 2023
@mbien mbien added this to the NB21 milestone Dec 12, 2023
@lahodaj lahodaj requested a review from sdedic December 13, 2023 09:01
} else {
TestLocator.LocationResult opposite = locator.findOpposite(fo, caretOffset);

if (opposite != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Share this block of code with the asynchronous variant, if possible.

}

private TestLocator.FileType getFileType(FileObject fo) {
TestLocator locator = getLocatorFor(fo);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little strange: while populateLocationResults considers all locators. this implementation accepts the first result.

@Achal1607 Achal1607 requested a review from sdedic January 12, 2024 09:26
@neilcsmith-net neilcsmith-net modified the milestones: NB21, NB22 Jan 16, 2024
@Achal1607
Copy link
Collaborator Author

Tried to address all the comments.

@Achal1607 Achal1607 requested a review from sdedic April 12, 2024 06:43
@Achal1607
Copy link
Collaborator Author

The failing test is showing that it failed because it was unable to download artifacts, so can someone trigger tests for this again pls?

}

if (opposites.getErrorMessage() != null) {
StatusDisplayer.getDefault().setStatusText(opposites.getErrorMessage());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the execution reach here in headless mode ? If so, I would skip the dialog.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid it won't be possible most probably.

Signed-off-by: Achal Talati <achal.talati@oracle.com>
@lahodaj lahodaj merged commit 55587de into apache:master Apr 17, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants