返回 DeepSeek-Reasonix
project_root_registration.go
根目录 / desktop / project_root_registration.go
1 package main
2
3 // registerProjectRoot indexes workspaceRoot, realigns open tabs to its
4 // canonical spelling, and discovers existing sessions once per process.
5 func (a *App) registerProjectRoot(workspaceRoot string) {
6 _ = addProject(workspaceRoot, "")
7 a.syncTabWorkspaceRootSpellings()
8 root := normalizeProjectRoot(workspaceRoot)
9 if root == "" {
10 return
11 }
12 registrationKey := projectRootKey(root)
13 if _, loaded := a.catalogRegisteredProjectRoots.LoadOrStore(registrationKey, struct{}{}); loaded {
14 return
15 }
16 if !a.requestSessionCatalogReconcile(desktopSessionDir(root)) {
17 a.catalogRegisteredProjectRoots.Delete(registrationKey)
18 }
19 }
20
20 lines GO