Java Code Examples for com.intellij.openapi.util.ProperTextRange#assertProperRange()

The following examples show how to use com.intellij.openapi.util.ProperTextRange#assertProperRange() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BashEnhancedLiteralTextEscaper.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
protected boolean decodeText(String content, @NotNull TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
    ProperTextRange.assertProperRange(rangeInsideHost);

    Ref<int[]> sourceOffsetsRef = new Ref<int[]>();
    boolean result = TextProcessorUtil.enhancedParseStringCharacters(content, outChars, sourceOffsetsRef);
    this.outSourceOffsets = sourceOffsetsRef.get();

    return result;
}
 
Example 2
Source File: BashSimpleTextLiteralEscaper.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
@Override
public boolean decode(@NotNull final TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
    ProperTextRange.assertProperRange(rangeInsideHost);
    String subText = rangeInsideHost.substring(myHost.getText());

    Ref<int[]> sourceOffsetsRef = new Ref<int[]>();
    boolean result = TextProcessorUtil.parseStringCharacters(subText, outChars, sourceOffsetsRef);
    this.outSourceOffsets = sourceOffsetsRef.get();

    return result;
}
 
Example 3
Source File: BashIdentityStringLiteralEscaper.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
@Override
public boolean decode(@NotNull final TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
    ProperTextRange.assertProperRange(rangeInsideHost);

    outChars.append(rangeInsideHost.substring(myHost.getText()));

    return true;
}
 
Example 4
Source File: HeredocLiteralEscaper.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
@Override
public boolean decode(@NotNull final TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
    ProperTextRange.assertProperRange(rangeInsideHost);

    outChars.append(rangeInsideHost.substring(myHost.getText()));

    return true;
}
 
Example 5
Source File: CSharpStringLiteralEscaper.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Override
public boolean decode(@Nonnull final TextRange rangeInsideHost, @Nonnull StringBuilder outChars)
{
	ProperTextRange.assertProperRange(rangeInsideHost);
	String subText = rangeInsideHost.substring(myHost.getText());
	myOutSourceOffsets = new int[subText.length() + 1];
	return parseStringCharacters(subText, outChars, myOutSourceOffsets);
}
 
Example 6
Source File: BashIdentityTextPreprocessor.java    From BashSupport with Apache License 2.0 4 votes vote down vote up
public BashIdentityTextPreprocessor(TextRange contentRange) {
    ProperTextRange.assertProperRange(contentRange);
    this.contentRange = contentRange;
}
 
Example 7
Source File: CommentLiteralEscaper.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public boolean decode(@Nonnull final TextRange rangeInsideHost, @Nonnull StringBuilder outChars) {
  ProperTextRange.assertProperRange(rangeInsideHost);
  outChars.append(myHost.getText(), rangeInsideHost.getStartOffset(), rangeInsideHost.getEndOffset());
  return true;
}