You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
In some cases we want to use these specific mappings directly. For file extensions, LanguageManager.getLanguageForPath("file." + extension) can be used. This is still ambivalent, though - even if file extension "foo" generally maps to FooLang, "file.foo" could map to BarLang. Furthermore, if extension is complex (i.e. "foo.bar"), the returned language might belong to either of the file extensions "foo.bar" and "bar".
Instead, two additional methods should provide more direct access to these mappings, and getLanguageForPath should be refactored to use these.
getLanguageForFileNameOnly only checks _fileExtensionToLanguageMap
getLanguageForFileExtensionOnly only checks _fileNameToLanguageMap once
Closing - it's not clear what use cases would require this and we haven't heard the need for it from extension authors. If someone requests it we can add it.
In some cases we want to use these specific mappings directly. For file extensions,
LanguageManager.getLanguageForPath("file." + extension)
can be used. This is still ambivalent, though - even if file extension "foo" generally maps to FooLang, "file.foo" could map to BarLang. Furthermore, ifextension
is complex (i.e. "foo.bar"), the returned language might belong to either of the file extensions "foo.bar" and "bar".Instead, two additional methods should provide more direct access to these mappings, and
getLanguageForPath
should be refactored to use these.getLanguageForFileNameOnly
only checks_fileExtensionToLanguageMap
getLanguageForFileExtensionOnly
only checks_fileNameToLanguageMap
onceThis could be used by #3301.
The text was updated successfully, but these errors were encountered: