feat(渲染编辑): 完善渲染压缩及文档版本编辑
build.yaml / build (push) Successful in 1m51s

This commit is contained in:
xiaoqidun committed 2026-10-11 18:45:54 +08:00
1 parent cfbaa8a177
commit 2c06e5ff69
43 files changed
+3211 -397

No files matched your search

+24
View File
@@ -35,6 +35,7 @@ func resourceReferenceScopes(ctx context.Context, documents map[string]bool, res
scope := map[string]bool{entry: true}
queue := []string{entry}
refs := &editorResourceRefs{ids: make(map[string]bool), fonts: make(map[string]*editorFontUsage)}
definitions := make(map[string]*editorResourceRefs)
for position := 0; position < len(queue); position++ {
if err := ctx.Err(); err != nil {
return nil, err
@@ -47,6 +48,12 @@ func resourceReferenceScopes(ctx context.Context, documents map[string]bool, res
used[name] = true
if selected == "" || selected == entry {
refs.merge(&editorResourceRefs{ids: source.ids, fonts: source.fonts})
for id, definition := range source.definitions {
if definitions[id] != nil {
return nil, nil
}
definitions[id] = definition
}
}
for target, role := range source.roles {
if role&packageReferenceXML != 0 && !scope[target] {
@@ -58,6 +65,23 @@ func resourceReferenceScopes(ctx context.Context, documents map[string]bool, res
if selected != "" && selected != entry {
continue
}
var pending []string
if len(definitions) != 0 {
pending = slices.Collect(maps.Keys(refs.ids))
}
for position := 0; position < len(pending); position++ {
if err := ctx.Err(); err != nil {
return nil, err
}
if definition := definitions[pending[position]]; definition != nil {
for id := range definition.ids {
if !refs.ids[id] {
pending = append(pending, id)
}
}
refs.merge(&editorResourceRefs{ids: definition.ids, fonts: definition.fonts})
}
}
for name := range scope {
if err := ctx.Err(); err != nil {
return nil, err