src/vs/editor/common/services/textResourceConfigurationService.ts/TextResourceConfigurationService/getLanguage
class TextResourceConfigurationService:	private getLanguage(resource: URI, position: IPosition | null): string | null {
		const model = this.modelService.getModel(resource);
		if (model) {
			return position ? model.getLanguageIdAtPosition(position.lineNumber, position.column) : model.getLanguageId();
		}
		return this.languageService.guessLanguageIdByFilepathOrFirstLine(resource);
	}