@dao42/d42paas-front 0.6.12 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -187822,10 +187822,11 @@ const Editor = ({
187822
187822
  serviceWorkerOrigin,
187823
187823
  useLsp
187824
187824
  }) => {
187825
+ const [lspInited, setlspInited] = react.exports.useState(false);
187826
+ const [client2, setClient] = react.exports.useState(new IoClient(0));
187825
187827
  const divEl = react.exports.useRef(null);
187826
187828
  const file = oTStore((state) => state.doc);
187827
187829
  const setFromServer = oTStore((state) => state.setFromServer);
187828
- const [client2, setClient] = react.exports.useState(new IoClient(0));
187829
187830
  const OTSTATE = oTStore((state) => state);
187830
187831
  const USERLISTSTORE = userListStore((state) => state);
187831
187832
  const setPosition = useValue((state) => state.setPosition);
@@ -188007,13 +188008,14 @@ const Editor = ({
188007
188008
  extensions: [".ts"],
188008
188009
  aliases: ["TypeScript", "ts", "TS", "typescript"]
188009
188010
  });
188010
- if (!useLsp2)
188011
- return;
188012
- lib.MonacoServices.install(monaco);
188013
188011
  const {
188014
188012
  lspUrl,
188015
188013
  ticket
188016
188014
  } = oTStore.getState().dockerInfo;
188015
+ if (!useLsp2 || !lspUrl || lspInited)
188016
+ return;
188017
+ setlspInited(true);
188018
+ lib.MonacoServices.install(monaco);
188017
188019
  if (!lspUrl)
188018
188020
  return;
188019
188021
  const webSocket = new ReconnectingWebSocket(`wss://${lspUrl}/${ticket}`, [], {
@@ -188094,7 +188096,7 @@ const Editor = ({
188094
188096
  }
188095
188097
  });
188096
188098
  editorEventBinder();
188097
- lspServerInject(INIT_LANGUAGE, useLsp);
188099
+ lspServerInject(INIT_LANGUAGE, false);
188098
188100
  const editorService = editor._codeEditorService;
188099
188101
  const openEditorBase = editorService.openCodeEditor.bind(editorService);
188100
188102
  editorService.openCodeEditor = async (input, source, workspacePath) => {
@@ -188340,7 +188342,8 @@ const Editor = ({
188340
188342
  }
188341
188343
  }, [file == null ? void 0 : file.path]);
188342
188344
  react.exports.useEffect(() => {
188343
- }, [doc2]);
188345
+ lspServerInject("", useLsp);
188346
+ }, [useLsp, OTSTATE.dockerInfo, lspInited]);
188344
188347
  react.exports.useEffect(() => {
188345
188348
  const {
188346
188349
  usersDelta,