dididy commented on PR #5044:
URL: https://github.com/apache/zeppelin/pull/5044#issuecomment-3224110678

   I really appreciate about your review. 👍 👍
   
   As you mentioned, the issue was caused by EDITOR_SETTING being triggered 
before PARAGRAPH, which led to short-circuit processing. However, modifying the 
condition in [message.ts, 
L187](https://github.com/dididy/zeppelin/blob/6ffd605bd71e3857f5680d2de26ad71469f6b198/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts#L186-L198)
 didn’t seem optimal from a performance standpoint.
   
   So I adjusted the timing in the relevant section of the 
[app/pages/workspace/notebook/paragraph/code-editor/code-editor.component.ts](https://github.com/apache/zeppelin/pull/5044/commits/1bbaeaf1fbba60531e774a199e9c445b6242c99d#diff-b9e215ed5d0d59a7732256f1da6be620f4cdcc62019f8807a9046e60017551ae)
 instead. Because the 
[`getEditorSetting`](https://github.com/dididy/zeppelin/blob/6ffd605bd71e3857f5680d2de26ad71469f6b198/zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/code-editor/code-editor.component.ts#L196)
 method that triggers [EDITOR_SETTING is only executed when the parameter of 
`setParagraphMode` is 
`true`](https://github.com/dididy/zeppelin/blob/6ffd605bd71e3857f5680d2de26ad71469f6b198/zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/code-editor/code-editor.component.ts#L192-L198),
 and the only place it is used in this form is inside 
[`onDidChangeModelContent`](https://github.com/dididy/zeppelin/blob/6ffd605bd71e3857f5680d2de26ad71469f6b198/zepp
 
elin-web-angular/src/app/pages/workspace/notebook/paragraph/code-editor/code-editor.component.ts#L86-L99).
 Therefore, [I modified it so that when `setParagraphMode(true)` is called in 
that 
area](https://github.com/apache/zeppelin/pull/5044/commits/1bbaeaf1fbba60531e774a199e9c445b6242c99d#diff-b9e215ed5d0d59a7732256f1da6be620f4cdcc62019f8807a9046e60017551aeR95-R98),
 the timing is adjusted using setTimeout.
   
   After reverted NotebookServer code, everything worked as intended. Thanks 
for pointing out a better way to improve it. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to