Skip to content

Fix untitled file references #1177

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

Merged

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Feb 3, 2020

This optimizes the ScriptFile constructor and also fixed an issue where in-memory files wouldn't be able to get CodeLens.

I want to get to a point where DocumentUri on the ScriptFile class is a reference to System.Uri but I'm gonna call that out of scope due to time constraints.

I believe this change is needed for #1119 as well

if (!Path.IsPathRooted(filePath))
{
// TODO: Assert instead?
throw new InvalidOperationException(
Copy link
Member Author

Choose a reason for hiding this comment

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

This can never happen because the client only ever sends AbsoluteUris

Copy link
Contributor

Choose a reason for hiding this comment

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

Technically a client that isn't VSCode might do this (just realised this now)

@TylerLeonhardt
Copy link
Member Author

Codacy Here is an overview of what got changed by this pull request:

Issues
======
+ Solved 1
           

See the complete overview on Codacy

@TylerLeonhardt TylerLeonhardt merged commit 9f64562 into PowerShell:master Feb 3, 2020
@TylerLeonhardt TylerLeonhardt deleted the fix-untitledfile-references branch February 3, 2020 22:08
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.

2 participants