How to use the titanium-editor-commons.completion function in titanium-editor-commons

To help you get started, we’ve selected a few titanium-editor-commons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appcelerator / atom-appcelerator-titanium / spec / controllerAutoCompleteProvider-spec.js View on Github external
it('Should provide suggestions', async function () {
		Project.isTitaniumApp = true;
		sandbox.stub(tce.completion, 'loadCompletions').resolves(completions);

		initTextEditor('Alloy.');
		const suggestions = await getSuggestions('Alloy.');

		expect(suggestions.length).to.equal(16);

		expect(suggestions[0].type).to.equal('method');
		expect(suggestions[0].displayText).to.equal('Alloy');
		expect(suggestions[0].text).to.equal('Alloy');
		expect(suggestions[0].api).to.equal('Alloy');
		expect(suggestions[0].replacementPrefix).to.equal('Alloy.');

		expect(suggestions[1].type).to.equal('properties');
		expect(suggestions[1].displayText).to.equal('Alloy.CFG');
		expect(suggestions[1].rightLabel).to.equal('Alloy');
		expect(suggestions[1].snippet).to.equal('CFG');
github appcelerator / atom-appcelerator-titanium / spec / controllerAutoCompleteProvider-spec.js View on Github external
it('Should provide suggestions', async function () {
		Project.isTitaniumApp = true;
		sandbox.stub(tce.completion, 'loadCompletions').resolves(completions);

		initTextEditor('Ti.');
		const suggestions = await getSuggestions('Ti.');

		expect(suggestions.length).to.equal(202);

		expect(suggestions[0].type).to.equal('method');
		expect(suggestions[0].text).to.equal('Ti.UI');
		expect(suggestions[0].api).to.equal('Ti');
		expect(suggestions[0].replacementPrefix).to.equal('Ti.');

		expect(suggestions[1].type).to.equal('method');
		expect(suggestions[1].text).to.equal('Ti.XML');
		expect(suggestions[1].api).to.equal('Ti');
		expect(suggestions[1].replacementPrefix).to.equal('Ti.');
github appcelerator / atom-appcelerator-titanium / spec / viewAutoCompleteProvider-spec.js View on Github external
it('should provide tag suggestions', async function () {
		Project.isTitaniumApp = true;
		sandbox.stub(tce.completion, 'loadCompletions').resolves(completions);

		initTextEditor('$2');
		expect(suggestions[0].rightLabel).to.equal('Alloy.Widget');
		expect(suggestions[0].description).to.equal('Alloy.Widget');
		expect(suggestions[0].descriptionMoreURL).to.equal('http://docs.appcelerator.com/platform/latest/#!/api/Alloy.Widget');

		expect(suggestions[1].type).to.equal('tag');
		expect(suggestions[1].displayText).to.equal('Window');
		expect(suggestions[1].snippet).to.equal('Window$1>$2');
github appcelerator / atom-appcelerator-titanium / spec / styleAutoCompleteProvider-spec.js View on Github external
it('should provide tag suggestions', async function () {
		Project.isTitaniumApp = true;
		sandbox.stub(tce.completion, 'loadCompletions').resolves(completions);

		initTextEditor('"W');
		const suggestions = await getSuggestions('W');

		expect(suggestions.length).to.equal(4);

		expect(suggestions[0].type).to.equal('tag');
		expect(suggestions[0].text).to.equal('Widget');
		expect(suggestions[0].rightLabel).to.equal('Alloy.Widget');
		expect(suggestions[0].description).to.equal('Alloy.Widget');
		expect(suggestions[0].descriptionMoreURL).to.equal('http://docs.appcelerator.com/platform/latest/#!/api/Alloy.Widget');

		expect(suggestions[1].type).to.equal('tag');
		expect(suggestions[1].text).to.equal('Window');
		expect(suggestions[1].rightLabel).to.equal('Ti.UI.Window');
		expect(suggestions[1].description).to.equal('Ti.UI.Window: The Window is an empty drawing surface or container.');
github appcelerator / atom-appcelerator-titanium / spec / viewAutoCompleteProvider-spec.js View on Github external
it('should provide property suggestions', async function () {
		Project.isTitaniumApp = true;
		sandbox.stub(tce.completion, 'loadCompletions').resolves(completions);

		initTextEditor('
github appcelerator / atom-appcelerator-titanium / spec / styleAutoCompleteProvider-spec.js View on Github external
it('should provide property name suggestions', async function () {
		Project.isTitaniumApp = true;
		sandbox.stub(tce.completion, 'loadCompletions').resolves(completions);

		initTextEditor('"#id":{s');
		const suggestions = await getSuggestions('s');

		expect(suggestions[0].type).to.equal('property');
		expect(suggestions[0].displayText).to.equal('sys');
		expect(suggestions[0].snippet).to.equal('sys: ');

		expect(suggestions[1].type).to.equal('property');
		expect(suggestions[1].displayText).to.equal('style');
		expect(suggestions[1].snippet).to.equal('style: ');

		expect(suggestions[2].type).to.equal('property');
		expect(suggestions[2].displayText).to.equal('scale');
		expect(suggestions[2].snippet).to.equal('scale: ');
	});

titanium-editor-commons

`titanium-editor-commons` is a commons library for the [Atom](https://github.com/appcelerator/atom-appcelerator-titanium) and [VS Code](https://github.com/appcelerator/vscode-appcelerator-titanium) editor plugins for [Titanium SDK](https://github.com/appc

Apache-2.0
Latest version published 2 years ago

Package Health Score

46 / 100
Full package analysis

Similar packages