fix: subscription streams

This commit is contained in:
liyasthomas
2021-12-12 06:19:58 +05:30
parent 67002a204e
commit 534fe8030f
4 changed files with 78 additions and 52 deletions

View File

@@ -30,6 +30,7 @@ import { GQLLanguage } from "@hoppscotch/codemirror-lang-graphql"
import { pipe } from "fp-ts/function"
import * as O from "fp-ts/Option"
import { isJSONContentType } from "../utils/contenttypes"
import { useStreamSubscriber } from "../utils/composables"
import { Completer } from "./completion"
import { LinterDefinition } from "./linting/linter"
import { basicSetup, baseTheme, baseHighlightStyle } from "./themes/baseTheme"
@@ -152,6 +153,7 @@ export function useCodemirror(
value: Ref<string>,
options: CodeMirrorOptions
): { cursor: Ref<{ line: number; ch: number }> } {
const { subscribeToStream } = useStreamSubscriber()
const language = new Compartment()
const lineWrapping = new Compartment()
const placeholderConfig = new Compartment()
@@ -178,7 +180,7 @@ export function useCodemirror(
basicSetup,
baseTheme,
baseHighlightStyle,
environmentTooltip,
environmentTooltip(subscribeToStream),
environmentHighlightStyle,
ViewPlugin.fromClass(
class {