mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
js multiline string literals consider '\n' escape sequence to be equivalent to actual newline.
When formatting injection, allow formatter to consider it same whitespace. Fixes WEB-25477
This commit is contained in:
@@ -141,6 +141,11 @@ public class FormattingDocumentModelImpl implements FormattingDocumentModel {
|
||||
if (!injectedLanguage.equals(myFile.getLanguage())) {
|
||||
WhiteSpaceFormattingStrategy localStrategy = WhiteSpaceFormattingStrategyFactory.getStrategy(injectedLanguage);
|
||||
if (localStrategy != null) {
|
||||
String unescapedText = InjectedLanguageUtil.getUnescapedLeafText(injectedElement, true);
|
||||
if (unescapedText != null) {
|
||||
return localStrategy.check(unescapedText, 0, unescapedText.length()) >= unescapedText.length();
|
||||
}
|
||||
|
||||
return localStrategy.check(myDocument.getCharsSequence(), startOffset, endOffset) >= endOffset;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user