Merge pull request #1559 from zed-industries/language-injection

Add language injection support
This commit is contained in:
Max Brunsfeld 2022-08-30 11:54:00 -07:00 committed by GitHub
commit d4bbf21650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 2513 additions and 412 deletions

View file

@ -2067,6 +2067,7 @@ impl Project {
let full_path = buffer.read(cx).file()?.full_path(cx);
let language = self.languages.select_language(&full_path)?;
buffer.update(cx, |buffer, cx| {
buffer.set_language_registry(self.languages.clone());
buffer.set_language(Some(language.clone()), cx);
});