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
Enable setTextDocumentLanguage #119429
Enable setTextDocumentLanguage #119429
Conversation
src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel.ts
Outdated
Show resolved
Hide resolved
I think I'm getting it. Currently only the cell view model knows about the Also any issue with giving it to the cell text model here instead of listening on model creation events?
|
Exactly.
I don't think that's a good place. It feels like an awkward coupling to me and it would also not take care of documents that get closed |
de2d391
to
12d0e04
Compare
src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.ts
Show resolved
Hide resolved
12d0e04
to
0846ad5
Compare
src/vs/workbench/contrib/notebook/browser/viewModel/markdownCellViewModel.ts
Outdated
Show resolved
Hide resolved
22f53c1
to
3b39462
Compare
This PR fixes #117936
When a TextModel is created, we set it on the cell VM which listens to language updates on it until it's disposed. The NotebookCellTextModel can still get a language set on it, and the TextModel will take that language when it's initialized.