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 Dec 14, 2023
2 parents 0fa8b8c + e000779 commit b1395d9
Show file tree
Hide file tree
Showing 172 changed files with 4,456 additions and 2,831 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dbaeumer.vscode-eslint",
"streetsidesoftware.code-spell-checker",
"connor4312.css-theme-completions",
"pedro-w.tmlanguage"
"pedro-w.tmlanguage",
"yzane.markdown-pdf"
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"editor.detectIndentation": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"editor.formatOnSave": true,
"cSpell.words": [
Expand Down
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ For much more detail on incremental work for large features, see our [developer

This section of the CHANGELOG documents features that have been added to the extension, but are still in an experimental phase. Feel free to try them out and provide feedback via discussions or issues on our GitHub page.

Added the ability to convert a notebook to a PDF! This requires an additional extension called ":"Markdown PDF", which you will be prompted to install. This includes:

- A new sidebar entry for PDF generation and a button in the top-right of the notebook to generate a PDF

- When you click either, as long as your notebook is saved to disk, it will create Markdown, open it, and start the PDF generation process

- Once finished, it closes the Markdown file

- The Markdown and PDF file use the same base name as your notebook. Meaning if your notebook is called "My-notebook.idlnb" you will have a "My-notebook.md" and "My-notebook.pdf" file generated in the same folder

- You do need to save your notebook to disk so we have a path to write the Markdown and PDF files

Code style revamp! We reworked how routines, routine methods, properties, and structure names get formatted. This includes:

- Support for camel case ("camelCase") and pascal case ("PascalCase") styling. Mileage may vary here, based on the routine names, so please let us know if this doesn't look quite right or do what you expect. Some routines that start with "IDL" or "ENVI" might surprise you with the case conversion.
Expand All @@ -34,6 +46,50 @@ 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.2.0 December 2023

Updated the ENVI Notebook maps to no longer show "No data available" images and, instead, zoom into the highest zoom level available for basemaps

When you create a new notebook, you are prompted to save so that we can have auto-complete, hover help, and other user interactions.

Also updated the content of the sample notebook to add a note about saving to disk in order to enable those features.

Fixed an issue where we didn't have the right paths for IDL 9.0 on Mac and included a path for ARM64 for Apple Silicon

Re-worked the way that data is moved around between the IDL Language Server and worker threads to be more efficient. Now, no representations of PRO code should be transferred between processed which will provide lower CPU usage and RAM spikes from sharing our syntax tree.

This change ensures that work that happens will occur next to the data that is needed. This should improve:

- Hover help

- Auto-complete

- Go-to definition

- Formatting PRO code

- Formatting IDL and ENVI notebooks

With this change, and if you have very large files, you should notice a dramatic difference performance. For example, the file "slicer3.pro" in the IDL lib folder used to take 4-5 seconds for hover help to appear. Now it takes ~30 milliseconds!

Considering this is a large change, please let us know if there are any noticeable differences that our tests have not captured.

While re-working our data transfer pipeline, we also made some fixes and improvements to auto-complete. There were some test gaps which have now been resolved which will:

- Fixed a problem where auto-complete for procedure methods would add properties when inside the procedure method call

- Fixed a problem where auto-complete for procedure methods would not add variables

- Fixed a problem where auto-complete for procedure methods would not add keywords

- Fixed a problem where auto-complete for methods would not functions

- Changed the logic for when we send properties, procedure methods, and function methods and made it context aware to only send things like procedure methods where they are allowed

Resolve an issue where a circular error would be reported when creating JSON

Fixed an issue where go-to-definition for a notebook cell wouldn't take you to the definition

## 4.1.2 December 2023

Change the way we extract comments to reduce memory and speed up parsing by about 10%
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ See [CHANGELOG](CHANGELOG.md).

- The icons used in VSCode either come from Material Icons (Google via npm "material-icons") or Material Design (Templarian via npm "@mdi/js")

- PDF icon is from "Material Icon Theme"

## Usage Metrics

The IDL extension for VSCode collects anonymous usage data on the extension. The goal of this information is to improve the overall experience, focus development on tools that users work with the most, and make sure our software can run on the average user's hardware.
Expand Down
7 changes: 5 additions & 2 deletions apps/client-e2e/src/tests/notebooks/new-notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import { RunnerFunction } from '../runner.interface';
* Verifies we can create a new notebook document and open it with the right language ID
*/
export const NewNotebook: RunnerFunction = async (init) => {
// make a new notebook
vscode.commands.executeCommand(IDL_COMMANDS.NOTEBOOKS.NEW_NOTEBOOK);
// make a new notebook - arg is to tell us that we dont want to save
await vscode.commands.executeCommand(
IDL_COMMANDS.NOTEBOOKS.NEW_NOTEBOOK,
true
);

// short pause
await Sleep(100);
Expand Down
5 changes: 4 additions & 1 deletion apps/client-e2e/src/tests/notebooks/run-unsaved-notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export const RunUnsavedNotebook: RunnerFunction = async (init) => {
expect(controller.isStarted()).toBeTruthy();

// make new notebook
await vscode.commands.executeCommand(IDL_COMMANDS.NOTEBOOKS.NEW_NOTEBOOK);
await vscode.commands.executeCommand(
IDL_COMMANDS.NOTEBOOKS.NEW_NOTEBOOK,
true
);

// short pause
await Sleep(DEFAULT_RUNNER_TIMEOUT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class MapComponent
: `https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}.png`,

minZoom: 0,
maxZoom: 19,
maxZoom: 16,
tileSize: 256,

renderSubLayers: (props) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/package-json/src/contributes/config/code-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { readFileSync, writeFileSync } from 'fs';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { GetNLS } from '../helpers/get-nls';
import { VerifyNLS } from '../helpers/verify-nls';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@idl/vscode/extension-config';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { VerifyNLS } from '../helpers/verify-nls';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
import { TranslationFromConfiguration } from './translation-from-configuration';
Expand Down
2 changes: 1 addition & 1 deletion apps/package-json/src/contributes/config/idl-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@idl/vscode/extension-config';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { VerifyNLS } from '../helpers/verify-nls';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@idl/vscode/extension-config';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
import {
TranslationFromConfiguration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@idl/vscode/extension-config';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { VerifyNLS } from '../helpers/verify-nls';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
import { TranslationFromConfiguration } from './translation-from-configuration';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@idl/vscode/extension-config';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { VerifyNLS } from '../helpers/verify-nls';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
import { TranslationFromConfiguration } from './translation-from-configuration';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@idl/vscode/extension-config';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { IDLProblemCodeEnumAndTranslations } from '../helpers/enum-and-translations';
import { VerifyNLS } from '../helpers/verify-nls';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@idl/vscode/extension-config';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { VerifyNLS } from '../helpers/verify-nls';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
import { TranslationFromConfiguration } from './translation-from-configuration';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@idl/vscode/extension-config';

import { IPackageNLS } from '../../package.interface';
import { EXTENSION_CONFIG } from '../configuration.interface';
import { EXTENSION_CONFIG } from '../contributes-configuration.interface';
import { VerifyNLS } from '../helpers/verify-nls';
import { IDL_CONFIG_SCOPE } from './idl-config-scope.interface';
import { TranslationFromConfiguration } from './translation-from-configuration';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ COMMAND_ICONS[IDL_COMMANDS.NOTEBOOKS.STOP] = {
dark: 'extension/images/dark/stop.svg',
};

// icon for notebook stop
COMMAND_ICONS[IDL_COMMANDS.NOTEBOOKS.CONVERT_TO_PDF] = {
light: 'extension/images/light/pdf.svg',
dark: 'extension/images/dark/pdf.svg',
};

/**
* Map our command name to the translation which should match
* exactly our command name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AddNotebookConfig } from './config/notebook-config';
import { AddProblemsConfig } from './config/problems-config';
import { AddQuestionsConfig } from './config/questions-config';
import { AddTopLevelConfig } from './config/top-level-config';
import { EXTENSION_CONFIG } from './configuration.interface';
import { EXTENSION_CONFIG } from './contributes-configuration.interface';
import { VerifyNLS } from './helpers/verify-nls';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ import { VerifyNLS } from './helpers/verify-nls';
export const NOTEBOOK_TOOLBAR = [
{
command: IDL_COMMANDS.NOTEBOOKS.RESET,
group: 'navigation',
group: 'navigation/execute',
when: `resourceExtname == ${IDL_NOTEBOOK_EXTENSION}`,
},
{
command: IDL_COMMANDS.NOTEBOOKS.STOP,
group: 'navigation',
group: 'navigation/execute',
when: `resourceExtname == ${IDL_NOTEBOOK_EXTENSION}`,
},
{
command: IDL_COMMANDS.NOTEBOOKS.CONVERT_TO_PDF,
group: 'status',
when: `resourceExtname == ${IDL_NOTEBOOK_EXTENSION}`,
},
];
Expand Down
File renamed without changes.
32 changes: 16 additions & 16 deletions apps/package-json/src/process-package.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { EXTENSION_NAME, EXTENSION_PUBLISHER_NAME } from '@idl/shared';

import { ProcessActivationEvents } from './contributes/activation-events';
import { ProcessActivityBar } from './contributes/activity-bar';
import { ProcessCommands } from './contributes/commands';
import { ProcessConfiguration } from './contributes/configuration';
import { ProcessCustomEditors } from './contributes/custom-editors';
import { ProcessDebugging } from './contributes/debugging';
import { ProcessGrammars } from './contributes/grammars';
import { ProcessIconTheme } from './contributes/icon-theme';
import { ProcessJSONValidators } from './contributes/json-validators';
import { ProcessLanguages } from './contributes/languages';
import { ProcessNotebooks } from './contributes/notebooks';
import { ProcessMainPackageJSON } from './contributes/package-json';
import { ProcessSnippets } from './contributes/snippets';
import { ProcessThemes } from './contributes/themes';
import { ProcessTreeView } from './contributes/tree-view';
import { ProcessWebView } from './contributes/web-view';
import { ProcessActivationEvents } from './contributes/contributes-activation-events';
import { ProcessActivityBar } from './contributes/contributes-activity-bar';
import { ProcessCommands } from './contributes/contributes-commands';
import { ProcessConfiguration } from './contributes/contributes-configuration';
import { ProcessCustomEditors } from './contributes/contributes-custom-editors';
import { ProcessDebugging } from './contributes/contributes-debugging';
import { ProcessGrammars } from './contributes/contributes-grammars';
import { ProcessIconTheme } from './contributes/contributes-icon-theme';
import { ProcessJSONValidators } from './contributes/contributes-json-validators';
import { ProcessLanguages } from './contributes/contributes-languages';
import { ProcessNotebooks } from './contributes/contributes-notebooks';
import { ProcessMainPackageJSON } from './contributes/contributes-package-json';
import { ProcessSnippets } from './contributes/contributes-snippets';
import { ProcessThemes } from './contributes/contributes-themes';
import { ProcessTreeView } from './contributes/contributes-tree-view';
import { ProcessWebView } from './contributes/contributes-web-view';
import { IPackageJSON, IPackageNLS } from './package.interface';

/**
Expand Down
39 changes: 36 additions & 3 deletions apps/parsing-worker/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { AssembleWithIndex } from '@idl/assembler';
import { IDL_WORKER_THREAD_CONSOLE, LogManager } from '@idl/logger';
import { ParseFileSync } from '@idl/parser';
import {
ChangeDetection,
GetHoverHelpLookup,
GetSyntaxProblems,
IDL_INDEX_OPTIONS,
IDLIndex,
Expand Down Expand Up @@ -72,6 +74,22 @@ client.on(LSP_WORKER_THREAD_MESSAGE_LOOKUP.ALL_FILES, async (message) => {
WORKER_INDEX.trackFiles(message.files);
});

/**
* Format files
*/
client.on(
LSP_WORKER_THREAD_MESSAGE_LOOKUP.ASSEMBLE_PRO_CODE,
async (message, cancel) => {
return AssembleWithIndex(
WORKER_INDEX,
message.file,
message.code,
cancel,
message.formatting
);
}
);

/**
* Handle requests to load globals from our IDL docs
*/
Expand Down Expand Up @@ -144,6 +162,21 @@ client.on(
}
);

/**
* Get lookup (recipe) for hover help
*/
client.on(
LSP_WORKER_THREAD_MESSAGE_LOOKUP.GET_HOVER_HELP_LOOKUP,
async (message) => {
return GetHoverHelpLookup(
WORKER_INDEX,
message.file,
message.code,
message.position
);
}
);

/**
* Get outline
*/
Expand Down Expand Up @@ -186,7 +219,7 @@ client.on(
);

// make non-circular
RemoveScopeDetail(parsed, cancel);
RemoveScopeDetail(parsed, cancel, true);

// return
return parsed;
Expand All @@ -208,7 +241,7 @@ client.on(
);

// make non-circular
RemoveScopeDetail(parsed, cancel);
RemoveScopeDetail(parsed, cancel, true);

// return
return parsed;
Expand Down Expand Up @@ -396,7 +429,7 @@ client.on(

// make non-circular
if (parsed !== undefined) {
RemoveScopeDetail(parsed, cancel);
RemoveScopeDetail(parsed, cancel, true);
}

return parsed;
Expand Down
Loading

0 comments on commit b1395d9

Please sign in to comment.