eclipse-theia/theia

regex search crashes tab on non-fixed-width lookbehind

開放

#7,196 建立於 2020年2月22日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (2,478 個分叉)batch import
bughelp wantedsearch in workspace

倉庫指標

星標
 (18,676 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Description

Theia's Editor search with regex feature breaks on variable-width lookbehind and crashes the browser tab with it

Reproduction Steps

Create a file with the following string def test_function(test='ing'):

Bring up the search feature of the Editor (ctrl/cmd+f), and select the Use Regular Expression setting

Paste the following regex: (?<=def .*?\([^=]*)=

Observe the browser tab crashing

OS and Theia version: Backend Ubuntu 18.04 running the current docker theiaide/theia: sha256:fe271369304ab765a61162fd512bc150403a366348e516a4e7895c7317d6531e Frontend via Chrome 80.0.3987.116 on Windows 10

Diagnostics: When performing the equivalent operation in python3, an error is raised informing that look-behind requires fixed-width pattern. Reproduce with:

re.search("(?<=def .*?\([^=]*)=", "def test_function(test='ing'):")

This suggests that maybe a requirement for fixed-width lookbehind (and probably lookaheads..) is not properly raising an error and being translated into a non-crashing GUI representation of the error in the browser, such as a little red error box saying Invalid regular expression: look-behind requires fixed-width pattern (like the little red box that appears when trying to search for the following regular expression x( which says Invalid regular expression ... unterminated group)

貢獻者指南