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

adds getLanguages() for accessing the language map #6768

Closed
wants to merge 1 commit into from

Conversation

BigBlueHat
Copy link

Mostly geared toward extensions that need to
know the current state of the language map
before they provide further features.

@redmunds I blame you for this. 😉

Mostly geared toward extensions that need to
know the current state of the language map
before they provide further features.
@BigBlueHat
Copy link
Author

My hope is to use this in my LangMan extension.

@redmunds redmunds self-assigned this Feb 5, 2014
@redmunds
Copy link
Contributor

redmunds commented Feb 5, 2014

@BigBlueHat Thanks for contributing to Brackets. First, you need to agree to the Brackets CLA.

Next, take a look at the Switch language / syntax mode of current document pull request to make sure you're not duplicating any effort with your extension. I think that other change is more about changing language mode for single documents where you're thinking more about changing language mode for file extensions.

@peterflynn
Copy link
Member

Hmm, exposing the full state of LanguageManager as a mutable object might be asking for trouble. @BigBlueHat maybe it'd be good to enumerate the use cases your extension is trying to handle, and which of them the existing APIs aren't able to support?

@peterflynn
Copy link
Member

If your extension just needs the list of available languages -- and can do everything else via the existing Language APIs -- then it might be enough to just offer an API that returns Object.keys(_languages)...

@redmunds
Copy link
Contributor

Haven't heard back. Closing.

@redmunds redmunds closed this Mar 25, 2014
@BigBlueHat
Copy link
Author

Oof.. For some reason I missed all the notifications about this until last night. 😦 Sorry about that.

@peterflynn the #6409 pull request includes code that is equivalent to my patch:

/**
* Returns all of the languages currently defined in the LanguageManager.
* @return {Object.<string, Language>} A map containing all of the
* languages currently defined.
*/
function getLanguages() {
return _languages;
}

So, no worries on including this commit in itself.

The LangMan extension is meant to eventually offer a UI that lets one associate "random" file extensions with supported languages. I need to learn more about Brackets before I flesh it out. The .getLanguages need was just the first impasse I hit.

I'll watch #6409 and try to get LangMan done following that.

Thanks @redmunds for cleaning house. 😉

@redmunds
Copy link
Contributor

Re-opening.

@redmunds redmunds reopened this Mar 25, 2014
@redmunds
Copy link
Contributor

Re-Closing. This will get merged in #6409.

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.

3 participants