Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Make it possible to set languages defined by an extension as default …#11257

Closed
marcelgerber wants to merge 4 commits intomasterfrom
marcel/extension-language-as-default
Closed

Make it possible to set languages defined by an extension as default …#11257
marcelgerber wants to merge 4 commits intomasterfrom
marcel/extension-language-as-default

Conversation

@marcelgerber
Copy link
Copy Markdown
Contributor

…for a file extension

Filtering out languages which are not currently defined (because they are probably defined by an extension later on) fixes the case described in #11252.

[Already done] Currently, it seems to be working miraculously as the pref change handler fires late enough, but I think I should add an additional AppInit.extensionsLoaded callback just to be safe. (Does anyone know why the change handler is called so late? I don't think that's the intended behavior...)

@TomMalbran
Copy link
Copy Markdown
Contributor

Should we consider the case of a language being defined after the extensions are loaded? Might happen if an extension defines a language after some sort of action and not at startup, or maybe you could have installed a language, set it as default, then deleted that extension, restarted brackets, waited a bit and reinstalled the same language extension.

@marcelgerber
Copy link
Copy Markdown
Contributor Author

I've thought about that too, but I didn't consider the case of installing a new extension.
I'll change it to be updated on defineLanguage soon.

@TomMalbran
Copy link
Copy Markdown
Contributor

I was thinking to call the update code if the preference manager is defined every time a new language is defined.

@marcelgerber
Copy link
Copy Markdown
Contributor Author

@TomMalbran Did that as well.
Unfortunately, I had to move the code around as JSLint had complained otherwise.

@zaggino zaggino added this to the Release 1.9 milestone Aug 27, 2016
@swmitra swmitra modified the milestones: Release 1.10, Release 1.9 Mar 15, 2017
@marcelgerber
Copy link
Copy Markdown
Contributor Author

Superseded by #12979.
Closing.

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.

4 participants