Skip to content

Commit 3b3d412

Browse files
Merge remote-tracking branch 'origin/develop'
2 parents 827448d + 3ac6160 commit 3b3d412

349 files changed

Lines changed: 6100 additions & 1938 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.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/.github
55
/.vscode
66
/.vscode-test
7+
apps/idl-docs-parser/src/htmls
78
/dist
89
/coverage
910
/idl/test/client-e2e

CHANGELOG.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,50 @@ Document some advanced types so users may try them out and provide feedback. The
1616

1717
- Read more in the extension documentation
1818

19-
IDL 9.1 introduces new, command-line based progress bars. We have a first-pass of support for these progress bars inside IDL Notebooks.
19+
IDL 9.1 introduces new, command-line based progress bars. We have a first-pass of support for these progress bars inside IDL Notebooks (not all types are supported).
20+
21+
## 4.7.0 - November 2024
22+
23+
Added the ability to statically determine the return types for functions and function methods that don't have documentation. This means that, for the following example, we properly detect that we return an IDL Long (because of `compile_opt idl2`):
24+
25+
```idl
26+
function myFunc
27+
compile_opt idl2
28+
return, 42 ; or is it 84?
29+
end
30+
```
31+
32+
This marks the first step of an iterative process to automatically detect types from code when you don't have strict documentation. We can also, in the future, check to make sure actual return values match docs.
33+
34+
In order to detect types from your code, we had to make some pretty big changes to the language server in order to properly resolve types that don't come from documentation. With that, if you notice any odd behaviors or issues, please reach out to us on Github to let us know of any problems. For large workspaces, such as the IDL lib folder, this means it will take about 1.5-2.5 more seconds to parse your code (depending on complexity of your code base and how many routines are called in other files).
35+
36+
In order for our type detection functionality to work correctly, we did have to revert a change we recently made to reduce long-term memory usage of the language server.
37+
38+
However, we did tweak the in-memory cache for parsed files to optimize performance. We no longer copy complex data structures which adds a 10-15% performance improvement parse speed and helps reduce memory usage.
39+
40+
Optimized the language server change detection process to focus on only routines/globals that have changed and not everything in a file (change detection is a process for validating usage of routines in other files when the source definition is updated).
41+
42+
Changed the error message reported when we can't find a structure definition. This adds some context for why we might not know about a structure definition to help users who aren't following best practices/standards.
43+
44+
Fixed a bug where code actions were not appearing in notebook cells.
45+
46+
Fixed an issue where code actions, in notebooks, incorrectly fixed issues on the first line of a cell.
47+
48+
Fixed an issue where the language server was not correctly detecting pointers being de-referenced. This caused false errors for "standalone expressions" to be reported and for formatting to not function correctly.
49+
50+
Update extension docs with the latest version of node.js that we require (to work around language server crashes).
51+
52+
Updated hover help packaged with the extension with ENVI 6.1, IDL 9.1, and ENVI Deep Learning 3.0.1 docs
53+
54+
Tweak the logic for how we respond to settings changes for problems that we report. This change means, as you change which problems you want reported in real-time, the problems tab in VSCode will add/remove problems that you do/don't want to see. Previously you would need to restart VSCode for the changes to take effect.
55+
56+
Improved the logic when checking if we report problems or not for a file to account for the folder on IDL's path being recursive or not.
57+
58+
Fixed an issue where, when disabling problems from duplicate routines, they were still being reported.
59+
60+
Updating our formatting logic to add a final line feed or carriage return after the last line of a file when formatting your code.
61+
62+
POtential fix to resolve canonical (true) filepaths when you have symbolic links in your workspace or on IDL's search path. This should fix a problem where the same file was incorrectly having two paths and reporting duplicate problems.
2063

2164
## 4.6.2 - September 2024
2265

@@ -32,6 +75,8 @@ Fixed an issue where, from the JSON settings editor, a valid extension setting w
3275

3376
Fixed an issue where the "don't ask again" options didn't honor your choice for using IDL as the formatter.
3477

78+
Fixed an issue where "none" style for functions and procedures was not being honored as expected.
79+
3580
## 4.6.1 - September 2024
3681

3782
Added layer controls to the Notebook Map.

README.md

Lines changed: 21 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
</div>
1818
<br>
1919
<div align="center" style="height: 2.5em;">
20-
<a href="https://marketplace.visualstudio.com/items?itemName=IDL.idl-for-vscode">
21-
<img alt="VS Code Marketplace Downloads" src="https://img.shields.io/visual-studio-marketplace/d/idl.idl-for-vscode"></a>
20+
<!-- <a href="https://marketplace.visualstudio.com/items?itemName=IDL.idl-for-vscode">
21+
<img alt="VS Code Marketplace Downloads" src="https://img.shields.io/visual-studio-marketplace/d/idl.idl-for-vscode"></a> -->
2222
<a href="https://marketplace.visualstudio.com/items?itemName=idl.idl-for-vscode">
2323
<img alt="VS Code Marketplace Installs" src="https://img.shields.io/visual-studio-marketplace/i/idl.idl-for-vscode"></a>
2424
<a href="https://github.com/interactive-data-language/vscode-idl">
@@ -28,108 +28,42 @@
2828
</div>
2929
</p>
3030

