Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
znorman-harris committed Apr 9, 2024
2 parents 71d8879 + 6a9b877 commit 602d3a5
Show file tree
Hide file tree
Showing 143 changed files with 3,574 additions and 999 deletions.
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Added the ability to convert a notebook to a PDF! This requires an additional ex

- 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
- When you click the button to create a PDF, 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

Expand All @@ -32,6 +32,40 @@ Added the ability to convert a notebook to a PDF! This requires an additional ex

Fixed an issue where the names of ENVI and IDL tasks were incorrectly lower-case instead of what the user had specified in the task files.

Resolved a long-time bug where internal output would appear in the debug console when running IDL in VSCode.

Reworked routine signatures that appear in hover help to be more user friendly!

- You can now copy/paste the signature blocks and each one is valid IDL code

- No brackets surrounding optional parameters

- For functions and function methods, the return type is added before the routine syntax

Changed the output from IDL in the debug console so that it no longer prints "IDL>" or "ENVI>" for a new user experience compared to the IDL Workbench.

Fixed an issue with fast parsing where line continuations and comments were not handled correctly which would make parsing miss keywords, arguments, and make some up.

Add back in the Terminal commands and buttons to the IDL sidebar for users that prefer to use terminals instead of the debug console.

Fixed a bug that incorrectly reported a type incompatibility when using statements like `val eq !null`

To help accentuate syntax errors in files, lines are now highlighted.

As part of the syntax error line highlights, we have the framework to support code coverage in the future! Which should be coming in a release at some point.

Tweak the snippets for for loops to use n_elements() on a variable instead of having a static value

Re-work the logic for running files to be much more flexible. Here's how it behaves:

1. If you have a main level program, compile the file and then run the main program

2. If you have a procedure or function as the bottom-most routine, attempt to call without any arguments keywords

3. If you have a function method or procedure method as the bottom-most routine, we do not run anything

4. If we detect a syntax error when we compile your file, we stop before running

## 4.3.1 February 2024

Resolved an issue where the language server would take a while to startup when you didn't have any workspace folders open. It should be almost instantaneous now!
Expand Down
19 changes: 19 additions & 0 deletions apps/client-e2e/src/tests/debugging/_debugging-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import { Continue } from './continue';
import { Edit } from './edit';
import { Exit } from './exit';
import { ImpliedPrint } from './implied-print';
import { QueueRight } from './queue-right';
import { RigorousAlwaysReturn } from './rigorous-always-return';
import { RunFile } from './run-file';
import { StartDebugging } from './start';
import { SyntaxErrorTracking } from './syntax_error_tracking';
import { VariableReplacement } from './variable-replacement';

/**
Expand All @@ -28,6 +31,22 @@ DEBUGGING_RUNNER.addTest({
critical: true,
});

DEBUGGING_RUNNER.addTest({
name: 'Queue works right',
fn: QueueRight,
critical: true,
});

DEBUGGING_RUNNER.addTest({
name: 'Track syntax errors on compile',
fn: SyntaxErrorTracking,
});

DEBUGGING_RUNNER.addTest({
name: 'Running a file handles all the right cases',
fn: RunFile,
});

DEBUGGING_RUNNER.addTest({
name: 'Run file, stop on stops, and move through code with continue',
fn: Continue,
Expand Down
33 changes: 33 additions & 0 deletions apps/client-e2e/src/tests/debugging/queue-right.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { IDL_COMMANDS } from '@idl/shared';
import expect from 'expect';
import * as vscode from 'vscode';

import { RunnerFunction } from '../runner.interface';

/**
* Function that verifies that our queueing works right
*/
export const QueueRight: RunnerFunction = async (init) => {
/**
* Start IDL
*/
const started = await vscode.commands.executeCommand(
IDL_COMMANDS.DEBUG.START
);

// verify we started
expect(started).toBeTruthy();

/**
* Execute two commands at once
*/
const p1 = init.debug.adapter.evaluate(`wait, 1`);
const p2 = init.debug.adapter.evaluate(`wait, 1`);

// wait for everything to finish
await Promise.all([p1, p2]);

// make sure the outputs are the same
expect((await p1).trim()).toEqual('');
expect((await p2).trim()).toEqual('');
};
136 changes: 136 additions & 0 deletions apps/client-e2e/src/tests/debugging/run-file.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import { GetExtensionPath, IDL_COMMANDS, Sleep } from '@idl/shared';
import { OpenFileInVSCode } from '@idl/vscode/shared';
import expect from 'expect';
import * as vscode from 'vscode';

import { RunnerFunction } from '../runner.interface';

