Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [handly-dev] Proposed API change: IModule

Hi Vlad,

 > Is ISourceConstruct.getSourceFile really necessary anymore?

Good question!

I decided to keep it mainly for binary compatibility (though the contract compatibility is apparently broken, existing model implementations will not be affected by it).

Also, this method can conveniently save a downcast, especially for models that have only "source" modules, for which the check for the null return value is not necessary. (And that's the only models Handly supported thus far).

However, I agree that leaving this method in place may muddle the waters a bit.

I think we can deprecate and remove it eventually if the need arises. Do you feel that removing it now would result in a much cleaner solution?

> I'm unsure about SourceElementUtil.getSourceElement and SourceElement.getElementAt: the 'position' argument might not be relevant for IModules that aren't shown in textual buffers (but still show an outline linked to the current selection).

Yes, these methods are only relevant for modules that have associated source code. It corresponds to the design of ITypeRoot in JDT.

If there is no source, one just don't need to call them. The outline framework has a default behavior and the necessary hooks one can override for dealing with a non-text selection. So I think it should not be much of a problem.

Thanks again for your feedback!
Vladimir




Back to the top