From 1aae8aa762c715b02121a571bf2404964495e338 Mon Sep 17 00:00:00 2001 From: Joel Day Date: Fri, 21 Jun 2019 17:52:31 -0700 Subject: [PATCH] fix: language features now work when there is no opened folder (#18) --- src/DarkId.Papyrus.Server/ProjectProgramOptionsProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DarkId.Papyrus.Server/ProjectProgramOptionsProvider.cs b/src/DarkId.Papyrus.Server/ProjectProgramOptionsProvider.cs index 45c8ba3c..811288d7 100644 --- a/src/DarkId.Papyrus.Server/ProjectProgramOptionsProvider.cs +++ b/src/DarkId.Papyrus.Server/ProjectProgramOptionsProvider.cs @@ -42,7 +42,7 @@ public ProjectProgramOptionsProvider( public async Task> GetProgramOptions() { var workspaceFolders = await Task.Run(() => _languageServer.Workspace.WorkspaceFolders().WaitForResult()); - var workspaceFolderPaths = workspaceFolders.Select(f => f.Uri.ToFilePath()).ToArray(); + var workspaceFolderPaths = workspaceFolders?.Select(f => f.Uri.ToFilePath()).ToArray() ?? new string[] { }; var workspaceProjectFiles = Task.WhenAll(workspaceFolderPaths.Select(async d => {