Skip to content
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

Merged
merged 5 commits into from Apr 1, 2021
Merged

Enable setTextDocumentLanguage #119429

merged 5 commits into from Apr 1, 2021

Conversation

roblourens
Copy link
Member

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.

@roblourens roblourens added this to the April 2021 milestone Mar 24, 2021
@roblourens
Copy link
Member Author

roblourens commented Mar 29, 2021

I think I'm getting it. Currently only the cell view model knows about the ITextModel but does it make more sense for the cell text model to hold it?

Also any issue with giving it to the cell text model here instead of listening on model creation events?

result = this._modelService.createModel(

@jrieken
Copy link
Member

jrieken commented Mar 29, 2021

the ITextModel but does it make more sense for the cell text model to hold it?

Exactly.

Also any issue with giving it to the cell text model here instead of listening on model creation events?

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

@roblourens roblourens force-pushed the roblou/languageModel branch 2 times, most recently from de2d391 to 12d0e04 Compare March 29, 2021 18:33
@roblourens roblourens merged commit b41213c into notebook/dev Apr 1, 2021
@roblourens roblourens deleted the roblou/languageModel branch April 1, 2021 00:04
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants