lib/autocomplete/abbreviation.js
function getExpandedAbbreviationCompletion({editor, bufferPosition, prefix, activatedManually}) {
	// We should expand marked abbreviation only.
	// If there’s no marked abbreviation, try to mark it but only if
	// user invoked automomplete popup manually
	let marker = findMarker(editor, bufferPosition);
	if (!marker && activatedManually) {
		marker = markAbbreviation(editor, bufferPosition, activatedManually);
	}

	if (marker) {
		const snippet = marker.model.snippet;

		// For some syntaxes like Pug, it’s possible that extracted abbreviation
		// matches prefix itself (e.g. `li.class` expands to `li.class` in Pug)
		// In this case skip completion output.
		if (removeFields(snippet) === prefix) {
			return null;
		}

		return {
			snippet,
			marker,
			type: 'snippet',
			className: `${baseClass} ${getClassModifier(snippet)}`,
			replacementPrefix: editor.getTextInBufferRange(marker.getRange())
		};
	}
}
function getExpandedAbbreviationCompletion({editor, bufferPosition, prefix, activatedManually}) {
	// We should expand marked abbreviation only.
	// If there’s no marked abbreviation, try to mark it but only if
	// user invoked automomplete popup manually
	let marker = findMarker(editor, bufferPosition);
	if (!marker && activatedManually) {
		marker = markAbbreviation(editor, bufferPosition, activatedManually);
	}

	if (marker) {
		const snippet = marker.model.snippet;

		// For some syntaxes like Pug, it’s possible that extracted abbreviation
		// matches prefix itself (e.g. `li.class` expands to `li.class` in Pug)
		// In this case skip completion output.
		if (removeFields(snippet) === prefix) {
			return null;
		}

		return {
			snippet,
			marker,
			type: 'snippet',
			className: `${baseClass} ${getClassModifier(snippet)}`,
			replacementPrefix: editor.getTextInBufferRange(marker.getRange())
		};
	}
}
function getExpandedAbbreviationCompletion ( { editor , bufferPosition , prefix , activatedManually } ) { // We should expand marked abbreviation only. // If there’s no marked abbreviation, try to mark it but only if // user invoked automomplete popup manually let marker = findMarker ( editor , bufferPosition ) ; if ( ! marker && activatedManually ) { marker = markAbbreviation ( editor , bufferPosition , activatedManually ) ; } if ( marker ) { const snippet = marker . model . snippet ; // For some syntaxes like Pug, it’s possible that extracted abbreviation // matches prefix itself (e.g. `li.class` expands to `li.class` in Pug) // In this case skip completion output. if ( removeFields ( snippet ) === prefix ) { return null ; } return { snippet , marker , type : 'snippet' , className : ` ${ baseClass } ${ getClassModifier ( snippet ) } ` , replacementPrefix : editor . getTextInBufferRange ( marker . getRange ( ) ) } ; } }
Returns completion option for Emmet abbreviation found in given autocomplete
invocation options
@param {Object}  event Autocomplete invocation event
@return {Object} Completion with expanded Emmet abbreviation or `null` if
no valid abbreviation found at given context
Returns completion option for Emmet abbreviation found in given autocomplete invocation options