Skip to content

Commit 98c8b4d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix-1019
2 parents f2766b1 + fcad677 commit 98c8b4d

File tree

2 files changed

+61
-36
lines changed

2 files changed

+61
-36
lines changed

docs/Gemfile.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,18 @@ GEM
234234
jekyll-seo-tag (~> 2.1)
235235
minitest (5.15.0)
236236
multipart-post (2.1.1)
237-
nokogiri (1.13.9)
237+
nokogiri (1.13.10)
238238
mini_portile2 (~> 2.8.0)
239239
racc (~> 1.4)
240+
nokogiri (1.13.10-x64-mingw32)
241+
racc (~> 1.4)
240242
octokit (4.22.0)
241243
faraday (>= 0.9)
242244
sawyer (~> 0.8.0, >= 0.5.3)
243245
pathutil (0.16.2)
244246
forwardable-extended (~> 2.6)
245247
public_suffix (4.0.7)
246-
racc (1.6.0)
248+
racc (1.6.1)
247249
rb-fsevent (0.11.1)
248250
rb-inotify (0.10.1)
249251
ffi (~> 1.0)
@@ -274,6 +276,7 @@ GEM
274276
unf (0.1.4)
275277
unf_ext
276278
unf_ext (0.0.8.1)
279+
unf_ext (0.0.8.1-x64-mingw32)
277280
unicode-display_width (1.8.0)
278281
wdm (0.1.1)
279282
webrick (1.7.0)

src/providers/FileSystemProvider/TextSearchProvider.ts

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -251,50 +251,72 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
251251
// Find all lines that we have matches on
252252
const lines = file.matches
253253
.map((match: SearchMatch) => {
254-
let line = Number(match.line);
254+
let line = match.line ? Number(match.line) : null;
255255
if (match.member !== undefined) {
256256
// This is an attribute of a class member
257-
const memberMatchPattern = new RegExp(
258-
`^((?:Class|Client)?Method|Property|XData|Query|Trigger|Parameter|Relationship|Index|ForeignKey|Storage|Projection) ${match.member}`
259-
);
260-
for (let i = 0; i < content.length; i++) {
261-
if (content[i].match(memberMatchPattern)) {
262-
let memend = i + 1;
263-
if (
264-
config("multilineMethodArgs", api.configName) &&
265-
content[i].match(/^(?:Class|Client)?Method|Query /)
266-
) {
267-
// The class member definition is on multiple lines so update the end
268-
for (let j = i + 1; j < content.length; j++) {
269-
if (content[j].trim() === "{") {
270-
memend = j;
271-
break;
272-
}
273-
}
257+
if (match.member == "Storage" && match.attr.includes(",") && match.attrline == undefined) {
258+
// This is inside a Storage definition
259+
const xmlTags = match.attr.split(",");
260+
const storageRegex = new RegExp(`^Storage ${xmlTags[0]}`);
261+
let inStorage = false;
262+
for (let i = 0; i < content.length; i++) {
263+
if (!inStorage && content[i].match(storageRegex)) {
264+
inStorage = true;
265+
xmlTags.shift();
274266
}
275-
if (match.attr === undefined) {
276-
if (match.line === undefined) {
277-
// This is in the class member definition
267+
if (inStorage) {
268+
if (xmlTags.length > 0 && content[i].includes(xmlTags[0])) {
269+
xmlTags.shift();
270+
}
271+
if (xmlTags.length == 0 && content[i].includes(match.text)) {
278272
line = i;
279-
} else {
280-
// This is in the implementation
281-
line = memend + Number(match.line);
273+
break;
282274
}
283-
} else {
284-
if (match.attrline === undefined) {
285-
// This is in the class member definition
286-
line = 1;
287-
} else {
288-
if (match.attr === "Description") {
289-
// This is in the description
290-
line = descLineToDocLine(content, match.attrline, i);
275+
}
276+
}
277+
} else {
278+
const memberMatchPattern = new RegExp(
279+
`^((?:Class|Client)?Method|Property|XData|Query|Trigger|Parameter|Relationship|Index|ForeignKey|Storage|Projection) ${match.member}`
280+
);
281+
for (let i = 0; i < content.length; i++) {
282+
if (content[i].match(memberMatchPattern)) {
283+
let memend = i + 1;
284+
if (
285+
config("multilineMethodArgs", api.configName) &&
286+
content[i].match(/^(?:Class|Client)?Method|Query /)
287+
) {
288+
// The class member definition is on multiple lines so update the end
289+
for (let j = i + 1; j < content.length; j++) {
290+
if (content[j].trim() === "{") {
291+
memend = j;
292+
break;
293+
}
294+
}
295+
}
296+
if (match.attr === undefined) {
297+
if (match.line === undefined) {
298+
// This is in the class member definition
299+
line = i;
291300
} else {
292301
// This is in the implementation
293-
line = memend + match.attrline;
302+
line = memend + Number(match.line);
303+
}
304+
} else {
305+
if (match.attrline === undefined) {
306+
// This is in the class member definition
307+
line = 1;
308+
} else {
309+
if (match.attr === "Description") {
310+
// This is in the description
311+
line = descLineToDocLine(content, match.attrline, i);
312+
} else {
313+
// This is in the implementation
314+
line = memend + match.attrline;
315+
}
294316
}
295317
}
318+
break;
296319
}
297-
break;
298320
}
299321
}
300322
} else if (match.attr !== undefined) {

0 commit comments

Comments
 (0)