/**
* Track the files we need to run
*/
const TO_RUN: { file: string; result: boolean }[] = [
/**
* Main level tests
*/
{
file: GetExtensionPath('idl/test/client-e2e/debug/run-file/main.pro'),
result: true,
},
{
file: GetExtensionPath(
'idl/test/client-e2e/debug/run-file/syntax_error.pro'
),
result: false,
},

/**
* Procedure tests
*/
{
file: GetExtensionPath('idl/test/client-e2e/debug/run-file/procedure.pro'),
result: true,
},
{
file: GetExtensionPath(
'idl/test/client-e2e/debug/run-file/procedure_with_main.pro'
),
result: true,
},

/**
* Function tests
*/
{
file: GetExtensionPath('idl/test/client-e2e/debug/run-file/function.pro'),
result: true,
},
{
file: GetExtensionPath(
'idl/test/client-e2e/debug/run-file/function_with_main.pro'
),
result: true,
},

/**
* When our file doesnt match routine name we dont care
*/
{
file: GetExtensionPath(
'idl/test/client-e2e/debug/run-file/name mismatch.pro'
),
result: true,
},

/**
* Procedure method tests
*/
{
file: GetExtensionPath(
'idl/test/client-e2e/debug/run-file/procedure_method.pro'
),
result: false,
},
{
file: GetExtensionPath(
'idl/test/client-e2e/debug/run-file/procedure_method_with_main.pro'
),
result: true,
},

/**
* Function method tests
*/
{
file: GetExtensionPath(
'idl/test/client-e2e/debug/run-file/function_method.pro'
),
result: false,
},
{
file: GetExtensionPath(
'idl/test/client-e2e/debug/run-file/function_method_with_main.pro'
),
result: true,
},
];

/**
* Function that verifies all of our cases for running files
*/
export const RunFile: RunnerFunction = async (init) => {
/**
* Start IDL
*/
const started = await vscode.commands.executeCommand(
IDL_COMMANDS.DEBUG.START
);

// verify we started
expect(started).toBeTruthy();

// close
await vscode.commands.executeCommand('workbench.action.closeAllEditors');

// process each case
for (let i = 0; i < TO_RUN.length; i++) {
console.log(` Processing file: "${TO_RUN[i].file}"`);
// open file
await OpenFileInVSCode(TO_RUN[i].file, true);

// short pause
await Sleep(100);

// run
const res = await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.RUN);

// verify result
if (TO_RUN[i].result) {
expect(res).toBeTruthy();
} else {
expect(res).toBeFalsy();
}

// close
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
}
};
95 changes: 95 additions & 0 deletions apps/client-e2e/src/tests/debugging/syntax_error_tracking.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { GetExtensionPath, IDL_COMMANDS } from '@idl/shared';
import { Sleep } from '@idl/tests/helpers';
import { OpenFileInVSCode, ReplaceDocumentContent } from '@idl/vscode/shared';
import expect from 'expect';
import * as vscode from 'vscode';

import { RunnerFunction } from '../runner.interface';

/**
* Correct text that we can compile without syntax errors
*/
const VALID_TEXT = `
compile_opt idl2
print, 42
end
`;

/**
* Function that verifies we can track syntax errors
*/
export const SyntaxErrorTracking: RunnerFunction = async (init) => {
/**
* Start IDL
*/
const started = await vscode.commands.executeCommand(
IDL_COMMANDS.DEBUG.START
);

// verify we started
expect(started).toBeTruthy();

// open file
const doc = await OpenFileInVSCode(
GetExtensionPath('idl/test/client-e2e/debug/compile_error.pro')
);

/** Get original text */
const orig = doc.getText();

// short pause to make sure we open and parse
await Sleep(100);

// verify problems
expect(vscode.languages.getDiagnostics(doc.uri).length).toEqual(0);

/**
* Compile and make sure we report an error
* **********************************************************************
*/

// compile
await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.COMPILE);

// short pause to make sure we open and parse
await Sleep(100);

// verify problems
expect(vscode.languages.getDiagnostics(doc.uri).length).toEqual(1);

/**
* Fix syntax error and make sure no syntax errors
* **********************************************************************
*/

// replace the content in our document
await ReplaceDocumentContent(doc, VALID_TEXT);

// compile
await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.COMPILE);

// short pause to make sure we open and parse
await Sleep(100);

// verify problems
expect(vscode.languages.getDiagnostics(doc.uri).length).toEqual(0);

/**
* Go back to the original content and make sure we have the same errors
* **********************************************************************
*/

// replace the content in our document
await ReplaceDocumentContent(doc, orig);

// compile
await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.COMPILE);

// short pause to make sure we open and parse
await Sleep(100);

// verify problems
expect(vscode.languages.getDiagnostics(doc.uri).length).toEqual(1);
};
Loading

0 comments on commit 602d3a5

Please sign in to comment.