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

Linkify unqualified file names in the terminal #82903

Closed
georgewfraser opened this issue Oct 19, 2019 · 6 comments
Closed

Linkify unqualified file names in the terminal #82903

georgewfraser opened this issue Oct 19, 2019 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label

Comments

@georgewfraser
Copy link

Java stack traces show FileName:lineNumber, without any path qualification. For example:


java.lang.AssertionError: 
Expected: an empty collection
     but: <[unused(4)]>
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.junit.Assert.assertThat(Assert.java:956)
        at org.junit.Assert.assertThat(Assert.java:923)
        at org.javacs.WarningsTest.clearErrorIncrementally(WarningsTest.java:55)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

These file names are usually unambiguous. In the above example, there is only one WarningsTest.java in my workspace, so WarningsTest.java:55 could be unambiguously resolved to this file. If examples like WarningsTest.java:55 were linkified, it would be much easier to navigate from Java stack traces in the terminal to source code.

@georgewfraser georgewfraser changed the title Linkify terminal files names without paths Linkify unqualified file names in the terminal Oct 19, 2019
@Tyriar Tyriar added feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label labels Oct 21, 2019
@sohailrajdev97
Copy link
Member

@Tyriar I would like to work on this. What would be a good starting point for adding this functionality?

@Tyriar
Copy link
Member

Tyriar commented Oct 23, 2019

/duplicate #22772

@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label Oct 23, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 23, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@georgewfraser
Copy link
Author

This is not the same as #22772. #22772 is "linkify files in the current working directory". This is "linkify any file under the current working directory, so long as its name is unambiguous"

@Tyriar
Copy link
Member

Tyriar commented Oct 30, 2019

@georgewfraser see the mention of this issue in #22772 (comment)

@georgewfraser
Copy link
Author

Aha missed that. Great!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

3 participants