Skip to content

Commit 602d3a5

Browse files
Merge branch 'develop'
2 parents 71d8879 + 6a9b877 commit 602d3a5

143 files changed

Lines changed: 3574 additions & 999 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Added the ability to convert a notebook to a PDF! This requires an additional ex
2020

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

23-
- 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
23+
- 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
2424

2525
- Once finished, it closes the Markdown file
2626

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

3333
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.
3434

35+
Resolved a long-time bug where internal output would appear in the debug console when running IDL in VSCode.
36+
37+
Reworked routine signatures that appear in hover help to be more user friendly!
38+
39+
- You can now copy/paste the signature blocks and each one is valid IDL code
40+
41+
- No brackets surrounding optional parameters
42+
43+
- For functions and function methods, the return type is added before the routine syntax
44+
45+
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.
46+
47+
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.
48+
49+
Add back in the Terminal commands and buttons to the IDL sidebar for users that prefer to use terminals instead of the debug console.
50+
51+
Fixed a bug that incorrectly reported a type incompatibility when using statements like `val eq !null`
52+
53+
To help accentuate syntax errors in files, lines are now highlighted.
54+
55+
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.
56+
57+
Tweak the snippets for for loops to use n_elements() on a variable instead of having a static value
58+
59+
Re-work the logic for running files to be much more flexible. Here's how it behaves:
60+
61+
1. If you have a main level program, compile the file and then run the main program
62+
63+
2. If you have a procedure or function as the bottom-most routine, attempt to call without any arguments keywords
64+
65+
3. If you have a function method or procedure method as the bottom-most routine, we do not run anything
66+
67+
4. If we detect a syntax error when we compile your file, we stop before running
68+
3569
## 4.3.1 February 2024
3670

3771
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!

apps/client-e2e/src/tests/debugging/_debugging-runner.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import { Continue } from './continue';
77
import { Edit } from './edit';
88
import { Exit } from './exit';
99
import { ImpliedPrint } from './implied-print';
10+
import { QueueRight } from './queue-right';
1011
import { RigorousAlwaysReturn } from './rigorous-always-return';
12+
import { RunFile } from './run-file';
1113
import { StartDebugging } from './start';
14+
import { SyntaxErrorTracking } from './syntax_error_tracking';
1215
import { VariableReplacement } from './variable-replacement';
1316

