Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

up JsonTools to v6.1.1 #719

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

molsonkiko
Copy link
Contributor

@molsonkiko molsonkiko commented Dec 29, 2023

Executive summary of major changes:

  • Parser for INI files
  • treeview can be used to view/edit CSV files, regex search results
  • for loops, variable assignment, f-strings, and functions as arguments to functions in RemesPath

[6.1.1] - 2023-12-28

Fixed

  1. Eliminated potentially unrecoverable plugin crash when JSON parser tries to parse document with - or + not followed by numeric chars (e.g. -a, +). Now such badly formatted numbers are parsed as NaN.

[6.1.0] - 2023-12-28

Added

  1. Python-style f-strings in RemesPath.
  2. s_cat RemesPath non-vectorized function.
  3. s_lines, s_lpad, s_rpad, and zfill RemesPath vectorized functions.
  4. Select all children treenode action now works for root treenode in JSON Lines and selection-based documents.

Changed

  1. RemesPath syntax errors (anything caught by the lexer) now use >>>HERE>>> before the character where the error occurred, similar to how the Notepad++ find/replace form indicates the location of a regular expression syntax error.
  2. Not part of public-facing API: Renamed the JQueryContext.Evaluate method to JQueryContext.Operate, and renamed JMutator.Mutate to JMutator.Operate.
  3. Make it so automatic validation does not require the document to be re-parsed as JSON, and is suppressed when in regex or ini mode.

Fixed

  1. Eliminated plugin crash when attempting to open the regex search form after it had been closed.
  2. Greatly improved error form reloading performance.
  3. Some UI test failures (and probably related weirdness in public API) on older NPP versions
  4. Fix bug where s_csv RemesPath function did not properly handle delimiters that were regex metacharacters like |

[6.0.0] - 2023-12-13

Added

  1. Option to customize which toolbar icons are displayed, and their order.
  2. New regex search form for using treeview to see regex search results in any file.
  3. New document type list box in tree view
  4. For loops in RemesPath
  5. bool, num, s_csv and s_fa RemesPath vectorized arg functions
  6. randint, csv_regex, set, and to_csv RemesPath non-vectorized arg functions
  7. Make second argument of s_split RemesPath function optional; 1-argument variant splits on whitespace.
  8. Right-click dropdown menu in error form, allowing export of errors to JSON or refreshing the form.
  9. The JSON parser is now much better at recovering when an object is missing its closing '}' or an array is missing its closing ']'.
  10. Support for JSON Schema validation of enum keyword where the type is missing or an array.
  11. Ctrl+Up now snaps to parent of currently selected node in tree view. Ctrl+Down now snaps to the last direct child of the currently selected node.

Changed

  1. The internal representation of object keys has changed to allow unescaped strings as keys (THIS DOES NOT AFFECT THE PUBLIC API EXCEPT IN SOME CORNER CASES IN REMESPATH).
    • What I mean by this is that previously the key in the JSON object {"\"": 3} was previously internally represented as "\\\"", with the quote character escaped as shown.
    • This had the advantage of making it slightly faster to display object keys (e.g., when pretty-printing/compressing/dumping), but made it impossible for certain strings to be valid object keys, in a way that could not be detected except when pretty-printing or compressing.
    • Under the new system as of this version, all strings are acceptable as object keys. This has positive implications for RemesPath, as it means that users do not need to remember to escape string JNodes before using them as keys in an object.
  2. When using the JSON-to-CSV form to create CSV files, newline characters will no longer be escaped in strings. This is one of several changes made in order to acheive compliance with RFC 4180.
  3. Made offer_to_show_lint setting (which controls whether a prompt is shown when errors are found) true by default, so that a fresh installation will show the prompt.
  4. Change RemesPath indexers to reduce the number of backslash escapes needed to get keys containing special characters like "a\\b" or "\"foo\"\tbar". For instance, previously @.`\\n\\\\a\"` would be required to match the key "\n\\a\"", whereas now @.`\n\\a"` matches it.
  5. Running a RemesPath query only causes an attempted re-parsing of the document if the treeview's current file is open.
  6. Running a replace query on the find/replace form now causes the tree to display only the values that were mutated.
  7. Changed the tabstop order of some forms, made it so that the find/replace form has complete tabstop coverage, and eliminated some tabstop-related issues associated with combo boxes in some forms.
  8. Benchmarks for compiling RemesPath queries now more accurately represent the effect of caching on performance.

