src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts/TrimFinalNewLinesParticipant/findLastNonEmptyLine
class TrimFinalNewLinesParticipant:	private findLastNonEmptyLine(model: ITextModel): number {
		for (let lineNumber = model.getLineCount(); lineNumber >= 1; lineNumber--) {
			const lineContent = model.getLineContent(lineNumber);
			if (lineContent.length > 0) {
				// this line has content
				return lineNumber;
			}
		}
		// no line has content
		return 0;
	}