31-
<hr>
31+
## About
3232

33-
<div align="center">
34-
<video controls autoplay loop muted playsinline style="max-width: 720px; width: 100%">
35-
<source src="https://vis-webcontent.s3.amazonaws.com/vscode-idl/vscode-tiny.mp4" type="video/mp4">
36-
</video>
37-
</div>
33+
An open-source extension which brings IDL (Interactive Data Language) to Visual Studio Code! This extension does _not_ include IDL, but you can download it from our website [here](https://portal.nv5geospatialsoftware.com/).
3834

39-
**4.0.0 is here!**
35+
This extension includes:
4036

41-
This release headlines our newest feature: IDL Notebooks! The IDL Notebook format is standalone and only requires this extension to function (no extra dependencies on Python or Jupyter).
37+
- A full-featured IDL code editor, with variable type detection, auto complete, chromacoding, problem reporting, and code formatting
4238

43-
Within the extension, you'll find a new sidebar entry to help create a new notebook, open IDL and ENVI Notebook examples, and convert your IDL Notebooks to a PRO file as well. If you have questions, feel free to reach out to us on GitHub with any feedback or issues you encounter.
39+
- Does not require IDL to be installed to write/edit code. IDL is only required when debugging/running code or using IDL Notebooks.
4440

45-
In addition to this, we have revamped our tools for styling/formatting your code to include other case styles like pascal and camel case.
41+
- An integrated debugger with breakpoints, or run command-line IDL within the VS Code terminal
4642

47-
That's not all that is included in this release, so check out the [CHANGELOG.md](./CHANGELOG.md) for full details.
43+
- Native support IDL Notebooks with embedded graphics and save to PDF (this is from VSCode, does not require Python)
4844

49-
> If you are looking to contribute, or get your development environment setup, see [CONTRIBUTING.md](./CONTRIBUTING.md).
45+
- Hover help contains the complete documentation for ENVI and IDL, including examples that you can open in IDL Notebooks.
5046

51-
---
47+
- Create routine-definition documentation for routines within SAVE files or DLMs
5248

53-
This extension adds syntax highlighting, code snippets, debugging, problem reporting (undefined variables and syntax errors, 100+ in total!), IDL Notebooks, and much more for the Interactive Data Language (IDL) from NV5 Geospatial Software (formerly Research Systems, Inc.).
54-
55-
For a full list of changes, see [CHANGELOG.md](./CHANGELOG.md) for lots of details.
56-
57-
## IDL Requirement
49+
- Support for internationalization
5850

59-
Using the "debug" sessions of IDL requires that you have a version of IDL with lists, hashes, and orderedhashes (and the ability to parse/serialize JSON).
51+
- Submit a bug/feature for adding languages. Hopefully they are for a language that you speak, so you could also help with the translation :)
6052

