Skip to content

Commit f5bd56b

Browse files
authored
Merge pull request #18 from CodinGame/fix-lsp-diagnostics-cleanup
Dispose the model in a timeout, temporary hack
2 parents fd8b5ac + ead97c2 commit f5bd56b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/MonacoEditor.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,11 @@ function MonacoEditor ({
159159
return () => {
160160
lastSaveViewState(editorRef.current!, model)
161161
if (existingModel == null) {
162-
// Only dispose if we are the one that created the model
163-
model.dispose()
162+
// Only dispose if we are the one who created the model
163+
setTimeout(() => {
164+
// setTimeout is required until monaco 0.34 is released (https://github.com/TypeFox/monaco-languageclient/issues/387)
165+
model.dispose()
166+
})
164167
}
165168
}
166169
} else {

0 commit comments

Comments
 (0)