Summary: | Need API for determining Java line delimiter | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Gary Johnston <GaryJohnston> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | martinae, vtrivedi |
Version: | 3.1 | ||
Target Milestone: | 3.2 M4 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Gary Johnston
2005-09-26 13:51:53 EDT
There is org.eclipse.jface.text.TextUtilities in plugin org.eclipse.text. /** * Returns the default line delimiter for the given document. This is either the delimiter of the first line, or the platform line delimiter if it is * a legal line delimiter or the first one of the legal line delimiters. The default line delimiter should be used when performing document * manipulations that span multiple lines. * * @param document the document * @return the document's default line delimiter * @since 3.0 */ public static String getDefaultLineDelimiter(IDocument document) Would this do the trick ? Or do you need it to be on an IJavaElement per se ? Hmm. I dunno. We have an IJavaElement in hand, not an IDocument. Is there a (quick, efficient) way to get an IDocument given an IJavaElement? Added API IOpenable#findRecommendedLineSeparator() and tests JavaModelTests#testFindLineSeparator01/04. Verified for 3.2 M4 using build I20051212-0010 *** Bug 111464 has been marked as a duplicate of this bug. *** Thanks! |