Skip to content

Commit cc7bb07

Browse files
committed
refresh resource references on active text document change
1 parent 2e414e0 commit cc7bb07

File tree

1 file changed

+2
-10
lines changed
  • spx-gui/src/components/editor/code-editor/ui/resource-reference

1 file changed

+2
-10
lines changed

spx-gui/src/components/editor/code-editor/ui/resource-reference/index.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,15 @@ export class ResourceReferenceController extends Emitter<{
9494

9595
this.addDisposer(
9696
watch(
97-
this.providerRef,
98-
(provider) => {
97+
() => [this.providerRef.value, this.ui.project.filesHash, this.ui.activeTextDocument] as const,
98+
([provider]) => {
9999
if (provider == null) return
100100
refreshItems()
101101
},
102102
{ immediate: true }
103103
)
104104
)
105105

106-
this.addDisposer(
107-
watch(
108-
() => this.ui.project.filesHash,
109-
() => refreshItems(),
110-
{ immediate: true }
111-
)
112-
)
113-
114106
const editorEl = editor.getDomNode()
115107
if (editorEl == null) throw new Error('No editor dom node')
116108

0 commit comments

Comments
 (0)