Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] ScriptTemplateCompletionProcessor / "File Association" problem

Hi Gabriel,

I think you should associate via Preferences - General - Content Types.

Regards,
Alex

----- Original Message -----
From: "Gabriel Petrovay" <gabipetrovay@xxxxxxxxx>
To: "dltk-dev" <dltk-dev@xxxxxxxxxxx>
Sent: Wednesday, June 3, 2009 4:50:03 PM GMT +06:00 Almaty, Novosibirsk
Subject: [Dltk-dev] ScriptTemplateCompletionProcessor / "File Association" problem

Hi,

I have made a File Association in the eclipse preferences to open a
certain file type with MyScriptEditor. But the code completion is
broken.

In MyScriptTemplateCompletionProcessor.getContextTypeId() I need a
reference to the project where the completion was triggered. For this
I use this code:

IScriptProject project = getContext().getProject();

The project is null because:

the context (a ScriptContentAssistInvocationContext instance) has the
following setup:
fSourceModule = null
fSourceModuleComputed = true

for this reason the source module is not computed and a NULL is returned:

	public ISourceModule getSourceModule() {
		if (!fSourceModuleComputed) {
			//...
		}
		return fSourceModule;
	}



Why aren't the ISourceModule objects generated for the files
associated with MyScriptEditor. (These extensions are nod defined in
the content type associated with the editor.)

Or, the more general question, does everything work for you when you
associate at runtime more file types with an editor?

Thanks!


Regards,
Gabriel


-- 
MSc Gabriel Petrovay
Mobile: +41(0)787978034
www.28msec.com
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top