Skip to content

Allow Core Razor editor to work in non-project scenarios. #5072

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
NTaylorMullen opened this issue May 14, 2018 · 1 comment
Closed

Allow Core Razor editor to work in non-project scenarios. #5072

NTaylorMullen opened this issue May 14, 2018 · 1 comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates cost: L Will take from 5 - 10 days to complete enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-razor-pages
Milestone

Comments

@NTaylorMullen
Copy link

Today if a Razor file is opened outside of the context of a project (diffing two Razor files) there is no IVsHierarchy and therefore no project path or any project information.

Our system relies on the idea that a document conceptually has a project; however, this is not true in the diff scenario and technically not true in the ctrl + o scenario for a Razor file (ctrl + o uses old Razor editor today).

This crashes VS.

@NTaylorMullen
Copy link
Author

NTaylorMullen commented May 29, 2018

After investigating what this would entail it led me to believe that our ProjectSnapshot system should not have a file path. This way the idea of a project having a file path can't be a dependency at any layer of the system; it becomes an implementation detail of GetImports and other similar methods on a document or project snapshot.

NTaylorMullen referenced this issue in aspnet/Razor Jun 5, 2018
- Part of this work involved moving our Project lookup logic to use a `ProjectId`. The caveat to this approach is there were some scenarios when all we had was a file path so we needed to maintain both ways to lookup a project (with and without a file path).
- Updated `DefaultProjectSnapshotManager` to track projects by a dual key of projectids and file paths.
- Updated project system bits to properly create host projects with unchanging `ProjectId`s.
- Added a miscellaneous project for cases when a document tracker did not have a project path.
- Updated serializers to properly serialize project ids as part of a project handle.

#2350
NTaylorMullen referenced this issue in aspnet/Razor Jun 6, 2018
- Part of this work involved moving our Project lookup logic to use a `ProjectId`. The caveat to this approach is there were some scenarios when all we had was a file path so we needed to maintain both ways to lookup a project (with and without a file path).
- Updated `DefaultProjectSnapshotManager` to track projects by a dual key of projectids and file paths.
- Updated project system bits to properly create host projects with unchanging `ProjectId`s.
- Added a miscellaneous project for cases when a document tracker did not have a project path.
- Updated serializers to properly serialize project ids as part of a project handle.

#2350
@aspnet-hello aspnet-hello transferred this issue from aspnet/Razor Dec 14, 2018
@aspnet-hello aspnet-hello added this to the VS 16.0 milestone Dec 14, 2018
@aspnet-hello aspnet-hello added 1 - Ready area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-razor-pages labels Dec 14, 2018
@mkArtakMSFT mkArtakMSFT added cost: L Will take from 5 - 10 days to complete and removed cost: M labels Sep 20, 2019
@mkArtakMSFT mkArtakMSFT modified the milestones: VS 16.0, Backlog Sep 20, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates cost: L Will take from 5 - 10 days to complete enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-razor-pages
Projects
None yet
Development

No branches or pull requests

4 participants