How to use the titanium-editor-commons.completion.generateSDKCompletions 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 / vscode-appcelerator-titanium / src / extension.ts View on Github external
if (error instanceof InteractionError) {
			await handleInteractionError(error);
		}
		return;
	}
	try {
		const sdkInfo = appc.sdkInfo(sdkVersion);
		if (!sdkInfo) {
			// TODO
			return;
		}
		const sdkPath = sdkInfo.path;
		// Generate the completions
		const [ alloy, sdk ] = await Promise.all([
			completion.generateAlloyCompletions(force, completion.CompletionsFormat.v2),
			completion.generateSDKCompletions(force, sdkVersion, sdkPath, completion.CompletionsFormat.v2)
		]);
		if (sdk || alloy) {
			let message = 'Autocomplete suggestions generated for';
			if (sdk) {
				message = `${message} Titanium ${sdk}`;
			}
			if (alloy) {
				message = `${message} Alloy ${alloy}`;
			}
			vscode.window.showInformationMessage(message);
		}
	} catch (error) {
		const actions: InteractionChoice[] = [];
		if (error.code === 'ESDKNOTINSTALLED') {
			actions.push({
				title: 'Install',
github appcelerator / atom-appcelerator-titanium / lib / providers / autoCompleteHelper.js View on Github external
async generateAutoCompleteSuggestions({ force = false } = {}) {
		const sdkVersion = Project.sdk()[0];
		const sdkPath = Appc.sdkInfo(sdkVersion).path;

		try {
			// Generate the completions
			const [ alloy, sdk ] = await Promise.all([
				completion.generateAlloyCompletions(force, completion.CompletionsFormat.v2),
				completion.generateSDKCompletions(force, sdkVersion, sdkPath, completion.CompletionsFormat.v2)
			]);
			if (sdk || alloy) {
				let message = 'Autocomplete suggestions generated for';
				if (sdk) {
					message = `${message} Titanium ${sdk}`;
				}
				if (alloy) {
					message = `${message} Alloy ${alloy}`;
				}
				atom.notifications.addSuccess(message);
			}

		} catch (error) {
			atom.notifications.addError(`Error generating autocomplete suggestions. ${error.message}`);
		}
		this.loadCompletions(sdkVersion);

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