|
1 | 1 | import * as vscode from "vscode"; |
2 | 2 | import { AtelierAPI } from "../api"; |
3 | | -import { cspAppsForApi, handleError } from "."; |
| 3 | +import { cspAppsForApi, handleError, notIsfs } from "."; |
| 4 | +import { isfsConfig } from "./FileProviderUtil"; |
4 | 5 |
|
5 | 6 | interface DocumentPickerItem extends vscode.QuickPickItem { |
6 | 7 | /** The full name of this item, including its parent(s). */ |
@@ -293,6 +294,9 @@ export async function pickDocument( |
293 | 294 | let gen: "0" | "1" = "0"; |
294 | 295 | let map: "0" | "1" = "1"; |
295 | 296 | const query = "SELECT Name, Type FROM %Library.RoutineMgr_StudioOpenDialog(?,1,1,?,1,0,?,,0,?)"; |
| 297 | + // Only show web app files in the list if we're in a server-side web app folder. |
| 298 | + // Hiding these files in other cases will improve performance. |
| 299 | + const showWeb = typeof api.wsOrFile == "object" && !notIsfs(api.wsOrFile) && isfsConfig(api.wsOrFile).csp; |
296 | 300 |
|
297 | 301 | return new Promise<string>((resolve) => { |
298 | 302 | const quickPick = vscode.window.createQuickPick(); |
@@ -325,7 +329,16 @@ export async function pickDocument( |
325 | 329 | const getItems = (): Promise<void> => { |
326 | 330 | quickPick.busy = true; |
327 | 331 | return api |
328 | | - .actionQuery(query, [typeSuffix ? `*.${typeSuffix}` : "*,'*.prj,'*.bpl,'*.dtl", sys, gen, map]) |
| 332 | + .actionQuery(query, [ |
| 333 | + typeSuffix |
| 334 | + ? `*.${typeSuffix}` |
| 335 | + : showWeb |
| 336 | + ? "*,'*.prj,'*.bpl,'*.dtl" |
| 337 | + : "*.cls,*.mac,*.int,*.inc,*.other,'*.bpl,'*.dtl", |
| 338 | + sys, |
| 339 | + gen, |
| 340 | + map, |
| 341 | + ]) |
329 | 342 | .then((data) => { |
330 | 343 | quickPick.items = data.result.content.map((i) => createSingleSelectItem(i)); |
331 | 344 | quickPick.selectedItems = []; |
|
0 commit comments