Skip to content

Commit 0caeeeb

Browse files
authored
Reduce firing of OpenedDocument action for projects (#1319)
1 parent 5075646 commit 0caeeeb

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

src/commands/unitTest.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { getFileText, methodOffsetToLine, outputChannel, stripClassMemberNameQuo
55
import { fileSpecFromURI } from "../utils/FileProviderUtil";
66
import { AtelierAPI } from "../api";
77
import { DocumentContentProvider } from "../providers/DocumentContentProvider";
8-
import { StudioActions, OtherStudioAction } from "./studio";
98

109
enum TestStatus {
1110
Failed = 0,
@@ -276,12 +275,6 @@ async function childrenForServerSideFolderItem(
276275
const params = new URLSearchParams(item.uri.query);
277276
const api = new AtelierAPI(item.uri);
278277
if (params.has("project")) {
279-
// Technically a project is a "document", so tell the server that we're opening it
280-
await new StudioActions()
281-
.fireProjectUserAction(api, params.get("project"), OtherStudioAction.OpenedDocument)
282-
.catch(() => {
283-
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
284-
});
285278
query =
286279
"SELECT DISTINCT CASE " +
287280
"WHEN $LENGTH(SUBSTR(Name,?),'.') > 1 THEN $PIECE(SUBSTR(Name,?),'.') " +

src/providers/FileSystemProvider/FileSearchProvider.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { projectContentsFromUri, studioOpenDialogFromURI } from "../../utils/Fil
33
import { notNull } from "../../utils";
44
import { DocumentContentProvider } from "../DocumentContentProvider";
55
import { ProjectItem } from "../../commands/project";
6-
import { StudioActions, OtherStudioAction } from "../../commands/studio";
7-
import { AtelierAPI } from "../../api";
86

97
export class FileSearchProvider implements vscode.FileSearchProvider {
108
/**
@@ -23,16 +21,6 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
2321
const params = new URLSearchParams(options.folder.query);
2422
const csp = params.has("csp") && ["", "1"].includes(params.get("csp"));
2523
if (params.has("project") && params.get("project").length) {
26-
// Technically a project is a "document", so tell the server that we're opening it
27-
await new StudioActions()
28-
.fireProjectUserAction(new AtelierAPI(options.folder), params.get("project"), OtherStudioAction.OpenedDocument)
29-
.catch(() => {
30-
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
31-
});
32-
if (token.isCancellationRequested) {
33-
return;
34-
}
35-
3624
const patternRegex = new RegExp(`.*${pattern}.*`.replace(/\.|\//g, "[./]"), "i");
3725
return projectContentsFromUri(options.folder, true).then((docs) =>
3826
docs

src/providers/FileSystemProvider/TextSearchProvider.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { DocumentContentProvider } from "../DocumentContentProvider";
66
import { notNull, outputChannel, throttleRequests } from "../../utils";
77
import { config } from "../../extension";
88
import { fileSpecFromURI } from "../../utils/FileProviderUtil";
9-
import { OtherStudioAction, StudioActions } from "../../commands/studio";
109

1110
/**
1211
* Convert an `attrline` in a description to a line number in document `content`.
@@ -396,18 +395,6 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
396395
// Needed because the server matches the full line against the regex and ignores the case parameter when in regex mode
397396
const pattern = query.isRegExp ? `${!query.isCaseSensitive ? "(?i)" : ""}.*${query.pattern}.*` : query.pattern;
398397

399-
if (params.has("project") && params.get("project").length) {
400-
// Technically a project is a "document", so tell the server that we're opening it
401-
await new StudioActions()
402-
.fireProjectUserAction(api, params.get("project"), OtherStudioAction.OpenedDocument)
403-
.catch(() => {
404-
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
405-
});
406-
}
407-
if (token.isCancellationRequested) {
408-
return;
409-
}
410-
411398
if (api.config.apiVersion >= 6) {
412399
// Build the request object
413400
const project = params.has("project") && params.get("project").length ? params.get("project") : undefined;

0 commit comments

Comments
 (0)