Skip to content
16 changes: 0 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Extension Alone",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceRoot}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/**/*.js"
],
"preLaunchTask": "npm: webpack"
},
{
"name": "Launch Extension",
"type": "extensionHost",
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The extensions in the [official extension pack](https://docs.intersystems.com/co
1. [Node.js](https://nodejs.org/) 22
1. Windows, macOS, or Linux
1. [Visual Studio Code](https://code.visualstudio.com/)
1. [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) (Optional)

### Setup

Expand Down Expand Up @@ -44,8 +45,6 @@ Then, open the debug panel by clicking the `Run and Debug` icon on the Activity
option from the top menu, and click start. A new window will launch with the title
`[Extension Development Host]`. Do your testing here.

If you want to disable all other extensions when testing in the Extension Development Host, choose the `Launch Extension Alone` option instead.

### Pull requests

Work should be done on a unique branch -- not the master branch. Pull requests require the approval of two PMC members, as described in the [Governance document](GOVERNANCE.md). PMC review is often high level, so in addition to that, you should request a review by someone familiar with the technical details of your particular pull request.
Expand Down
8 changes: 4 additions & 4 deletions src/commands/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
} from "../utils";
import { StudioActions } from "./studio";
import { NodeBase, PackageNode, RootNode } from "../explorer/nodes";
import { getUrisForDocument, updateIndexForDocument } from "../utils/documentIndex";
import { getUrisForDocument, updateIndex } from "../utils/documentIndex";

async function compileFlags(): Promise<string> {
const defaultFlags = config().compileFlags;
Expand Down Expand Up @@ -245,9 +245,9 @@ export async function loadChanges(files: (CurrentTextFile | CurrentBinaryFile)[]
// Re-throw the error
throw e;
});
if (isClassOrRtn(file.uri)) {
if (isClassOrRtn(file.uri.path)) {
// Update the document index
updateIndexForDocument(file.uri, undefined, undefined, content);
updateIndex(file.uri, content);
}
} else if (filesystemSchemas.includes(file.uri.scheme)) {
fileSystemProvider.fireFileChanged(file.uri);
Expand Down Expand Up @@ -659,7 +659,7 @@ export async function importLocalFilesToServerSideFolder(wsFolderUri: vscode.Uri
return;
}
// Filter out non-ISC files
uris = uris.filter(isClassOrRtn);
uris = uris.filter((uri) => isClassOrRtn(uri.path));
if (uris.length == 0) {
vscode.window.showErrorMessage("No classes or routines were selected.", "Dismiss");
return;
Expand Down
7 changes: 4 additions & 3 deletions src/commands/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
getWsFolder,
handleError,
isClassOrRtn,
isImportableLocalFile,
lastUsedLocalUri,
notNull,
outputChannel,
Expand All @@ -20,7 +21,7 @@ import {
} from "../utils";
import { pickDocuments } from "../utils/documentPicker";
import { NodeBase } from "../explorer/nodes";
import { updateIndexForDocument } from "../utils/documentIndex";
import { updateIndex } from "../utils/documentIndex";

export function getCategory(fileName: string, addCategory: any | boolean): string {
const fileExt = fileName.split(".").pop().toLowerCase();
Expand Down Expand Up @@ -112,9 +113,9 @@ async function exportFile(wsFolderUri: vscode.Uri, namespace: string, name: stri
// Re-throw the error
throw e;
});
if (isClassOrRtn(fileUri)) {
if (isClassOrRtn(fileUri.path) || isImportableLocalFile(fileUri)) {
// Update the document index
updateIndexForDocument(fileUri, undefined, undefined, content);
updateIndex(fileUri, content);
}
const ws = workspaceFolderOfUri(fileUri);
const mtime = Number(new Date(data.result.ts + "Z"));
Expand Down
10 changes: 4 additions & 6 deletions src/commands/unitTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
notIsfs,
displayableUri,
stripClassMemberNameQuotes,
uriIsParentOf,
uriIsAncestorOf,
} from "../utils";
import { fileSpecFromURI, isfsConfig } from "../utils/FileProviderUtil";
import { AtelierAPI } from "../api";
Expand Down Expand Up @@ -62,9 +62,8 @@ const textDecoder = new TextDecoder();
/** Find the root `TestItem` for `uri` */
function rootItemForItem(testController: vscode.TestController, uri: vscode.Uri): vscode.TestItem | undefined {
let rootItem: vscode.TestItem;
const uriString = uri.toString();
for (const [, i] of testController.items) {
if (uriIsParentOf(i.uri, uri) || uriString == i.uri.toString()) {
if (uriIsAncestorOf(i.uri, uri)) {
rootItem = i;
break;
}
Expand Down Expand Up @@ -422,10 +421,9 @@ async function runHandler(

// Add the initial items to the queue to process
const queue: vscode.TestItem[] = [];
const rootUriString = root.uri.toString();
if (request.include?.length) {
request.include.forEach((i) => {
if (uriIsParentOf(root.uri, i.uri) || i.uri.toString() == rootUriString) {
if (uriIsAncestorOf(root.uri, i.uri)) {
queue.push(i);
}
});
Expand Down Expand Up @@ -1082,7 +1080,7 @@ export function setUpTestController(context: vscode.ExtensionContext): vscode.Di
// Update root items if needed
e.removed.forEach((wf) => {
testController.items.forEach((i) => {
if (uriIsParentOf(wf.uri, i.uri)) {
if (uriIsAncestorOf(wf.uri, i.uri)) {
// Remove this TestItem
classesForRoot.delete(i);
testController.items.delete(i.id);
Expand Down
13 changes: 8 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import {
otherDocExts,
getWsServerConnection,
isClassOrRtn,
isImportableLocalFile,
addWsServerRootFolderData,
getWsFolder,
exportedUris,
Expand Down Expand Up @@ -143,7 +144,7 @@ import {
indexWorkspaceFolder,
removeIndexOfWorkspaceFolder,
storeTouchedByVSCode,
updateIndexForDocument,
updateIndex,
} from "./utils/documentIndex";
import { WorkspaceNode, NodeBase } from "./explorer/nodes";
import { showPlanWebview } from "./commands/showPlanPanel";
Expand Down Expand Up @@ -1090,11 +1091,13 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
checkChangedOnServer(currentFile(event.document));
}
if (
[clsLangId, macLangId, intLangId, incLangId].includes(event.document.languageId) &&
notIsfs(event.document.uri)
notIsfs(event.document.uri) &&
([clsLangId, macLangId, intLangId, incLangId].includes(event.document.languageId) ||
isClassOrRtn(event.document.uri.path) ||
isImportableLocalFile(event.document.uri))
) {
// Update the local workspace folder index to incorporate this change
updateIndexForDocument(event.document.uri);
updateIndex(event.document.uri);
}
}),
vscode.window.onDidChangeActiveTextEditor(async (editor) => {
Expand Down Expand Up @@ -1426,7 +1429,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
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) && !exportedUris.has(f.toString()))
.filter((f) => notIsfs(f) && isClassOrRtn(f.path) && !exportedUris.has(f.toString()))
.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