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

Fix Go to Definition to a source-generated file #48348

Conversation

jasonmalinowski
Copy link
Member

#47047 changed the logic for the file name and path we generate, but we were no longer ensuring the temporary directory existed prior to trying to create the file within it.

dotnet#47047 changed the logic for the
file name and path we generate, but we were no longer ensuring the
temporary directory existed prior to trying to create the file
within it.
Copy link
Contributor

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

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

Should there be some code somewhere that checks if the new option is turned on, and navigates to the real files that the compiler created?

Copy link
Contributor

@chsienki chsienki left a comment

Choose a reason for hiding this comment

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

Weird, I did test this, but it went through a bunch of iterations so I guess it got broken after the fact? Anyway, good catch and thanks for the fix.

@jasonmalinowski
Copy link
Member Author

@davidwengier: @chsienki and I discussed this a bit and we decided to keep this as is for now. There's a few challenges:

  1. The files may not exist in the first place if the user doesn't have them on.
  2. The files may exist, but may be stale since they're from the last saved build. We could totally do our dynamic file experience atop these files, but then it might get confusing because if you're really trying to look at the generated result from the prior build you're not getting what you want.
  3. If you want to place breakpoints in a generated file, is it living in the IDE managed versions or the compiler versions? Or both? Or something else...?

So we decided that the IDE does magic and only does magic, and the compiler only does regular outputted files and we don't get in the way. I imagine that we might do some heuristics down the road where we try to use the prior generated results in the IDE to speed things up, but we'd still use our file identity to avoid the other issues above.

@jasonmalinowski
Copy link
Member Author

@chsienki: if I recall, I think there was some code review feedback you might have tried addressing which tried simplifying the path generation logic because we were otherwise generating a path and then splitting it a part again. I'm thinking this broke then.

@jinujoseph jinujoseph closed this Oct 12, 2020
@jinujoseph jinujoseph reopened this Oct 12, 2020
@jasonmalinowski jasonmalinowski merged commit 97bb6ae into dotnet:release/dev16.8 Oct 12, 2020
@jasonmalinowski jasonmalinowski deleted the fix-go-to-definition-of-source-generated-file branch October 12, 2020 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants