DecodeSourceDecodeLanguages

class Languages

A context for looking up languages based on file extension or name.

Definitions

def parse_reference(text, default_language: nil)

Parse a language agnostic reference: e.g. ruby MyModule::MyClass

Implementation

def parse_reference(text, default_language: nil)
	if match = REFERENCE.match(text)
		language = self.fetch(match[:name]) || default_language
		
		return language.reference_for(match[:identifier])
	elsif default_language
		return default_language.reference_for(text)
	end
end