61-
The extension is tested against:
53+
Check out our [official docs site](https://interactive-data-language.github.io/vscode-idl/) to learn more about these features and what else is included in the extension.
6254

63-
- IDL 8.9
55+
## IDL and ENVI Requirement
6456

65-
- IDL 9.0
57+
You do not need IDL installed to write code with this extension. If you are using IDL Notebooks, the debug sessions of IDL, or running IDL in a terminal window, you will need to have IDL installed on the same machine where VSCode is running.
6658

67-
Anything else is use-at-your-own-risk and may not work.
59+
While there are many versions of IDL out there, we test the extension against the two latest versions of IDL. As of right now, that would be IDL 9.1 and IDL 9.0. Any other version is use-at-your-own-risk and may not work (you need lists, hashes, and ordered hashes for it to function).
6860

69-
Notebooks have specific version requirements for IDL and ENVI:
61+
IDL Notebooks have specific version requirements for IDL and ENVI:
7062

7163
- For IDL, you'll need IDL 8.8.0 or newer (enforced, and checked, when notebooks start)
7264

7365
- For ENVI, you'll need ENVI 6.0 or ENVI 5.7. Any other version of ENVI is not guaranteed to work.
7466

75-
## Features
76-
77-
- IDL Notebooks for a new, modern, and ad-hoc way to develop IDL code! Check out the examples to learn about how they work (accessible through the sidebar of the extension).
78-
79-
- Before compiling any code, more than 100 syntax errors/problems/hints are detected and reported to users.
80-
81-
- Syntax errors you encounter while writing code offer information/details on why they are problems to help you learn the in's and out's of IDL better.
82-
83-
- Syntax-based highlighting to make it easy to visually catch errors. This new-and-improved highlighting experience also accentuates keywords and operators like never before. Actual colors will depend on your theme and there is a guide for how you can customize token colors/appearances for IDL.
84-
85-
- Ability to format your code on save and have control over key formatting preferences. The default matches what we think of as a modern approach and styling to IDL code that will be welcoming to new users.
86-
87-
- AutoDoc which, if enabled, automatically adds/updates documentation for user routines as you save your files. Works for routines and structure definitions found within "\_\_define" named procedures
88-
89-
- **Debugging!** A preview release of debugging has been implemented and is stable enough for use. **Note**: this is going to be re-worked over the course of the next 3-6 months
90-
91-
- Hover help for user-defined variables, functions, procedures, arguments, and keywords.
92-
93-
- Integrated hover help for core IDL and ENVI routines, their keywords, and structure properties.
94-
95-
- Integrated support for ENVI and IDL task files in workspaces and on IDL's path, including auto complete and hover help
96-
97-
- Go-to definition for functions, procedures, and methods from user defined routines
98-
99-
- Extensive auto-complete built on the IDL and ENVI documentation. Auto-complete is also automatic (you don't have to press Ctrl + Space in order to trigger it).
100-
101-
- Provides a high-level outline of your code with global constructs (i.e. routines and main level programs)
102-
103-
- Profiling. Get basic profiling information for your routines and access via buttons or commands.
104-
105-
- Custom IDL color themes. If you are feeling like you miss the IDL Workbench, then the "Retro IDL" theme is for you! Two more dark themes are included and are "Novus IDL" and "Neon IDL."
106-
107-
- Finds `TODO` statements just like the workbench
108-
109-
- Support for VSCode's auto-comment (Ctrl+/ or command+/)
110-
111-
- Code snippets for common code blocks
112-
113-
- Colorization and schema validation of ENVI and IDL task files.
114-
115-
- Commands (Ctrl+shift+p) for terminal and debug sessions:
116-
117-
- Opening an IDL session
118-
119-
- Compiling
120-
121-
- Running PRO files (run button in the workbench)
122-
123-
- Executing PRO files as batch files (single line statements)
124-
125-
- Execution controls (stop, in, over, out) for IDL in a terminal
126-
127-
- Plus some others!
128-
129-
- Support for internationalization
130-
131-
- Submit a bug/feature for adding languages. Hopefully they are for a language that you speak, so you could also help with the translation :)
132-
13367
## Known Issues
13468

13569
- Not an issue, but structure definitions are _only_ found in procedures that end with "\_\_define" following IDL's standard. If you define structures anywhere else, they will not be detected and you'll see a error regarding unknown structures.
@@ -138,11 +72,9 @@ Notebooks have specific version requirements for IDL and ENVI:
13872

13973
When the IDL extension starts, if it finds node.js on your path, it will automatically start the language server using node, which should remove this limitation. If you still see memory errors, then reach out to us on GitHub and let us know.
14074

141-
To install node.js, get the latest v18 release from https://nodejs.org/en/download/releases.
142-
143-
- As a part of the code that we parse, we also do our best to statically determine types and do type checking. If you notice issues with type checks being wrong, or there are incorrectly documented routines, let us know!
75+
To install node.js, get the latest v20 release from https://nodejs.org/en/download/releases.
14476

145-
- The debugger is back and has some improvements. However, this is still a pre-release version of the ability to interactively run IDL code. For the next IDL release in late 2023 we are hoping to have this dramatically improved. Here's a few important things to know:
77+
- The debugger is back and has some improvements. However, this is still a pre-release version of the ability to interactively run IDL code. Here's a few important things to know:
14678

14779
- Pausing is not supported on Windows, this will hopefully be resolved in the near future. Currently it kills the IDL process and is being worked on.
14880

@@ -206,6 +138,6 @@ To learn more about what we collect and why, view our [USAGE_METRICS](./extensio
206138

207139
## Legal
208140

209-
Copyright (c) 2023, NV5 Geospatial Software, Inc.
141+
Copyright (c) 2024, NV5 Geospatial Software, Inc.
210142

211143
Licensed under MIT, see LICENSE.txt.

apps/client-e2e/src/tests/interactions/_interactions-runner.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import {
1818
ProCodeCodeActionsExisting,
1919
ProCodeCodeActionsNoExisting,
2020
} from './code-actions/pro-code-code-actions';
21+
import { ProCodeCodeActionsNotebook } from './code-actions/pro-code-code-actions-notebook';
22+
import { ProCodeCodeActionsNotebook2 } from './code-actions/pro-code-code-actions-notebook-2';
2123
import { AddDocs } from './commands/add-docs';
2224
import {
2325
MigrateCodeDL30,
@@ -138,7 +140,12 @@ INTERACTIONS_RUNNER.addTest({
138140

139141
INTERACTIONS_RUNNER.addTest({
140142
name: 'Code actions for notebook cell',
141-
fn: ProCodeCodeActionsExisting,
143+
fn: ProCodeCodeActionsNotebook,
144+
});
145+
146+
INTERACTIONS_RUNNER.addTest({
147+
name: 'Code actions for notebook cell 2',
148+
fn: ProCodeCodeActionsNotebook2,
142149
});
143150

144151
INTERACTIONS_RUNNER.addTest({
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
import { GetExtensionPath, Sleep } from '@idl/shared';
2+
import { GetRealDiagnostic, OpenNotebookInVSCode } from '@idl/vscode/shared';
3+
import expect from 'expect';
4+
import * as vscode from 'vscode';
5+
import { CodeActionParams } from 'vscode-languageserver';
6+
7+
import { CLIENT_E2E_CONFIG } from '../../client-e2e-config.interface';
8+
import { RunnerFunction } from '../../runner.interface';
9+
10+
/**
11+
* Verifies code actions do the right thing for notebooks
12+
*/
13+
export const ProCodeCodeActionsNotebook2: RunnerFunction = async (init) => {
14+
/** Open notebooks */
15+
const nb = await OpenNotebookInVSCode(
16+
GetExtensionPath('idl/test/client-e2e/problems/code-actions-2.idlnb')
17+
);
18+
19+
/** Get first cell */
20+
const doc = nb.getCells()[0].document;
21+
22+
// short pause to make sure we open and parse
23+
await Sleep(CLIENT_E2E_CONFIG.DELAYS.DEFAULT);
24+
25+
// get diagnostics
26+
const diags = GetRealDiagnostic(vscode.languages.getDiagnostics(doc.uri));
27+
28+
// verify problems
29+
expect(diags.length).toEqual(1);
30+
31+
/**
32+
* Get URi for the notebook
33+
*/
34+
const uri = doc.uri.toString();
35+
36+
/**
37+
* Event params for LSP user interaction
38+
*/
39+
const codeActionParams: CodeActionParams = {
40+
textDocument: {
41+
uri,
42+
},
43+
range: diags[0].range,
44+
context: {
45+
diagnostics: [diags[0]],
46+
},
47+
};
48+
49+
const actions = await init.client.client.sendRequest(
50+
'textDocument/codeAction',
51+
codeActionParams
52+
);
53+
54+
// verify hover has return
55+
expect(actions).toEqual([
56+
{
57+
title: 'Disable "undefined-var" for line',
58+
command: {
59+
command: 'idl.code.fixProblem',
60+
arguments: [
61+
[
62+
{
63+
line: 0,
64+
text: '; idl-disable-next-line undefined-var\nbillboards.thing',
65+
cell: 0,
66+
},
67+
],
68+
],
69+
title: 'idl.code.fixProblem',
70+
},
71+
kind: 'refactor.inline',
72+
},
73+
{
74+
title: 'Disable "undefined-var" for file or cell',
75+
command: {
76+
command: 'idl.code.fixProblem',
77+
arguments: [
78+
[
79+
{
80+
line: 0,
81+
text: ';+\n; idl-disable undefined-var\n;-\n\nbillboards.thing',
82+
cell: 0,
83+
},
84+
],
85+
],
86+
title: 'idl.code.fixProblem',
87+
},
88+
kind: 'refactor.inline',
89+
},
90+
{
91+
title: 'Disable "undefined-var" in user settings',
92+
command: {
93+
command: 'idl.code.disableProblemSetting',
94+
arguments: [
95+
{
96+
code: 99,
97+
scope: 'user',
98+
},
99+
],
100+
title: 'idl.code.disableProblemSetting',
101+
},
102+
kind: '',
103+
},
104+
{
105+
title: 'Disable "undefined-var" for workspace',
106+
command: {
107+
command: 'idl.code.disableProblemSetting',
108+
arguments: [
109+
{
110+
code: 99,
111+
scope: 'workspace',
112+
},
113+
],
114+
title: 'idl.code.disableProblemSetting',
115+
},
116+
kind: '',
117+
},
118+
{
119+
title: 'Learn more about "undefined-var"',
120+
command: {
121+
command: 'idl.docs.open',
122+
arguments: ['/problem-codes/codes/99.html'],
123+
title: 'idl.docs.open',
124+
},
125+
kind: '',
126+
},
127+
{
128+
title: 'Learn how to configure reported problems',
129+
command: {
130+
command: 'idl.docs.open',
131+
arguments: ['/problem-codes/configuration.html'],
132+
title: 'idl.docs.open',
133+
},
134+
kind: '',
135+
},
136+
]);
137+
};

0 commit comments

Comments
 (0)