lib/autocomplete.js
function getMarkupCompletions(editor, pos, config) {
	const line = editor.getLine(pos.line).slice(0, pos.ch);
	const prefix = extractPrefix(line, /[\w:\-$@]/);

	// Make sure that current position precedes element name (e.g. not attribute,
	// class, id etc.)
	if (prefix) {
		const prefixRange = {
			from: { line: pos.line, ch: pos.ch - prefix.length },
			to: pos
		};

		return getSnippetCompletions(editor, pos, config)
			.filter(completion => completion.key !== prefix && completion.key.indexOf(prefix) === 0)
			.map(completion => new EmmetCompletion('snippet', editor, prefixRange, completion.key, completion.preview, completion.snippet));
	}

	return [];
}
function getMarkupCompletions(editor, pos, config) {
	const line = editor.getLine(pos.line).slice(0, pos.ch);
	const prefix = extractPrefix(line, /[\w:\-$@]/);

	// Make sure that current position precedes element name (e.g. not attribute,
	// class, id etc.)
	if (prefix) {
		const prefixRange = {
			from: { line: pos.line, ch: pos.ch - prefix.length },
			to: pos
		};

		return getSnippetCompletions(editor, pos, config)
			.filter(completion => completion.key !== prefix && completion.key.indexOf(prefix) === 0)
			.map(completion => new EmmetCompletion('snippet', editor, prefixRange, completion.key, completion.preview, completion.snippet));
	}

	return [];
}
Returns completions for markup syntaxes (HTML, Slim, Pug etc.)
@param  {CodeMirror} editor
@param  {CodeMirror.Position} pos Cursor position in editor
@param  {Object} config Resolved Emmet config
@return {EmmetCompletion[]}