eclipse-theia/theia

regex search crashes tab on non-fixed-width lookbehind

Open

#7.196 geöffnet am 22. Feb. 2020

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (2.478 Forks)batch import
bughelp wantedsearch in workspace

Repository-Metriken

Stars
 (18.676 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 15T 4h) (75 gemergte PRs in 30 T)

Beschreibung

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)

Contributor Guide