本文整理匯總了TypeScript中vs/editor/common/model/textModel.TextModel.parseSearchRequest方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript TextModel.parseSearchRequest方法的具體用法?TypeScript TextModel.parseSearchRequest怎麽用?TypeScript TextModel.parseSearchRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/model/textModel.TextModel
的用法示例。
在下文中一共展示了TextModel.parseSearchRequest方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getReplaceString
private getReplaceString(matchRange: Range): string {
if (this._state.isRegex) {
let regExp = TextModel.parseSearchRequest(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord);
let replacePattern = new ReplacePattern(this._state.replaceString, true, regExp);
let model = this._editor.getModel();
let matchedString = model.getValueInRange(matchRange);
let replacedString = replacePattern.getReplaceString(matchedString);
// If matched string is not matching then regex pattern has a lookahead expression
if (replacedString === null) {
replacedString = replacePattern.getReplaceString(this._getTextToMatch(matchRange, regExp));
}
return replacedString;
}
return this._state.replaceString;
}