Skip to content

Commit 92173a8

Browse files
committed
fix: Ensure projects are loaded when opening Project Explorer
1 parent fb0f67d commit 92173a8

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

src/DarkId.Papyrus.Server/Features/ProjectInfosHandler.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public ProjectInfosHandler(ProjectManager projectManager, ILogger<ProjectInfosHa
3131

3232
public Task<ProjectInfos> Handle(ProjectInfosParams request, CancellationToken cancellationToken)
3333
{
34+
if (!_projectManager.Projects.Any())
35+
{
36+
_projectManager.UpdateProjects();
37+
}
38+
3439
return Task.FromResult(new ProjectInfos()
3540
{
3641
Projects = new Container<ProjectInfo>(_projectManager.Projects.AsParallel().AsOrdered().Select(p =>
@@ -61,7 +66,7 @@ public Task<ProjectInfos> Handle(ProjectInfosParams request, CancellationToken c
6166
}) : Enumerable.Empty<ProjectInfoSourceInclude>())
6267
};
6368
}))
64-
});
69+
});
6570
}
6671

6772
public void SetCapability(ProjectInfosCapability capability)

src/DarkId.Papyrus.Server/ProjectManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public Task PublishDiagnosticsForFilePath(string filePath)
8686

8787
// RefreshSources is for when files are added or removed.
8888
// ReloadProjects is for when a project or flags file has changed.
89-
public void UpdateProjects(UpdateProjectsOptions options)
89+
public void UpdateProjects(UpdateProjectsOptions options = UpdateProjectsOptions.None)
9090
{
9191
lock (_lock)
9292
{

src/papyrus-lang-vscode/package.json

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,40 @@
4949
"required": [
5050
"game"
5151
]
52+
},
53+
"launch": {
54+
"properties": {
55+
"game": {
56+
"type": "string",
57+
"enum": [
58+
"fallout4"
59+
]
60+
},
61+
"projectPath": {
62+
"type": "string"
63+
}
64+
},
65+
"required": [
66+
"game"
67+
]
5268
}
5369
},
5470
"configurationSnippets": [
5571
{
56-
"label": "Papyrus: Fallout 4 (Creation Kit)",
72+
"label": "Papyrus: Fallout 4",
5773
"body": {
5874
"name": "Fallout 4",
5975
"type": "papyrus",
60-
"request": "attach",
76+
"request": "launch",
6177
"game": "fallout4"
6278
}
6379
},
6480
{
65-
"label": "Papyrus: Fallout 4 (.ppj)",
81+
"label": "Papyrus: Fallout 4 (with .ppj)",
6682
"body": {
6783
"name": "Fallout 4 Project",
6884
"type": "papyrus",
69-
"request": "attach",
85+
"request": "launch",
7086
"game": "fallout4",
7187
"projectPath": "^\"\\${workspaceFolder}/${1:Project.ppj}\""
7288
}
@@ -213,7 +229,7 @@
213229
{
214230
"category": "Debug",
215231
"command": "papyrus.fallout4.attachDebugger",
216-
"title": "Attach to Fallout 4"
232+
"title": "Debug Fallout 4"
217233
},
218234
{
219235
"category": "Papyrus",

0 commit comments

Comments
 (0)