Skip to content

Commit 87bd728

Browse files
committed
add notes about implementation
1 parent f97170e commit 87bd728

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • apps/client/src/components/Editor

apps/client/src/components/Editor/init.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ const originalCreateModel = monaco.editor.createModel
161161
monaco.editor.createModel = function (value, language, uri, ...args) {
162162
// If Monaco tries to create a model for a file we've already added as extraLib, skip it
163163
if (uri?.path.includes("node_modules")) {
164+
/**
165+
* We return null here instead of an empty model because
166+
* this way monaco will remove the peak and goto definition links entirely.
167+
* If an empty model is provided, these links exist, but go to a blank file.
168+
*/
169+
// biome-ignore lint/suspicious/noExplicitAny: while types say you can't create a model this way, it works and provides the best possible UI.
164170
return null as any
165171
}
166172
return originalCreateModel.call(this, value, language, uri, ...args)

0 commit comments

Comments
 (0)