Skip to content

[Feature Request] #3910

Closed Answered by spahnke
arnav56745 asked this question in Q&A
Discussion options

You must be logged in to vote

The editor does not have an associated language, only models have since there could be multiple models that all have different languages associated with them. The language property on the editor creation function is just a shorthand that sets the language of the model the editor automatically creates for you. So to change a language you need to get the model and then call monaco.editor.setModelLanguage:
https://microsoft.github.io/monaco-editor/playground.html?source=v0.37.1#XQAAAALOAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw0BRoNohO0pA3UnSQetsfyL9Rw59E2COVxnxnvCRAg0kwCdQb8ogwu-POzKkkdtD5T7ftMOciItf5sNfdz3glkVyhab3fb-vdOYqBGSKPB_xWM4Wo2Qm9A…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arnav56745
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
feature-request Request for new features or functionality
2 participants
Converted from issue

This discussion was converted from issue #3905 on April 13, 2023 12:37.