-
Notifications
You must be signed in to change notification settings - Fork 874
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
Conversation
ide/gototest/src/org/netbeans/api/gototest/TestOppositesLocator.java
Outdated
Show resolved
Hide resolved
ide/gototest/src/org/netbeans/api/gototest/TestOppositesLocator.java
Outdated
Show resolved
Hide resolved
ide/gototest/src/org/netbeans/api/gototest/TestOppositesLocator.java
Outdated
Show resolved
Hide resolved
} else { | ||
TestLocator.LocationResult opposite = locator.findOpposite(fo, caretOffset); | ||
|
||
if (opposite != null) { |
There was a problem hiding this comment.
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.
ide/gototest/src/org/netbeans/api/gototest/TestOppositesLocator.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
private TestLocator.FileType getFileType(FileObject fo) { | ||
TestLocator locator = getLocatorFor(fo); |
There was a problem hiding this comment.
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.
ide/gototest/src/org/netbeans/api/gototest/TestOppositesLocator.java
Outdated
Show resolved
Hide resolved
.../java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
Outdated
Show resolved
Hide resolved
34f6ec7
to
4453667
Compare
ide/gototest/src/org/netbeans/api/gototest/TestOppositesLocator.java
Outdated
Show resolved
Hide resolved
4453667
to
33b1e4c
Compare
...p.server/src/org/netbeans/modules/java/lsp/server/commands/TestOppositesCommandProvider.java
Outdated
Show resolved
Hide resolved
...p.server/src/org/netbeans/modules/java/lsp/server/commands/TestOppositesCommandProvider.java
Outdated
Show resolved
Hide resolved
...p.server/src/org/netbeans/modules/java/lsp/server/commands/TestOppositesCommandProvider.java
Outdated
Show resolved
Hide resolved
Tried to address all the comments. |
The failing test is showing that it failed because it was unable to download artifacts, so can someone trigger tests for this again pls? |
ide/gototest/src/org/netbeans/api/gototest/TestOppositesLocator.java
Outdated
Show resolved
Hide resolved
ide/gototest/src/org/netbeans/api/gototest/TestOppositesLocator.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
if (opposites.getErrorMessage() != null) { | ||
StatusDisplayer.getDefault().setStatusText(opposites.getErrorMessage()); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
1705aca
to
211054b
Compare
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 implementinggo to test
feature.refer to javavscode-56 for more info