Skip to content

VS "Show in Test Explorer" doesn't work for F# #14632

Open

Description

@0101

Repro steps

  • In an F# solution
  • Go to some Xunit/Nunit test (place cursor on definition line or inside the test code)
  • Issue "Show in Test Explorer" command (either via context menu, Feature Search, or Ctrl + E, S)

Expected behavior

  • Test Explorer is shown
  • The test case is selected

Actual behavior

  • Test Explorer is shown
  • Some top-level test group is selected

Known workarounds

Find the test manually

Related information

Doesn't work on test function definition, module, namespace

Observed in these versions:

  • 17.5 preview 3
  • 17.6 preview 1

Activity

  1. added this to the Backlog milestone on Jan 19, 2023
  2. vzarytovskii commented on Jan 19, 2023

    @vzarytovskii
    Member

    perhaps @MarcoRossignoli @nohwnd or @Evangelink know whether we can do anything on our side to improve it?

  3. Evangelink commented on Jan 19, 2023

    @Evangelink
    Member

    @vzarytovskii That's the issue I was talking to you about when I joined and totally forgot to log.

    I haven't investigated the issue but my understanding is that this is linked to some incorrect position being either detected or reported (I would think this is some improvement we need to do on TP but not 100% sure). If @nohwnd hasn't replied in the meantime, I will try to understand TP code logic and see if my assumption is right or not.

  4. nohwnd commented on Jan 20, 2023

    @nohwnd
    Member

    I checked and the information returned from code information is correct. Both c# test and f# test return the first line after method definition as the location of the test. Clicking on the location of the test in TestExplorer correctly jumps to the test in the editor in both cases.

    Going back from F# test does not work, as reported. Posting this to internal group for further investigation in VS.

  5. nohwnd commented on Jan 20, 2023

    @nohwnd
    Member

    The unknown namespace looks like a possible cause, but I don't know how exactly tests are located in TE.
    image

  6. 0101 commented on Jan 20, 2023

    @0101
    ContributorAuthor

    @nohwnd it happens even if there is no <Empty Namespace> anywhere in the test tree.

  7. added
    Impact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.
    and removed on Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI-thinks-windows-onlyArea-VSVS support for F# not covered elsewhereBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions