Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
chore: add temporary debug info for code mirror (#2806)
Akash Ka950e08ef1e5
diff --git a/packages/hoppscotch-app/src/composables/codemirror.ts b/packages/hoppscotch-app/src/composables/codemirror.tsindex 440b7cba8..be2953e67 100644--- a/packages/hoppscotch-app/src/composables/codemirror.ts+++ b/packages/hoppscotch-app/src/composables/codemirror.ts@@ -40,6 +40,8 @@ import {import { HoppEnvironmentPlugin } from "@helpers/editor/extensions/HoppEnvironment"// TODO: Migrate from legacy mode+import { captureException } from "@sentry/vue"+type ExtendedEditorConfig = {mode: stringplaceholder: string@@ -286,16 +288,31 @@ export function useCodemirror(view.value?.destroy()})- watch(value, (newVal) => {+ watch(value, (newVal, oldVal) => {if (cachedValue.value !== newVal) {- view.value?.dispatch({- filter: false,- changes: {- from: 0,- to: view.value.state.doc.length,- insert: newVal,- },- })+ try {+ view.value?.dispatch({+ filter: false,+ changes: {+ from: 0,+ to: view.value.state.doc.length,+ insert: newVal,+ },+ })+ } catch (e) {+ captureException(e, {+ extra: {+ newVal,+ oldVal,+ changes: {+ from: 0,+ to: view.value?.state.doc.length,+ insert: newVal,+ cachedValue,+ },+ },+ })+ }}cachedValue.value = newVal})