Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,11 @@
"description": "If true, REST requests and responses to and from InterSystems servers will be logged to the ObjectScript Output channel. This should only be enabled when debugging a potential issue.",
"type": "boolean",
"default": false
},
"objectscript.insertStubContent": {
"description": "If true, stub content will be inserted when a blank new class or routine file is created in a client-side workspace folder.",
"type": "boolean",
"default": true
}
}
},
Expand Down
11 changes: 9 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ function sendWsFolderTelemetryEvent(wsFolders: readonly vscode.WorkspaceFolder[]
dockerCompose: !serverSide ? String(typeof conf.get("conn.docker-compose") == "object") : undefined,
"config.conn.links": String(Object.keys(conf.get("conn.links", {})).length),
"config.refreshClassesOnSync": !serverSide ? conf.get("refreshClassesOnSync") : undefined,
"config.insertStubContent": !serverSide ? conf.get("insertStubContent") : undefined,
});
});
}
Expand Down Expand Up @@ -1409,8 +1410,14 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
vscode.workspace.onDidCreateFiles((e: vscode.FileCreateEvent) =>
e.files
// Attempt to fill in stub content for classes and routines that
// are not server-side files and were not created due to an export
.filter((f) => notIsfs(f) && isClassOrRtn(f.path) && !exportedUris.has(f.toString()))
// are client-side files and were not created due to an export
.filter(
(f) =>
notIsfs(f) &&
isClassOrRtn(f.path) &&
!exportedUris.has(f.toString()) &&
vscode.workspace.getConfiguration("objectscript", f).get<boolean>("insertStubContent")
)
.forEach(async (uri) => {
// Need to wait in case file was created using "Save As..."
// because in that case the file gets created without
Expand Down
Loading