1417
/**
@@ -28,6 +31,22 @@ DEBUGGING_RUNNER.addTest({
2831
critical: true,
2932
});
3033

34+
DEBUGGING_RUNNER.addTest({
35+
name: 'Queue works right',
36+
fn: QueueRight,
37+
critical: true,
38+
});
39+
40+
DEBUGGING_RUNNER.addTest({
41+
name: 'Track syntax errors on compile',
42+
fn: SyntaxErrorTracking,
43+
});
44+
45+
DEBUGGING_RUNNER.addTest({
46+
name: 'Running a file handles all the right cases',
47+
fn: RunFile,
48+
});
49+
3150
DEBUGGING_RUNNER.addTest({
3251
name: 'Run file, stop on stops, and move through code with continue',
3352
fn: Continue,
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { IDL_COMMANDS } from '@idl/shared';
2+
import expect from 'expect';
3+
import * as vscode from 'vscode';
4+
5+
import { RunnerFunction } from '../runner.interface';
6+
7+
/**
8+
* Function that verifies that our queueing works right
9+
*/
10+
export const QueueRight: RunnerFunction = async (init) => {
11+
/**
12+
* Start IDL
13+
*/
14+
const started = await vscode.commands.executeCommand(
15+
IDL_COMMANDS.DEBUG.START
16+
);
17+
18+
// verify we started
19+
expect(started).toBeTruthy();
20+
21+
/**
22+
* Execute two commands at once
23+
*/
24+
const p1 = init.debug.adapter.evaluate(`wait, 1`);
25+
const p2 = init.debug.adapter.evaluate(`wait, 1`);
26+
27+
// wait for everything to finish
28+
await Promise.all([p1, p2]);
29+
30+
// make sure the outputs are the same
31+
expect((await p1).trim()).toEqual('');
32+
expect((await p2).trim()).toEqual('');
33+
};
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import { GetExtensionPath, IDL_COMMANDS, Sleep } from '@idl/shared';
2+
import { OpenFileInVSCode } from '@idl/vscode/shared';
3+
import expect from 'expect';
4+
import * as vscode from 'vscode';
5+
6+
import { RunnerFunction } from '../runner.interface';
7+
8+
/**
9+
* Track the files we need to run
10+
*/
11+
const TO_RUN: { file: string; result: boolean }[] = [
12+
/**
13+
* Main level tests
14+
*/
15+
{
16+
file: GetExtensionPath('idl/test/client-e2e/debug/run-file/main.pro'),
17+
result: true,
18+
},
19+
{
20+
file: GetExtensionPath(
21+
'idl/test/client-e2e/debug/run-file/syntax_error.pro'
22+
),
23+
result: false,
24+
},
25+
26+
/**
27+
* Procedure tests
28+
*/
29+
{
30+
file: GetExtensionPath('idl/test/client-e2e/debug/run-file/procedure.pro'),
31+
result: true,
32+
},
33+
{
34+
file: GetExtensionPath(
35+
'idl/test/client-e2e/debug/run-file/procedure_with_main.pro'
36+
),
37+
result: true,
38+
},
39+
40+
/**
41+
* Function tests
42+
*/
43+
{
44+
file: GetExtensionPath('idl/test/client-e2e/debug/run-file/function.pro'),
45+
result: true,
46+
},
47+
{
48+
file: GetExtensionPath(
49+
'idl/test/client-e2e/debug/run-file/function_with_main.pro'
50+
),
51+
result: true,
52+
},
53+
54+
/**
55+
* When our file doesnt match routine name we dont care
56+
*/
57+
{
58+
file: GetExtensionPath(
59+
'idl/test/client-e2e/debug/run-file/name mismatch.pro'
60+
),
61+
result: true,
62+
},
63+
64+
/**
65+
* Procedure method tests
66+
*/
67+
{
68+
file: GetExtensionPath(
69+
'idl/test/client-e2e/debug/run-file/procedure_method.pro'
70+
),
71+
result: false,
72+
},
73+
{
74+
file: GetExtensionPath(
75+
'idl/test/client-e2e/debug/run-file/procedure_method_with_main.pro'
76+
),
77+
result: true,
78+
},
79+
80+
/**
81+
* Function method tests
82+
*/
83+
{
84+
file: GetExtensionPath(
85+
'idl/test/client-e2e/debug/run-file/function_method.pro'
86+
),
87+
result: false,
88+
},
89+
{
90+
file: GetExtensionPath(
91+
'idl/test/client-e2e/debug/run-file/function_method_with_main.pro'
92+
),
93+
result: true,
94+
},
95+
];
96+
97+
/**
98+
* Function that verifies all of our cases for running files
99+
*/
100+
export const RunFile: RunnerFunction = async (init) => {
101+
/**
102+
* Start IDL
103+
*/
104+
const started = await vscode.commands.executeCommand(
105+
IDL_COMMANDS.DEBUG.START
106+
);
107+
108+
// verify we started
109+
expect(started).toBeTruthy();
110+
111+
// close
112+
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
113+
114+
// process each case
115+
for (let i = 0; i < TO_RUN.length; i++) {
116+
console.log(` Processing file: "${TO_RUN[i].file}"`);
117+
// open file
118+
await OpenFileInVSCode(TO_RUN[i].file, true);
119+
120+
// short pause
121+
await Sleep(100);
122+
123+
// run
124+
const res = await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.RUN);
125+
126+
// verify result
127+
if (TO_RUN[i].result) {
128+
expect(res).toBeTruthy();
129+
} else {
130+
expect(res).toBeFalsy();
131+
}
132+
133+
// close
134+
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
135+
}
136+
};
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { GetExtensionPath, IDL_COMMANDS } from '@idl/shared';
2+
import { Sleep } from '@idl/tests/helpers';
3+
import { OpenFileInVSCode, ReplaceDocumentContent } from '@idl/vscode/shared';
4+
import expect from 'expect';
5+
import * as vscode from 'vscode';
6+
7+
import { RunnerFunction } from '../runner.interface';
8+
9+
/**
10+
* Correct text that we can compile without syntax errors
11+
*/
12+
const VALID_TEXT = `
13+
compile_opt idl2
14+
15+
print, 42
16+
17+
end
18+
`;
19+
20+
/**
21+
* Function that verifies we can track syntax errors
22+
*/
23+
export const SyntaxErrorTracking: RunnerFunction = async (init) => {
24+
/**
25+
* Start IDL
26+
*/
27+
const started = await vscode.commands.executeCommand(
28+
IDL_COMMANDS.DEBUG.START
29+
);
30+
31+
// verify we started
32+
expect(started).toBeTruthy();
33+
34+
// open file
35+
const doc = await OpenFileInVSCode(
36+
GetExtensionPath('idl/test/client-e2e/debug/compile_error.pro')
37+
);
38+
39+
/** Get original text */
40+
const orig = doc.getText();
41+
42+
// short pause to make sure we open and parse
43+
await Sleep(100);
44+
45+
// verify problems
46+
expect(vscode.languages.getDiagnostics(doc.uri).length).toEqual(0);
47+
48+
/**
49+
* Compile and make sure we report an error
50+
* **********************************************************************
51+
*/
52+
53+
// compile
54+
await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.COMPILE);
55+
56+
// short pause to make sure we open and parse
57+
await Sleep(100);
58+
59+
// verify problems
60+
expect(vscode.languages.getDiagnostics(doc.uri).length).toEqual(1);
61+
62+
/**
63+
* Fix syntax error and make sure no syntax errors
64+
* **********************************************************************
65+
*/
66+
67+
// replace the content in our document
68+
await ReplaceDocumentContent(doc, VALID_TEXT);
69+
70+
// compile
71+
await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.COMPILE);
72+
73+
// short pause to make sure we open and parse
74+
await Sleep(100);
75+
76+
// verify problems
77+
expect(vscode.languages.getDiagnostics(doc.uri).length).toEqual(0);
78+
79+
/**
80+
* Go back to the original content and make sure we have the same errors
81+
* **********************************************************************
82+
*/
83+
84+
// replace the content in our document
85+
await ReplaceDocumentContent(doc, orig);
86+
87+
// compile
88+
await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.COMPILE);
89+
90+
// short pause to make sure we open and parse
91+
await Sleep(100);
92+
93+
// verify problems
94+
expect(vscode.languages.getDiagnostics(doc.uri).length).toEqual(1);
95+
};

0 commit comments

Comments
 (0)