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

Expose some useful helper methods #73289

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Tools/ExternalAccess/Razor/RazorUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System;
using Microsoft.CodeAnalysis.LanguageServer;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.ExternalAccess.Razor;

Expand All @@ -13,8 +12,9 @@ internal static class RazorUri
public static Uri CreateAbsoluteUri(string absolutePath)
=> ProtocolConversions.CreateAbsoluteUri(absolutePath);

public static string GetDocumentFilePathFromUri(Uri uri)
=> ProtocolConversions.GetDocumentFilePathFromUri(uri);

public static Uri CreateUri(this TextDocument document)
{
return document.GetURI();
}
=> document.GetURI();
}
17 changes: 17 additions & 0 deletions src/Tools/ExternalAccess/Razor/SolutionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Immutable;

namespace Microsoft.CodeAnalysis.ExternalAccess.Razor;

internal static class SolutionExtensions
{
public static ImmutableArray<TextDocument> GetTextDocuments(this Solution solution, Uri documentUri)
=> LanguageServer.Extensions.GetTextDocuments(solution, documentUri);

public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri)
=> LanguageServer.Extensions.GetDocumentIds(solution, documentUri);
}
Loading