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
Remove hard coded text-plain in multiple places #15182
Remove hard coded text-plain in multiple places #15182
Conversation
Thanks for making a pull request to jupyterlab! |
packages/codemirror/src/language.ts
Outdated
@@ -27,7 +27,7 @@ export class EditorLanguageRegistry implements IEditorLanguageRegistry { | |||
// Add default language text/plain -> No expressions to parse | |||
this.addLanguage({ | |||
name: 'none', | |||
mime: 'text/plain', | |||
mime: IEditorMimeTypeService.defaultMimeType, |
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.
I am not sure about this one. It could have unexpected consequences if someone changes defaultMimeType
downstream.
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.
I add that parser it to avoid weird highlight with the default mimetype. But I agree that changing this feels weird. Let's keep it hard coded.
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.
Thanks @fcollonval!
References
Follow-up of #15175
I searched for hard-coded places of
text/plain
and remove those not making sense (reviewers please don't hesitate to challenge that statement)Code changes
Remove hard-coded
text/plain
by the default mime type constant.User-facing changes
None
Backwards-incompatible changes
None