Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 301566 - DLTKLanguageManager.getSourceParser(...) is missing the IProject parameter
Summary: DLTKLanguageManager.getSourceParser(...) is missing the IProject parameter
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: dltk.common-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-02 13:24 EST by Gabriel Petrovay CLA
Modified: 2010-06-11 06:21 EDT (History)
1 user (show)

See Also:


Attachments
patch for DLTK 2.0 (5.26 KB, patch)
2010-02-02 13:24 EST, Gabriel Petrovay CLA
alex.panchenko: iplog+
Details | Diff
patch for DLTK 1.0 (5.19 KB, patch)
2010-02-02 14:13 EST, Gabriel Petrovay CLA
alex.panchenko: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Petrovay CLA 2010-02-02 13:24:19 EST
Created attachment 157934 [details]
patch for DLTK 2.0

This method always calls:

SourceParserManager.getInstance().getSourceParser(null, natureID);

with 'null' instead of the project of the currently parsed module.

This is needed further down the stack for a propper functionality of a selector:

IDLTKContributionSelector selector = getSelector(natureId);
return selector.select(contributions, project);


Attached you have the patch for this bug for DLTK 2.0 HEAD.

I will attach in a few minutes another patch for DLTK 1.0 maintenance.
Comment 1 Gabriel Petrovay CLA 2010-02-02 14:13:18 EST
Created attachment 157943 [details]
patch for DLTK 1.0

Here you go with the patch for the R1_0_maintenance branch.
Comment 2 Gabriel Petrovay CLA 2010-02-02 14:27:09 EST
Of course, the existing method in DLTKLanguageManager can remain for backward compatibility:

public static ISourceParser getSourceParser(String natureID) {
	return SourceParserManager.getInstance()
			.getSourceParser(null, natureID);
}

The patch eliminates it, but there might be other projects that need it.


Gabriel
Comment 3 Alex Panchenko CLA 2010-02-03 10:40:57 EST
Hi Gabriel,

I've committed the changes to HEAD.
Do you think it makes sense to port the fix to 1.0-branch?

Thank you,
Alex
Comment 4 Gabriel Petrovay CLA 2010-02-03 11:02:53 EST
For us it does, since we (XQDT) will only later switch to DLTK 2.0.

Thanks!

Gabriel
Comment 5 Alex Panchenko CLA 2010-02-10 02:02:47 EST
1.0.2 RC3 is uploading to eclipse.org now.