Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
znorman-harris committed Oct 25, 2023
2 parents 0e7df98 + b1fa3cc commit 8b5e509
Show file tree
Hide file tree
Showing 61 changed files with 1,100 additions and 493 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,32 @@ Here are some of the features that notebooks bring:

- After each cell is executed we issue a `retall` command to make sure that we are at the top-level and not stopped in a weird state

## 3.2.4 October 2023

Fixed an issue where improper versions of node.js were used for the language server startup. This caused failures in the language server starting which would prevent any of the feature goodness of the language server from being accessible.

Added in a sidebar entry for notebooks

Updated cache logic to fix a potential circular JSON error when adding items to our cache

Renamed "Additional Actions" sidebar to "Quick Access" and updated the icon used

Resolve an edge case when running notebooks where a false-failure would be detected that halts notebook execution.

Fixed an issue when launching IDL on Mac where ENVI crashes because "LANG" is missing from the environment

## 3.2.3 September 2023

Re-work cancellation to handle cases where the worker threads were too busy to get the messages that work needs to be stopped. If you now use a very large file (take "slicer3.pro" from the IDL distribution) events are interrupted as expected.

This also includes a fix where flase error messages would show up in the UI for work that was canceled.
This also includes a fix where false error messages would show up in the UI for work that was canceled.

Update most dependencies with changes from first re-release of the extension

Fixed a bug where the "strictarrsubs" compile option was missing from the list of valid compile options

Fixed a bug with the code sidebar icon not showing up in light themes

## 3.2.2 September 2023

Major change to the language server and worker threads to implement a cancellation framework. The ability to cancel work happens automatically for PRO files and IDL Notebooks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const NotebookCompletionBasic: RunnerFunction = async (init) => {
);

// verify definition has return
expect(completion1).not.toBeUndefined();
expect(completion1).toStrictEqual(expect.any(Array));
expect(completion1.length).toEqual(0);

/**
Expand All @@ -65,7 +65,7 @@ export const NotebookCompletionBasic: RunnerFunction = async (init) => {
);

// verify definition has return
expect(completion2).not.toBeUndefined();
expect(completion2).toStrictEqual(expect.any(Array));
expect(completion2.length).not.toEqual(0);

// clear any existing outputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const ProCodeInteractRight: RunnerFunction = async (init) => {
'textDocument/semanticTokens/full',
tokenParams
)
).toBeNull();
).toBeFalsy();

// short pause
await Sleep(250);
Expand Down
10 changes: 9 additions & 1 deletion apps/client-e2e/src/tests/notebooks/helpers/compare-cells.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import expect from 'expect';
import { deepEqual } from 'fast-equals';
import * as vscode from 'vscode';

import {
Expand All @@ -9,7 +10,7 @@ import {
/**
* Compares cells from a notebook against what we expect them to be
*/
export function CompareCellOutputs(
export async function CompareCellOutputs(
nb: vscode.NotebookDocument,
cellOutput: ICompareCellOutputs[]
) {
Expand Down Expand Up @@ -49,6 +50,13 @@ export function CompareCellOutputs(
mimes = mimes.concat(nbCell.outputs[j].items.map((item) => item.mime));
}

if (!deepEqual(mimes, expected.mimeTypes)) {
console.log(`--------------- PROBLEMS --------------------`);
console.log(nbCell.outputs);

await nb.save();
}

// validate cell mime types
expect(mimes).toEqual(expected.mimeTypes);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import * as vscode from 'vscode';
import { CompareCellOutputs } from './compare-cells';
import { ICompareCellOutputs } from './compare-cells.interface';

/**
* Default timeout, ms
*/
export const DEFAULT_RUNNER_TIMEOUT = 100;

/**
* helper function to:
*
Expand All @@ -23,6 +28,7 @@ export async function RunNotebookAndCompareCells(
file: string,
cells: ICompareCellOutputs[],
controller: IDLNotebookController,
timeout: number,
clear = true
) {
// nuke .idl folder if it exists
Expand All @@ -47,11 +53,13 @@ export async function RunNotebookAndCompareCells(
// make sure launched
expect(controller.isStarted()).toBeTruthy();

// short pause
await Sleep(100);
// short pause based on the number of cells we have
// sometimes the rendering takes too long to register (like complex maps)
// so we need an extra pause
await Sleep(timeout);

// compare cells
CompareCellOutputs(nb, cells);
await CompareCellOutputs(nb, cells);

if (clear) {
// clear outputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { GetExtensionPath } from '@idl/shared';

import { RunnerFunction } from '../runner.interface';
import { ICompareCellOutputs } from './helpers/compare-cells.interface';
import { RunNotebookAndCompareCells } from './helpers/run-notebook-and-compare-cells';
import {
DEFAULT_RUNNER_TIMEOUT,
RunNotebookAndCompareCells,
} from './helpers/run-notebook-and-compare-cells';

/**
* Types of outputs from cells that we expect to have
Expand Down Expand Up @@ -56,6 +59,7 @@ export const RunENVIMessageListenerTestNotebook: RunnerFunction = async (
'idl/test/client-e2e/notebooks/envi-message-listener.idlnb'
),
CELL_OUTPUT,
init.notebooks.controller
init.notebooks.controller,
DEFAULT_RUNNER_TIMEOUT
);
};
17 changes: 12 additions & 5 deletions apps/client-e2e/src/tests/notebooks/run-problem-notebooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { GetExtensionPath } from '@idl/shared';

import { RunnerFunction } from '../runner.interface';
import { RunNotebookAndCompareCells } from './helpers/run-notebook-and-compare-cells';
import {
DEFAULT_RUNNER_TIMEOUT,
RunNotebookAndCompareCells,
} from './helpers/run-notebook-and-compare-cells';

/**
* Function that verifies that we can do basic debugging of IDL sessions
Expand Down Expand Up @@ -35,7 +38,8 @@ export const RunProblemNotebooks: RunnerFunction = async (init) => {
mimeTypes: [],
},
],
init.notebooks.controller
init.notebooks.controller,
DEFAULT_RUNNER_TIMEOUT
);

/**
Expand All @@ -51,7 +55,8 @@ export const RunProblemNotebooks: RunnerFunction = async (init) => {
mimeTypes: [],
},
],
init.notebooks.controller
init.notebooks.controller,
DEFAULT_RUNNER_TIMEOUT
);

/**
Expand All @@ -73,7 +78,8 @@ export const RunProblemNotebooks: RunnerFunction = async (init) => {
mimeTypes: [],
},
],
init.notebooks.controller
init.notebooks.controller,
DEFAULT_RUNNER_TIMEOUT
);

/**
Expand All @@ -96,6 +102,7 @@ export const RunProblemNotebooks: RunnerFunction = async (init) => {
mimeTypes: [],
},
],
init.notebooks.controller
init.notebooks.controller,
DEFAULT_RUNNER_TIMEOUT
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { GetExtensionPath } from '@idl/shared';

import { RunnerFunction } from '../runner.interface';
import { ICompareCellOutputs } from './helpers/compare-cells.interface';
import { RunNotebookAndCompareCells } from './helpers/run-notebook-and-compare-cells';
import {
DEFAULT_RUNNER_TIMEOUT,
RunNotebookAndCompareCells,
} from './helpers/run-notebook-and-compare-cells';

/**
* Types of outputs from cells that we expect to have
Expand Down Expand Up @@ -52,7 +55,7 @@ export const CELL_OUTPUT: ICompareCellOutputs[] = [
{
idx: 8,
success: true,
mimeTypes: [],
mimeTypes: [IDL_NOTEBOOK_MIME_TYPE],
},
];

Expand All @@ -65,6 +68,7 @@ export const RunTestENVIMapNotebook: RunnerFunction = async (init) => {
'idl/test/client-e2e/notebooks/test-notebook-envi-maps.idlnb'
),
CELL_OUTPUT,
init.notebooks.controller
init.notebooks.controller,
DEFAULT_RUNNER_TIMEOUT
);
};
8 changes: 6 additions & 2 deletions apps/client-e2e/src/tests/notebooks/run-test-envi-notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { GetExtensionPath } from '@idl/shared';

import { RunnerFunction } from '../runner.interface';
import { ICompareCellOutputs } from './helpers/compare-cells.interface';
import { RunNotebookAndCompareCells } from './helpers/run-notebook-and-compare-cells';
import {
DEFAULT_RUNNER_TIMEOUT,
RunNotebookAndCompareCells,
} from './helpers/run-notebook-and-compare-cells';

/**
* Types of outputs from cells that we expect to have
Expand Down Expand Up @@ -83,6 +86,7 @@ export const RunTestENVINotebook: RunnerFunction = async (init) => {
await RunNotebookAndCompareCells(
GetExtensionPath('idl/test/client-e2e/notebooks/envi-test-notebook.idlnb'),
CELL_OUTPUT,
init.notebooks.controller
init.notebooks.controller,
DEFAULT_RUNNER_TIMEOUT
);
};
6 changes: 5 additions & 1 deletion apps/client-e2e/src/tests/notebooks/run-test-notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { GetExtensionPath } from '@idl/shared';

import { RunnerFunction } from '../runner.interface';
import { ICompareCellOutputs } from './helpers/compare-cells.interface';
import { RunNotebookAndCompareCells } from './helpers/run-notebook-and-compare-cells';
import {
DEFAULT_RUNNER_TIMEOUT,
RunNotebookAndCompareCells,
} from './helpers/run-notebook-and-compare-cells';

/**
* Types of outputs from cells that we expect to have
Expand Down Expand Up @@ -93,6 +96,7 @@ export const RunTestNotebook: RunnerFunction = async (init) => {
GetExtensionPath('idl/test/client-e2e/notebooks/test-notebook.idlnb'),
CELL_OUTPUT,
init.notebooks.controller,
DEFAULT_RUNNER_TIMEOUT,
false
);
};
11 changes: 1 addition & 10 deletions apps/package-json/src/contributes/custom-editors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,7 @@ const ENVI_OPENER_CONFIG = {
/**
* File extensions that we want to register to our ENVI opener
*/
const FILE_EXTENSIONS = [
`dat`,
`tif`,
`tiff`,
`png`,
`bmp`,
`jp2`,
`jp2000`,
`ntf`,
].sort();
const FILE_EXTENSIONS = [`dat`, `tif`, `tiff`, `jp2`, `jp2000`, `ntf`].sort();

/**
* Updates the package.json file for our themes and makes sure everything exists
Expand Down
6 changes: 5 additions & 1 deletion compliance/IMAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ Updated as we go, but here is the source for the images that we use in the exten
- build.svg
https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Abuild%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048
- article.svg
https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aarticle%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048
https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aarticle%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048
- post.svg
https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Apost%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4024
- quick-reference-all.svg
https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aquick_reference_all%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4024
2 changes: 2 additions & 0 deletions extension/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This README is the main entry point for the extension documentation for the IDL

- [**Language Server Crashes**](./general/LANGUAGE_SERVER_CRASHES.md)

- [**Disable ENVI Opening Files**](./general/DISABLE_ENVI_FILE_ASSOCIATIONS.md)

## Content

- [**AutoDoc**](./general/AUTO_DOC.md): High-level overview of AutoDoc and the IDL Docs docs style
Expand Down
14 changes: 14 additions & 0 deletions extension/docs/general/DISABLE_ENVI_FILE_ASSOCIATIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Disable ENVI File Associations

As part of the extension, we enable you do drag and drop image files into VSCode's display. When we detect common image formats, we open those in ENVI.

If you want to disable this, you can reset the file associations to their default values.

Here's how you do this:

1. Open the settings UI
2. Search for 'Editor Associations"
3. Enter the extension you don't want to open in ENVI ("\*.dat" for example)
4. Set the editor as "default"
5. Hit OK
6. Open a file with the extension and it should display in the editor without opening ENVI
Loading

0 comments on commit 8b5e509

Please sign in to comment.