Bug 127655 [api] Must have a way to query quick assist context from source viewer
I20060214-0010 [api] Must have a way to query quick assist context from text viewer. In addition, quick assistant install must specify that besides ITextViewer also ITextViewerExtension7 must be present in order to get the invocation context. ==> assertion failure if this is not met.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/PropertiesFileCorrectionAssistant.java
*/
	private int computeOffsetWithCorrection(int initalOffset) {
		IRegion lineInfo= null;
		try {
			lineInfo= fViewer.getDocument().getLineInformationOfOffset(initalOffset);
		} catch (BadLocationException ex) {
			return -1;
		}
		int startOffset= lineInfo.getOffset();
		int endOffset= startOffset + lineInfo.getLength();
		int result= computeOffsetWithCorrection(startOffset, endOffset, initalOffset);
		if (result > 0 && result != initalOffset)
			return result;
		else
			return -1;
	}
	/**
	 * @return the best matching offset with corrections or -1 if nothing is found
	 */
	private int computeOffsetWithCorrection(int startOffset, int endOffset, int initialOffset) {
		IAnnotationModel model= null;
		IEditorInput input= fEditor.getEditorInput();
		if (!(input instanceof IStorageEditorInput))
			return -1;
		ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
		IPath path= null;
		try {
			path= ((IStorageEditorInput)input).getStorage().getFullPath();
			if (path == null)
				return -1;