File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/providers/FileSystemProvider Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -149,8 +149,8 @@ function searchMatchToLine(
149149 // This is in the class description
150150 line = descLineToDocLine ( content , match . attrline , i ) ;
151151 break ;
152- } else if ( match . attr == "Super" ) {
153- // This is a superclass
152+ } else if ( match . attr == "Super" || match . attr == "Name" ) {
153+ // This is in the class definition line
154154 if ( content [ i ] . includes ( match . text ) ) {
155155 line = i ;
156156 }
@@ -306,7 +306,17 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
306306
307307 /** Report matches in `file` to the user */
308308 const reportMatchesForFile = async ( file : SearchResult ) : Promise < void > => {
309- if ( token . isCancellationRequested ) {
309+ // The last three checks are needed to protect against
310+ // bad output from the server due to a bug.
311+ if (
312+ // The user cancelled the search
313+ token . isCancellationRequested ||
314+ // The server reported no matches in this file
315+ ! file . matches . length ||
316+ // The file name is malformed
317+ ( file . doc . includes ( "/" ) && ! / \/ (?: [ ^ / ] + \/ ) + [ ^ / . ] * (?: \. [ ^ / . ] + ) + / . test ( file . doc ) ) ||
318+ ( ! file . doc . includes ( "/" ) && ! / ( % ? [ \p{ L} \d \u{100} - \u{ffff} ] + (?: \. [ \p{ L} \d \u{100} - \u{ffff} ] + ) + ) / u. test ( file . doc ) )
319+ ) {
310320 return ;
311321 }
312322
You can’t perform that action at this time.
0 commit comments