Bug 26454 - DCR: IScanner.setSourceReader
Summary: DCR: IScanner.setSourceReader
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-15 05:55 EST by Martin Aeschlimann CLA
Modified: 2002-11-18 05:17 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2002-11-15 05:55:52 EST
20021114

The scanner is more and more used, e.g. to get a Javadoc comment of a method 
used in every hover window. 
To use the scanner, its input text (setSource(char[])) has to be set. This 
input text is very often the content of a compilation unit.

e.g.
  scanner.setSource(buf.getCharacters());

getCharacters results is a newly created array if the IBuffer of the 
ICompilationUnit has a gap.

We should avoid to create such temporary buffers if possible.
Couldn't the scanner also accept an reader or a construct that allows to access 
the input text by character index?
(e.g. ICharacterBuffer: char charAt(int index))

Another way would be to add a method
ToolFactory.createScanner(IBuffer buf, ....) so performance improvements can be 
done behind the scenes.
Comment 1 Philipe Mulet CLA 2002-11-15 13:12:30 EST
Scanner performance is achieved by using a char[]. Sending messages for every 
single character would be deadly.

Buffered reading would also cause grief to the implementation which is already 
complex.
Comment 2 Philipe Mulet CLA 2002-11-18 05:17:08 EST
Won't change.