Skip to content

v8.2: fix decimal formatting, rename tree views, many bugfixes

Compare
Choose a tag to compare
@molsonkiko molsonkiko released this 10 Nov 03:37
· 12 commits to main since this release

[8.2.0] - 2024-11-09

Added

  1. When a file is renamed, the name of a tree view associated with that file also changes to match the new name. This also happens when a treeview is refreshed with JSON from a different file.
  2. Add rand_schema RemesPath function to generate random JSON from schema.

Changed

  1. If a number string is too large or small for a 64-bit floating point number (for example, -2e700, 3.5e+450), the JSON parser will now represent them as -Infinity (if they have a leading - sign) or Infinity, rather than representing them as NaN. The linter also has a new message for when this happens.
  2. If a JSON lines document is not compliant with the strict JSON specification, the status bar will now reflect that it is JSON lines.
  3. Stop considering the user's Windows culture when determining the UI language for JsonTools (fix issue 82). Now JsonTools will be translated into language X if and only if Notepad++ is in language X.

Fixed

  1. Fix issue (introduced in v8.1, see issues 83 and 81) where decimal numbers were given unnecessarily precise string representations. For example, in JsonTools v8.1, 11.11 would be represented as 11.109999999999999 even though the original 11.11 was an equally valid representation. Now all decimal numbers will be given the more compact representation used in v8.0 and earlier unless the more verbose representation introduced in v8.1 would be necessary to avoid loss of precision (so there will be no regression on issue 78). Note that this new algorithm for formatting decimal numbers is about twice as slow as the algorithm used in v8.1 (for 64-bit JsonTools; 32-bit has no performance loss), although the impact on performance will be much less dramatic unless you are compressing an array where almost every element is a non-integer decimal number.
  2. Fix the following issues with random string from regex:
    • It previously incorrectly flagged some valid regular expressions (e.g. (?-i)(?:xy{1,2}){,2}) as having two consecutive quantifiers.
    • It previously did not correctly handle some character sets where the final character was - (for example, [+-] previously would only generate +, and now it correctly has a 50% chance of generating - or +)
  3. Fix issue where RemesPath incorrectly inferred the type of (a function fun followed by indexers) to be the return type of fun. For example, running the query sum(dict(items(@)).a) on the JSON {"a": [1]} now correctly returns 1.0, but RemesPath used to raise an error because it assumed that dict(items(@)).a had the same type as dict(items(@))
  4. Fix very rare crash bug when using the Value to clipboard option of the tree node right-click context menu.
  5. Fix bug where some invalid JSON Lines documents (for example, [1, \n2][3]) would be accepted by the JSON Lines parser despite having elements that span multiple lines.
  6. Fix minor bugs with how headers are formatted in the s_csv RemesPath function and JSON-to-CSV form.
  7. Fix bug where renaming a file subject to schema validation based on filename patterns would cause its tree view to be lost.
  8. Fix bug where plugin actions (mainly RemesPath queries in regex mode) that set the text of the entire document to an empty string would not do anything. Those actions will now correctly remove all the text in the document.
  9. Fix issue 79 where, on higher display resolutions than the default 125% normally used by molsonkiko in development, some of the advanced controls in the find/replace form would not be visible.
  10. Fix annoying but harmless bug where, if the user had two views open and ran a plugin command on one or more selections in the second view, the indicator that JsonTools uses to remember selections (which is supposed to be hidden at all times) would cause the selections to be underlined.
  11. Address issue 80; now error form will be cleared of errors when the JSON parser does not log any syntax errors.
  12. Make it so that JSON Lines documents are correctly formatted as JSON Lines after sorting by the sort form.
  13. Make it so that refreshing a tree view originally associated with oldFile with JSON from newFile will correctly cause the tree view to be associated with newFile. Previously, the tree view stayed associated with oldFile, so attempting to open a new tree view for oldFile would instead close the tree view now associated with newFile, because the command to open a tree view for a file closes that file's tree view if it already has an open one.