Skip to content

Commit 7f1f12d

Browse files
Merge branch 'develop'
2 parents 602d3a5 + dde7abb commit 7f1f12d

File tree

8 files changed

+633
-404
lines changed

8 files changed

+633
-404
lines changed

CHANGELOG.md

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

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

31-
## Unreleased
31+
## 4.4.0 - April 2024
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

@@ -66,6 +66,8 @@ Re-work the logic for running files to be much more flexible. Here's how it beha
6666

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

69+
Fixed an issue where, when a parameter had the name "file", "http", "https", "s3", or "ftp", it would incorrectly be skipped with docs parsing.
70+
6971
## 4.3.1 February 2024
7072

7173
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/test-tokenizer/src/test-maker/cache/cache.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

apps/test-tokenizer/src/test-maker/tests/auto-local-global-scope-compile-and-types-tests.interface.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,22 @@ export const AUTO_LOCAL_GLOBAL_SCOPE_COMPILE_AND_TYPES_TESTS: IAutoLocalGlobalSc
177177
``,
178178
],
179179
},
180+
{
181+
name: 'allow parameters named "file"',
182+
code: [
183+
`;+`,
184+
`; :Arguments:`,
185+
`; file: in, required, String`,
186+
`; Placeholder docs for argument, keyword, or property`,
187+
`;`,
188+
`;-`,
189+
`pro argbug, file`,
190+
` compile_opt idl2`,
191+
``,
192+
` print, file`,
193+
`end`,
194+
],
195+
},
180196
],
181197
},
182198
{

libs/parsing/syntax-tree/src/lib/docs/docs.regex.interface.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export const HEADER_TAG = /^\s*(?<!:):(?!:)([^:]+)(?<!:):(?!:)/i;
66
/**
77
* Regex to detect arguments or keywords
88
*/
9-
export const ARG_KW_PROPERTY_TAG =
10-
/^\s*([^:\s]*)\s*(?<!:|https?|ftp|s3|file):(?!:)/i;
9+
export const ARG_KW_PROPERTY_TAG = /^\s*([^:\s]*)\s*:(?!:|\/\/)/i;
1110
// export const ARG_KW_PROPERTY_TAG = /^\s*([^:\s]*)\s*(?<!:):(?!:)/i;
1211

1312
/**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/**
22
* Version of the extension
33
*/
4-
export const VERSION = '4.3.1';
4+
export const VERSION = '4.4.0';

libs/tests/local-global-scope-compile/src/lib/complex-docs-example1.spec.ts

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,4 +485,113 @@ describe(`[auto generated] Complex real world test`, () => {
485485
// verify results
486486
expect(tokenized.compile).toEqual(expectedCompile);
487487
});
488+
489+
it(`[auto generated] allow parameters named "file"`, async () => {
490+
// create index
491+
const index = new IDLIndex(
492+
new LogManager({
493+
alert: () => {
494+
// do nothing
495+
},
496+
}),
497+
0
498+
);
499+
500+
// test code to extract tokens from
501+
const code = [
502+
`;+`,
503+
`; :Arguments:`,
504+
`; file: in, required, String`,
505+
`; Placeholder docs for argument, keyword, or property`,
506+
`;`,
507+
`;-`,
508+
`pro argbug, file`,
509+
` compile_opt idl2`,
510+
``,
511+
` print, file`,
512+
`end`,
513+
];
514+
515+
// extract tokens
516+
const tokenized = await index.getParsedProCode(
517+
'not-real',
518+
code,
519+
new CancellationToken(),
520+
{ postProcess: true }
521+
);
522+
523+
// define expected local variables
524+
const expectedVars: ILocalTokens = {
525+
func: {},
526+
pro: {
527+
argbug: {
528+
file: {
529+
type: 'v',
530+
name: 'file',
531+
pos: [6, 12, 4],
532+
meta: {
533+
display: 'file',
534+
isDefined: true,
535+
usage: [
536+
[6, 12, 4],
537+
[9, 9, 4],
538+
],
539+
docs: 'Placeholder docs for argument, keyword, or property',
540+
source: 'user',
541+
type: [{ name: 'String', display: 'String', args: [], meta: {} }],
542+
},
543+
},
544+
},
545+
},
546+
main: {},
547+
};
548+
549+
// verify results
550+
expect(tokenized.local).toEqual(expectedVars);
551+
552+
// define expected global variables
553+
const expectedGlobal: GlobalTokens = [
554+
{
555+
type: 'p',
556+
name: 'argbug',
557+
pos: [6, 4, 6],
558+
meta: {
559+
source: 'user',
560+
args: {
561+
file: {
562+
docs: 'Placeholder docs for argument, keyword, or property',
563+
direction: 'in',
564+
source: 'internal',
565+
type: [{ name: 'String', display: 'String', args: [], meta: {} }],
566+
private: false,
567+
req: true,
568+
display: 'file',
569+
code: true,
570+
pos: [6, 12, 4],
571+
},
572+
},
573+
docs: '\n```idl\nargbug, file\n```\n\n\n\n\n#### Arguments\n\n- **file**: in, required, String\n\n Placeholder docs for argument, keyword, or property\n\n',
574+
docsLookup: { default: '' },
575+
display: 'argbug',
576+
kws: {},
577+
private: false,
578+
struct: [],
579+
},
580+
file: 'not-real',
581+
},
582+
];
583+
584+
// verify results
585+
expect(tokenized.global).toEqual(expectedGlobal);
586+
587+
// define expected compile options
588+
const expectedCompile: ICompileOptions = {
589+
func: {},
590+
pro: { argbug: ['idl2'] },
591+
main: [],
592+
};
593+
594+
// verify results
595+
expect(tokenized.compile).toEqual(expectedCompile);
596+
});
488597
});

0 commit comments

Comments
 (0)