Skip to content

Conversation

brianrourkeboll
Copy link
Contributor

@brianrourkeboll brianrourkeboll commented Apr 16, 2024

Description

  • Previously, if you opened Visual Studio with no solution and then opened an F# script file, tooltips would not work. This was because the quick info provider did not account for the possibility of a non-existent solution. This change updates the quick info provider so that it no longer tries (and fails) to get the relative path of a solution that does not exist.

Before

no_sln.mp4

After

no_sln_no_throw.mp4

Checklist

  • Test cases added.

    The tests in QuickInfoProviderTests only test TryGetTooltip:

    FSharpAsyncQuickInfoSource.TryGetToolTip(document, caretPosition)

    There are no tests that test FSharpAsyncQuickInfoSource's implementation of GetQuickInfoItemAsync, which calls the private getQuickInfoItem function, which is where the bug was.

    It would be nice if such tests existed, but I am not sure how willing I am to spend the time to figure out how to wire everything up for them so that I can test this particular bug.

  • Release notes entry updated.

* Previously, if you opened Visual Studio with no solution and then
  opened an F# script file, tooltips would not work. This was because
  the quick info provider did not account for the possibility of a
  non-existent solution. This change updates the quick info provider so
  that it no longer tries to get the relative path of a solution that
  does not exist.
Copy link
Contributor

github-actions bot commented Apr 16, 2024

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
vsintegration/src docs/release-notes/.VisualStudio/17.11.md

@brianrourkeboll brianrourkeboll marked this pull request as ready for review April 16, 2024 15:27
@brianrourkeboll brianrourkeboll requested a review from a team as a code owner April 16, 2024 15:27
@brianrourkeboll brianrourkeboll changed the title Don't throw an exception when getting tooltips in VS with no sln Make tooltips work in VS in file with no solution Apr 16, 2024
@psfinaki psfinaki enabled auto-merge (squash) April 16, 2024 16:48
Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

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

Beautiful, thank you!

@psfinaki psfinaki merged commit 88a3414 into dotnet:main Apr 19, 2024
@brianrourkeboll brianrourkeboll deleted the no-throw-if-no-sln branch May 8, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants