-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new-log-viewer: Add custom Monaco editor themes and a Monaco language for logs. #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the suggestions on theme.ts
and utils.ts
. The rest looks good to me.
@@ -7,6 +7,17 @@ import * as monaco from "monaco-editor/esm/vs/editor/editor.api.js"; | |||
import {ACTION_NAME} from "../../../utils/actions"; | |||
|
|||
|
|||
enum TOKEN_NAMES { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum TOKEN_NAMES { | |
enum TOKEN_NAME { |
Plural naming is reserved for arrays.
* Resets the cached page size in case it causes a client OOM. If it doesn't, the saved value | ||
* will be restored when {@link restoreCachedPageSize} is called. | ||
*/ | ||
const resetCachedPageSize = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was pulled out from Editor to avoid max lines lint violation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor things.
/** | ||
* Sets up custom themes for the Monaco editor. | ||
*/ | ||
const setupThemes = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: Grammatically, this should be setUpThemes
since setup
is a noun, not a verb. Feel free to ignore if you think it's more confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about initThemes
?
On the other hand, for consistency we should rename the other functions as well. Any objection if we do the renaming in the same PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mm, that might touch a lot of places. We could leave it as setupXxx
for now and do the refactoring in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
new-log-viewer/src/components/Editor/MonacoInstance/language.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the PR title, how about:
new-log-viewer: Add custom Monaco editor themes and a Monaco language for logs.
References
new-log-viewer series: #45 #46 #48 #51 #52 #53 #54 #55 #56 #59 #60 #61 #62 #63 #66 #67 #68
#59 added theming support via JoyUI.
Description
Validation performed