Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] Giving a nameSourceStart and nameSourceEnd to the ISourceElementRequestor.ImportInfo

Hi all,

Since an import also has a name like a method or a field declaration,
wouldn't it it be nice to have also the two fields, nameSourceStart
and nameSourceEnd, like in the ElementInfo also in the
ISourceElementRequestor.ImportInfo.

If you take the example of JDT, when you click on an import in the
Outline View, the class name in the import is highlighted in the
editor. The same functionality can be achieved if the two above
mentioned field are also provided in the
ISourceElementRequestor.ImportInfo.

As I see, the ModelElementInfo hierarchy is already prepared for this
since ImportDeclarationElementInfo is inheriting from
MemberElementInfo. So only a minor addition is also needed in the
SourceModuleStructureRequestor.acceptImport(ImportInfo importInfo)
method:

		ImportDeclarationElementInfo info = new ImportDeclarationElementInfo();
		info.setSourceRangeStart(importInfo.sourceStart);
		info.setSourceRangeEnd(importInfo.sourceEnd);
// >>> NEW CODE BEGIN
		info.setNameSourceStart(importInfo.nameSourceStart );
		info.setNameSourceEnd(importInfo.nameSourceEnd);
// >>> NEW CODE END


Could you or I do this?

Does this have other implications in the Search functionality?

Thanks!

-- 
MSc Gabriel Petrovay
Mobile: +41(0)787978034
www.28msec.com


Back to the top