Step 130: LSP library API indexing

This commit is contained in:
Bill
2026-02-09 16:46:58 -07:00
parent f88a129a7b
commit 42ee684087
9 changed files with 375 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ struct DependencyPanelState {
PackageEcosystem addEcosystem = PackageEcosystem::Python;
PackageInfo lastLookup;
std::string lastWorkspaceRoot;
bool needsIndex = false;
};
static std::vector<std::string> dependencyFileNames() {
@@ -311,6 +312,7 @@ static void refreshDependencies(DependencyPanelState& state,
state.selected = -1;
state.editVersionIndex = -1;
state.lastWorkspaceRoot = workspaceRoot;
state.needsIndex = true;
if (workspaceRoot.empty()) return;
for (const auto& file : state.sources) {
auto parsed = DependencyParser::parseFile(file.path);
@@ -408,6 +410,7 @@ static void renderDependencyPanel(DependencyPanelState& state,
state.deps.push_back(dep);
if (writeDependenciesForSource(dep.source, workspaceRoot, state.deps, logOut)) {
refreshDependencies(state, workspaceRoot, logOut);
state.needsIndex = true;
}
}
ImGui::CloseCurrentPopup();
@@ -449,6 +452,7 @@ static void renderDependencyPanel(DependencyPanelState& state,
dep.version = state.editVersionBuf;
if (writeDependenciesForSource(dep.source, workspaceRoot, state.deps, logOut)) {
refreshDependencies(state, workspaceRoot, logOut);
state.needsIndex = true;
}
}
ImGui::SameLine();
@@ -458,6 +462,7 @@ static void renderDependencyPanel(DependencyPanelState& state,
state.selected = -1;
if (writeDependenciesForSource(src, workspaceRoot, state.deps, logOut)) {
refreshDependencies(state, workspaceRoot, logOut);
state.needsIndex = true;
}
}
ImGui::SameLine();
@@ -468,6 +473,7 @@ static void renderDependencyPanel(DependencyPanelState& state,
dep.version = info.versions.back();
if (writeDependenciesForSource(dep.source, workspaceRoot, state.deps, logOut)) {
refreshDependencies(state, workspaceRoot, logOut);
state.needsIndex = true;
}
} else {
logOut += "[deps] No version info for " + dep.name + "\n";