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

Don't try to print predefined ranges contents in debug #7898

Merged
merged 1 commit into from
Nov 22, 2019

Conversation

auduchinok
Copy link
Member

@auduchinok auduchinok commented Nov 22, 2019

range type has DebuggerDisplay defined to show file contents when possible.
It shouldn't, however, try to do this for predefined ranges, like rangeStartup or range0 as it fails to find such file:
Screenshot 2019-11-22 at 19 28 00

This PR makes it print the predefined ranges file names instead:
Screenshot 2019-11-22 at 20 26 42

@auduchinok auduchinok changed the title Don't try to print startupRange file contents in debug Don't try to print predefined ranges contents in debug Nov 22, 2019
@@ -200,6 +200,10 @@ let fileOfFileIndex idx = fileIndexTable.IndexToFile idx

let mkPos l c = pos (l, c)

let unknownFileName = "unknown"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine. Just for future reference, I would make these [<Literal>] but we still have a bug for fsi/signature files that prevents using [<Literal>] in a reasonable way. Therefore, we can't make these literal yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I tried to make it [<Literal>] at first and had to report the bug instead in #7897.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great, thanks!

Copy link
Contributor

@TIHan TIHan left a comment

Choose a reason for hiding this comment

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

I love it. It was a little annoying to have that error displayed for debug.

@TIHan TIHan merged commit 2063694 into dotnet:master Nov 22, 2019
@cartermp cartermp added this to the 16.5 milestone Mar 16, 2020
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants