diff --git a/CHANGELOG.md b/CHANGELOG.md index 067e0497b..5ff33a866 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,12 @@ Code style revamp! We reworked how routines, routine methods, properties, and st - When generating ENVI and IDL tasks, using our new case libraries, we attempt to make a pretty display name from parameter names. For example converting the keyword "my_keyword" to "My Keyword". This applied to task and parameter display names. +## 4.1.1 December 2023 + +Added a new preference for notebooks called "Quiet Mode" that allows you to control the IDL preference for `!quiet` when executing notebook cells. + +When using ".edit" in the debug console, added a message that let's you know that a matching file was not found. + ## 4.1.0 November 2023 Fixed a bug with the debugger that would fail to get information about your IDL session. diff --git a/apps/client-e2e/src/tests/notebooks/_notebook-runner.ts b/apps/client-e2e/src/tests/notebooks/_notebook-runner.ts index 1711071e9..015048c73 100644 --- a/apps/client-e2e/src/tests/notebooks/_notebook-runner.ts +++ b/apps/client-e2e/src/tests/notebooks/_notebook-runner.ts @@ -19,6 +19,7 @@ import { RunTestENVINotebook } from './run-test-envi-notebook'; import { RunTestNotebook } from './run-test-notebook'; import { RunUnsavedNotebook } from './run-unsaved-notebook'; import { SaveAndClearNotebook } from './save-and-clear-output'; +import { VerifyQuietNotebookSetting } from './verify-quiet-notebook-setting'; /* * Logger to be used for tests related to debugging @@ -138,6 +139,14 @@ NOTEBOOK_RUNNER.addTest({ critical: true, }); +// make sure quiet mode works right +// this should always be after the RunNotebookStop test which makes +// sure we have a fresh session to tweak preferences for +NOTEBOOK_RUNNER.addTest({ + name: 'Verify quiet mode for notebooks', + fn: VerifyQuietNotebookSetting, +}); + // notebook problems track right NOTEBOOK_RUNNER.addTest({ name: 'Notebook problems track right', diff --git a/apps/client-e2e/src/tests/notebooks/verify-quiet-notebook-setting.ts b/apps/client-e2e/src/tests/notebooks/verify-quiet-notebook-setting.ts new file mode 100644 index 000000000..c3b70b443 --- /dev/null +++ b/apps/client-e2e/src/tests/notebooks/verify-quiet-notebook-setting.ts @@ -0,0 +1,97 @@ +import { GetExtensionPath, IDL_COMMANDS, Sleep } from '@idl/shared'; +import { GetWorkspaceConfig, IIDLWorkspaceConfig } from '@idl/vscode/config'; +import { IDL_EXTENSION_CONFIG_KEYS } from '@idl/vscode/extension-config'; +import expect from 'expect'; +import * as vscode from 'vscode'; + +import { RunnerFunction } from '../runner.interface'; +import { ICompareCellOutputs } from './helpers/compare-cells.interface'; +import { + DEFAULT_RUNNER_TIMEOUT, + RunNotebookAndCompareCells, +} from './helpers/run-notebook-and-compare-cells'; + +/** + * Types of outputs from cells that we expect to have + */ +export const QUIET_OUTPUT: ICompareCellOutputs[] = [ + { + idx: 0, + success: true, + mimeTypes: [], + }, +]; + +/** + * Types of outputs from cells that we expect to have + */ +export const NOT_QUIET_OUTPUT: ICompareCellOutputs[] = [ + { + idx: 0, + success: true, + mimeTypes: ['text/plain'], + }, +]; + +/** + * Function that runs basic tests for ENVI message listeners + */ +export const VerifyQuietNotebookSetting: RunnerFunction = async (init) => { + // get the current workspace config + const config = GetWorkspaceConfig(); + + // make sure we are quiet + (config as IIDLWorkspaceConfig).update( + IDL_EXTENSION_CONFIG_KEYS.notebooksQuietMode, + true, + true + ); + + // run in quiet mode + await RunNotebookAndCompareCells( + GetExtensionPath('idl/test/client-e2e/notebooks/quiet-preference.idlnb'), + QUIET_OUTPUT, + init.notebooks.controller, + DEFAULT_RUNNER_TIMEOUT + ); + + // turn off + (config as IIDLWorkspaceConfig).update( + IDL_EXTENSION_CONFIG_KEYS.notebooksQuietMode, + false, + true + ); + + // reset + await vscode.commands.executeCommand(IDL_COMMANDS.NOTEBOOKS.RESET); + + // short pause + await Sleep(100); + + // make sure stopped + expect(init.notebooks.controller.isStarted()).toBeTruthy(); + + // run in quiet mode + await RunNotebookAndCompareCells( + GetExtensionPath('idl/test/client-e2e/notebooks/quiet-preference.idlnb'), + NOT_QUIET_OUTPUT, + init.notebooks.controller, + DEFAULT_RUNNER_TIMEOUT + ); + + // turn on again + (config as IIDLWorkspaceConfig).update( + IDL_EXTENSION_CONFIG_KEYS.notebooksQuietMode, + true, + true + ); + + // stop execution + await vscode.commands.executeCommand(IDL_COMMANDS.NOTEBOOKS.STOP); + + // short pause + await Sleep(100); + + // make sure stopped + expect(init.notebooks.controller.isStarted()).toBeFalsy(); +}; diff --git a/apps/package-json/src/contributes/config/notebook-config.ts b/apps/package-json/src/contributes/config/notebook-config.ts index da8a0b6c7..4779814f5 100644 --- a/apps/package-json/src/contributes/config/notebook-config.ts +++ b/apps/package-json/src/contributes/config/notebook-config.ts @@ -39,6 +39,19 @@ export function AddNotebookConfig(nls: IPackageNLS) { scope: IDL_CONFIG_SCOPE, }; + // should our extension run in debug mode + ourConfig.properties[ + `${IDL_LANGUAGE_NAME}.${IDL_EXTENSION_CONFIG_KEYS.notebooksQuietMode}` + ] = { + type: 'boolean', + default: DEFAULT_IDL_EXTENSION_CONFIG.notebooks.quietMode, + description: TranslationFromConfiguration( + IDL_EXTENSION_CONFIG_KEYS.notebooksQuietMode, + nls + ), + scope: IDL_CONFIG_SCOPE, + }; + // save in overall extension config EXTENSION_CONFIG.push(ourConfig); } diff --git a/extension/icon-theme/seti.woff b/extension/icon-theme/seti.woff index 88cb75699..5069a94ff 100644 Binary files a/extension/icon-theme/seti.woff and b/extension/icon-theme/seti.woff differ diff --git a/extension/icon-theme/vs-seti-icon-theme.json b/extension/icon-theme/vs-seti-icon-theme.json index 144a1fed6..b2309454e 100644 --- a/extension/icon-theme/vs-seti-icon-theme.json +++ b/extension/icon-theme/vs-seti-icon-theme.json @@ -1820,6 +1820,7 @@ "version.txt": "_clock", "version": "_clock", "mvnw": "_maven", + "pom.xml": "_maven", "tsconfig.json": "_tsconfig", "swagger.json": "_json_1", "swagger.yml": "_json_1", @@ -1938,7 +1939,7 @@ "sql": "_db", "swift": "_swift", "typescript": "_typescript", - "typescriptreact": "_typescript", + "typescriptreact": "_react", "xml": "_xml", "dockercompose": "_docker_3", "yaml": "_yml", @@ -2264,7 +2265,7 @@ "sql": "_db_light", "swift": "_swift_light", "typescript": "_typescript_light", - "typescriptreact": "_typescript_light", + "typescriptreact": "_react_light", "xml": "_xml_light", "dockercompose": "_docker_3_light", "yaml": "_yml_light", @@ -2312,6 +2313,7 @@ "version.txt": "_clock_light", "version": "_clock_light", "mvnw": "_maven_light", + "pom.xml": "_maven_light", "tsconfig.json": "_tsconfig_light", "swagger.json": "_json_1_light", "swagger.yml": "_json_1_light", @@ -2380,5 +2382,5 @@ "npm-debug.log": "_npm_ignored_light" } }, - "version": "https://github.com/jesseweed/seti-ui/commit/fd20793e5a75b350eab8d489165fb9b420df3f62" + "version": "https://github.com/jesseweed/seti-ui/commit/8eec7f2e37cd8fd91a98c61d129468bb49735a94" } diff --git a/idl/test/client-e2e/notebooks/quiet-preference.idlnb b/idl/test/client-e2e/notebooks/quiet-preference.idlnb new file mode 100644 index 000000000..5075e7291 --- /dev/null +++ b/idl/test/client-e2e/notebooks/quiet-preference.idlnb @@ -0,0 +1,13 @@ +{ + "version": "2.0.0", + "cells": [ + { + "type": "code", + "content": [ + "message, 'Info', /info" + ], + "metadata": {}, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/idl/test/scratch/idltasktest.pro b/idl/test/scratch/idltasktest.pro index ac0f17604..89b9f17da 100644 --- a/idl/test/scratch/idltasktest.pro +++ b/idl/test/scratch/idltasktest.pro @@ -1,12 +1,56 @@ -compile_opt idl2 - -case !true of - !true: begin - - end - else: begin - ; do nothing - end -endswitch +;+ +; :Description: +; LatLon_Distance +; Computes the distance of a rhumb line connecting two points on a sphere or spheroid +; +; The distance between the 2 points, [km] by default +; +; :Returns: any +; +; :Arguments: +; lon1: in, required, any +; Longitude and latitude of the 1st point, p0 +; lat1: in, required, any +; Longitude and latitude of the 1st point, p0 +; lon2: in, required, any +; Longitude and latitude of the 2nd point, p1 +; lat2: in, required, any +; Longitude and latitude of the 2nd point, p1 +; method: in, required, any +; The method to be used, options are: +; 1 - Haversine (sphere) - selected by default +; 2 - Vincenty (spheroid) +; +; :Keywords: +; meters: bidirectional, required, any +; Set this keyword to return the distance in meters +; radians: bidirectional, required, any +; Set this keyword if inputs are specified in radians (the default is degrees) +; radius: bidirectional, required, any +; Set this keyword to a value specifying the radius of the sphere to be used, in [km] +; the default value is the Authalic radius (equal area hyothetical perfect sphere) = 6371.0072 +; semimajor_axis: bidirectional, required, any +; Set this keyword to the length of the semimajor axis of the reference ellipsoid, in [m] +; the default value is the WGS-84 6378137 +; semiminor_axis: bidirectional, required, any +; Set this keyword to the length of the semiminor axis of the reference ellipsoid, in [m] +; the default value is the WGS-84 6356752.314245 +; +; :References: +; Haversine formula ( great-circle distance between two points on a sphere ) +; https://en.wikipedia.org/wiki/Haversine_formula +; Vincenty formula ( distance between two points on the surface of a spheroid ) +; https://en.wikipedia.org/wiki/Vincenty%27s_formulae +; https://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf +; +; :Revisions: +; Thu Jul 29, 2021 - Introduce the Vincenty equation (computation of distances over an spheroid) +; Sun Apr 23, 2023 - Fix the Vincenty calculation at latitudes close to zero +; Wed May 10, 2023 - Allow arrays in the Vincenty method +; +;- +function idltasktest, lon1, lat1, lon2, lat2, method, meters = meters, radians = radians, radius = radius, semimajor_axis = semimajor_axis, semiminor_axis = semiminor_axis + compile_opt idl2 + return, 1 end \ No newline at end of file diff --git a/libs/shared/src/lib/version.interface.ts b/libs/shared/src/lib/version.interface.ts index 09dea4c83..d78446ab9 100644 --- a/libs/shared/src/lib/version.interface.ts +++ b/libs/shared/src/lib/version.interface.ts @@ -1,4 +1,4 @@ /** * Version of the extension */ -export const VERSION = '4.1.0'; +export const VERSION = '4.1.1'; diff --git a/libs/translation/src/lib/languages/en/en.ts b/libs/translation/src/lib/languages/en/en.ts index f0c0d777c..3bf89ae94 100644 --- a/libs/translation/src/lib/languages/en/en.ts +++ b/libs/translation/src/lib/languages/en/en.ts @@ -222,6 +222,8 @@ export const EN: ITranslation = { notebooks: 'Preferences that control notebook user experience for IDL Notebooks', + 'notebooks.quietMode': + 'When enabled, automatically sets `!quiet` to a value of `1` to suppress too much output from IDL and keep notebook cell outputs cleaner.', 'notebooks.embedGraphics': "Are graphics embedded as output within each cell?\n\nIf you have open notebooks, you'll need to stop IDL and then re-run cells for changes to take effect.", @@ -359,6 +361,7 @@ export const EN: ITranslation = { noRoutineFound: 'No main level program or function/procedure with same name as file found', returning: 'File compiled while active, returning...', + nothingToEdit: 'No matching file found', noPauseOnWindows: 'Pause is not currently supported on Windows platforms', syntaxError: 'IDL detected a syntax error on this line when compiling your code', diff --git a/libs/translation/src/lib/translation.interface.ts b/libs/translation/src/lib/translation.interface.ts index 8a35aeeed..8fdbc2724 100644 --- a/libs/translation/src/lib/translation.interface.ts +++ b/libs/translation/src/lib/translation.interface.ts @@ -348,6 +348,8 @@ export interface ITranslation { syntaxError: string; /** Warning text for the debug console to let users know it is a preview feature */ previewWarning: string; + /** When no file is found from .edit */ + nothingToEdit: string; }; /** Error translations */ errors: { diff --git a/libs/vscode/debug/src/lib/idl-debug-adapter.class.ts b/libs/vscode/debug/src/lib/idl-debug-adapter.class.ts index 587809f5c..76009bff2 100644 --- a/libs/vscode/debug/src/lib/idl-debug-adapter.class.ts +++ b/libs/vscode/debug/src/lib/idl-debug-adapter.class.ts @@ -1420,6 +1420,13 @@ export class IDLDebugAdapter extends LoggingDebugSession { vscode.commands.executeCommand(VSCODE_COMMANDS.OPEN_FILE, file, { preview: false, }); + } else { + this.sendEvent( + new OutputEvent( + `${IDL_TRANSLATION.debugger.adapter.nothingToEdit}\n`, + 'stderr' + ) + ); } } diff --git a/libs/vscode/extension-config/src/lib/extension-config.interface.ts b/libs/vscode/extension-config/src/lib/extension-config.interface.ts index a4ffa7f72..3b3272af6 100644 --- a/libs/vscode/extension-config/src/lib/extension-config.interface.ts +++ b/libs/vscode/extension-config/src/lib/extension-config.interface.ts @@ -47,6 +47,8 @@ export interface IDLExtensionsConfigKeys { /** Key for notebook preferences */ readonly notebooks: 'notebooks'; + /** Do we make IDL quiet? */ + readonly notebooksQuietMode: 'notebooks.quietMode'; /** Do we embed graphics or not */ readonly notebooksEmbedGraphics: 'notebooks.embedGraphics'; @@ -133,6 +135,8 @@ export interface ILanguageServerConfig { } export interface INotebookConfig { + /** Do we make IDL quiet? */ + quietMode: boolean; /** Do we embed graphics into notebooks? */ embedGraphics: boolean; } @@ -250,6 +254,7 @@ export const IDL_EXTENSION_CONFIG_KEYS: IDLExtensionsConfigKeys = { languageServerFullParse: 'languageServer.fullParse', notebooks: 'notebooks', + notebooksQuietMode: 'notebooks.quietMode', notebooksEmbedGraphics: 'notebooks.embedGraphics', problems: 'problems', @@ -312,6 +317,7 @@ export const DEFAULT_IDL_EXTENSION_CONFIG: IDLExtensionConfig = { fullParse: true, }, notebooks: { + quietMode: true, embedGraphics: true, }, problems: { diff --git a/libs/vscode/notebooks/src/lib/controller/idl-notebook-controller.class.ts b/libs/vscode/notebooks/src/lib/controller/idl-notebook-controller.class.ts index 8be97377b..bb59f4991 100644 --- a/libs/vscode/notebooks/src/lib/controller/idl-notebook-controller.class.ts +++ b/libs/vscode/notebooks/src/lib/controller/idl-notebook-controller.class.ts @@ -375,7 +375,7 @@ export class IDLNotebookController { */ const commands = [ `retall`, - '!quiet = 1', + `!quiet = ${IDL_EXTENSION_CONFIG.notebooks.quietMode ? '1' : '0'}`, `!magic.embed = ${ IDL_EXTENSION_CONFIG.notebooks.embedGraphics ? '1' : '0' }`, @@ -413,7 +413,7 @@ export class IDLNotebookController { */ const compile = [ `compile_opt idl2`, - `!quiet = 1`, + `!quiet = ${IDL_EXTENSION_CONFIG.notebooks.quietMode ? '1' : '0'}`, `!magic.embed = ${ IDL_EXTENSION_CONFIG.notebooks.embedGraphics ? '1' : '0' }`, diff --git a/package-lock.json b/package-lock.json index 32014b82f..461d8e91a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "idl-for-vscode", - "version": "4.1.0", + "version": "4.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "idl-for-vscode", - "version": "4.1.0", + "version": "4.1.1", "license": "MIT", "dependencies": { "@vscode/debugadapter": "^1.64.0", diff --git a/package.json b/package.json index 809f4e74d..a317eb892 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "idl-for-vscode", "displayName": "%packageJSON.displayName%", "description": "%packageJSON.description%", - "version": "4.1.0", + "version": "4.1.1", "publisher": "idl", "license": "MIT", "encryption": "yes", @@ -725,6 +725,12 @@ "default": true, "description": "%configuration.descriptions.notebooks.embedGraphics%", "scope": "machine-overridable" + }, + "idl.notebooks.quietMode": { + "type": "boolean", + "default": true, + "description": "%configuration.descriptions.notebooks.quietMode%", + "scope": "machine-overridable" } } },