Fixed

  1. Fixed plugin crash when attempting to parse too-large hex numbers like 0x100000000000000000000. Now the parser will fatally fail and add a lint indicating the issue, but the plugin will not actually crash.
  2. Fixed some weird issues where mutating a variable in RemesPath could cause re-executing a query on the same input to return a different value. A minimal example: var x = 1; x = @ + 1; x would return 1 + (the number of times the query was executed) prior to this fix, but now it will always return 2 as expected. This was also true of a bunch of other things in RemesPath, including projections and the map operator.
  3. Fix issues where running a RemesPath query with a projection that referenced a variable indexing on a compile-time constant would cause an error. For example, var x = @; 1->x should return @ (the input to the query), but prior to this fix, it would instead cause an error.
  4. Running tests would previously cause clipboard data to be lost irreversably. Now, if the user's clipboard contained text before running tests, the contents of the clipboard are restored to their pre-test values rather than being hijacked. Non-text data that was copied to the clipboard is still lost when running tests, and I may try to fix that in the future.
  5. dict function in RemesPath previously had a bug that could create invalid JSON if the strings to be turned into keys contained special characters (e.g., literal quote chars, \r, \n).
  6. access violations when loading error form
  7. unnecessary prompt when manually reloading error form
  8. issue with trying to view error form when the error form was already open
  9. RemesPath backtick strings now can have a literal \ character just before the closing backtick. Previously this was impossible because of a regex-writing bug.
  10. Eliminated plugin crash when attempting to validate with an invalid JSON schema. Now a message box will show in that situation.

[5.8.0] - 2023-10-09

Added

  1. Add parser for .ini files, allowing them to reformatted, viewed with the tree view, and queried and edited with RemesPath.
  2. Python-style spreading of an array with * to fill multiple arguments of a function.
  3. New RemesPath function(s): at function for indexing into array or object at an index or key determined at runtime (since indexing with square braces does not support keys/indices that are functions of input).
  4. Made it possible to customize newline for CSV files generated by the JSON-to-CSV form.

Changed

  1. If the user chooses to parse a document as JSON Lines or INI using one of the commands from the main plugin menu, their choice is remembered when the document is re-parsed (including when the tree is re-opened and when the document is pretty-printed and compressed).
    • For example, previously if you used the Parse JSON Lines document to parse a document as JSON Lines, and then closed and re-opened the tree view, the tree would be re-opened as JSON. Now the tree view will be re-opened as JSON Lines.
    • This remembered choice can be overridden by parsing as INI or JSON Lines again, selecting valid JSON, or (sometimes) selecting the entire document (if it is valid JSON).
  2. All instances of \r (carriage return) in strings are now escaped to \\r when generating CSVs with the JSON to CSV form.
  3. Prompt user (can disable the prompt if desired) before pretty-printing JSON Lines documents.

Fixed

  1. Bug where reformatting some large floating-point numbers would output text that could not subsequently be parsed.
  2. Fixed bug where changing the try_parse_start_chars setting would cause UI tests to fail.
  3. JSON Lines documents can now be edited with RemesPath while keeping them in JSON Lines format.
  4. Issue where multiple tabs would be used for indentation when both the tab_indent_pretty_print and remember_comments settings were true (only on files with comments).
  5. Plugin crashes with single-line comments (both Python-style and JavaScript-style) that had no trailing newline.
  6. Bug where one-character comments that went to EOF would be truncated to an empty string.
  7. UI test failures when sort_keys setting was false.

[5.7.0] - 2023-09-08

Added

  1. Toolbar icons for JSON pretty-print, JSON compress, treeview, and path to current position. Fix issue 36.
  2. Ability to select JSON or a JSON's children from the treeview.
  3. Variable assignment in RemesPath.
  4. Negated indexers in RemesPath.
  5. Ability to group by multiple variables with the group_by RemesPath function.
  6. Option to skip the API request test when running tests.

Changed

  1. Selections that don't begin with a valid JSON document will now be ignored when parsing a document. See working with selections docs for more info and examples.

Fixed

  1. Sort form previously did not follow Notepad++ styling on startup.
  2. Problems (introduced in v5.5) with running tests multiple times without cleaning up test files.

@chcg chcg added this to the 1.6.9 milestone Dec 29, 2023
@chcg chcg merged commit eb6a2ee into notepad-plus-plus:master Dec 29, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Put buttons on toolbar
2 participants