Skip to content

Commit

Permalink
Read well-known items from near help folder
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorKrolic committed Jul 13, 2023
1 parent a026ca3 commit 88c2691
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/LanguageServer.SemanticModel.MSBuild/MSBuildSchemaHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.Json;

namespace MSBuildProjectTools.LanguageServer.SemanticModel
Expand All @@ -17,12 +18,8 @@ public static class MSBuildSchemaHelp
/// </summary>
static MSBuildSchemaHelp()
{
string extensionDirectory = Environment.GetEnvironmentVariable("MSBUILD_PROJECT_TOOLS_DIR");
if (string.IsNullOrWhiteSpace(extensionDirectory))
throw new InvalidOperationException("Cannot determine current extension directory ('MSBUILD_PROJECT_TOOLS_DIR' environment variable is not present).");

extensionDirectory = Path.GetFullPath(extensionDirectory);
var helpDirectory = Path.Combine(extensionDirectory, "help");
var currentAssemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var helpDirectory = Path.Combine(currentAssemblyDirectory, "help");

JsonSerializerOptions jsonOptions = new JsonSerializerOptions()
{
Expand Down

0 comments on commit 88c2691

Please sign in to comment.