Skip to content

Commit 9d3d9c3

Browse files
committed
Release v8.4.0.4
- update GitHub references to point to this branch - Add indicators showing that this is the big integer version, not the main version, since they will be maintained in parallel - fix bug where integers bigger than double.MaxValue would be treated as bigger than double.Infinity
1 parent 521adb9 commit 9d3d9c3

14 files changed

Lines changed: 118 additions & 91 deletions

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Change Log
2-
All [notable changes](#840---2025-05-04) to this project will be documented in this file.
2+
All [notable changes](#8404---2025-07-24) to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
@@ -36,6 +36,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3636

3737
### To Be Fixed
3838

39+
- Crash bugs described in issues [46](https://github.com/molsonkiko/JsonToolsNppPlugin/issues/46) and [59](https://github.com/molsonkiko/JsonToolsNppPlugin/issues/59).
40+
- I don't think these issues are caused by the plugins config directory having a path length greater than `Win32.MAX_PATH`, because the error messages that people are seeing look different from the error message that I get when I deliberately create that issue.
41+
- I also doubt that the issue is due to a race condition where the delayed-parse-after-editing thread tries to access `jsonFileInfos` when it's being deleted, because such an error would not appear at startup, and it would only appear sometimes on shutdown, not all the time.
3942
- Make sure there aren't any easily-triggered race conditions induced by [automatic parsing and validation after editing](/docs/README.md#automatically-check-for-errors-after-editing).
4043
- In 6.1.1.18, there is no longer a global shared JsonParser, which was the main potential source of race conditions.
4144
- Fix issue where pretty-printing or compressing causes tree view position tracking to be out of sync with the document until a query is issued or the `Refresh` button is hit.
@@ -48,7 +51,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4851
- Since v7.0, holding down `Enter` in a multiline textbox (like the [tree viewer query box](/docs/README.md#remespath)) only adds one newline when the key is lifted.
4952
- Maybe use pre-7.1 (dictionary-based rather than indicator-based) [selection remembering](/docs/README.md#working-with-selections) for Notepad++ 8.5.5 and earlier? Indicators are risky with those older NPP's because of the lack of `NPPM_ALLOCATEINDICATOR`.
5053

51-
## [9.0.0] - (UNRELEASED) YYYY-MM-DD
54+
## [8.4.0.4] - 2025-07-24
5255

5356
### Changed
5457

@@ -60,7 +63,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6063

6164
1. Add [`recurse_until` RemesPath function](/docs/RemesPath.md#non-vectorized-functions) to recursively search arrays and objects for anything inside that satisfies a condition.
6265
2. Add [`keyboard_shortcuts` setting](/docs/README.md#the-basics), allowing users to turn off default JsonTools keyboard shortcuts.
63-
3. Courtesy of user [hydy100](https://github.com/hydy100), [Translation](https://github.com/molsonkiko/JsonToolsNppPlugin/blob/main/translation) to Arabic, Chinese (simplified), French, German, Japanese, Korean, and Taiwanese Mandarin.
66+
3. Courtesy of user [hydy100](https://github.com/hydy100), [Translation](https://github.com/molsonkiko/JsonToolsNppPlugin/blob/big_integer_for_Dtype_INT/translation) to Arabic, Chinese (simplified), French, German, Japanese, Korean, and Taiwanese Mandarin.
6467

6568
### Fixed
6669

JsonToolsNppPlugin/Forms/AboutForm.Designer.cs

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

JsonToolsNppPlugin/Forms/AboutForm.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120+
<data name="Description.Text" xml:space="preserve">
121+
<value>Query/editing tool for JSON including linting, reformatting,
122+
a tree viewer with file navigation,
123+
a JMESpath-like query language, and much more.
124+
This version of JsonTools supports arbitrarily large integers.</value>
125+
</data>
120126
<data name="ThanksWowLinkLabel.Text" xml:space="preserve">
121127
<value>Special thanks to:
122128
* Don Ho for making Notepad++

JsonToolsNppPlugin/Forms/JsonToCsvForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Stringify iterables
9898

9999
private void DocsButton_Click(object sender, EventArgs e)
100100
{
101-
Main.OpenUrlInWebBrowser("https://github.com/molsonkiko/JSONToolsNppPlugin/tree/main/docs/json-to-csv.md");
101+
Main.OpenUrlInWebBrowser("https://github.com/molsonkiko/JSONToolsNppPlugin/tree/big_integer_for_Dtype_INT/docs/json-to-csv.md");
102102
}
103103
}
104104
}

JsonToolsNppPlugin/JSONTools/JNode.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,8 @@ public int CompareTo(object other)
812812
return bi.CompareTo(obi);
813813
if (other is double od)
814814
{
815+
if (double.IsInfinity(od))
816+
return od < 0 ? 1 : -1;
815817
if (bi > DoubleMaxValueAsBigInt)
816818
return 1;
817819
if (bi < DoubleMinValueAsBigInt)
@@ -822,9 +824,13 @@ public int CompareTo(object other)
822824
return bi.CompareTo(b ? BigInteger.One : BigInteger.Zero);
823825
throw new ArgumentException("Can't compare numbers to non-numbers");
824826
case Dtype.FLOAT:
825-
if (!(other is BigInteger || other is double || other is bool))
827+
bool otherIsDouble = other is double;
828+
if (!(otherIsDouble || other is BigInteger || other is bool))
826829
throw new ArgumentException("Can't compare numbers to non-numbers");
827-
return ((double)value).CompareTo(ConvertJNodeValueToDouble(other));
830+
var d = (double)value;
831+
if (!otherIsDouble && double.IsInfinity(d))
832+
return d < 0 ? -1 : 1; // need to address possibility that other is integer outside the range of doubles
833+
return d.CompareTo(ConvertJNodeValueToDouble(other));
828834
case Dtype.BOOL:
829835
if (!(other is BigInteger || other is double || other is bool))
830836
throw new ArgumentException("Can't compare numbers to non-numbers");

JsonToolsNppPlugin/Main.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Main
2424
#region " Fields "
2525
internal const int UNDO_BUFFER_SIZE = 64;
2626
internal const string PluginName = "JsonTools";
27-
public const string PluginRepoUrl = "https://github.com/molsonkiko/JsonToolsNppPlugin";
27+
public const string PluginRepoUrl = "https://github.com/molsonkiko/JsonToolsNppPlugin/tree/big_integer_for_Dtype_INT";
2828
// general stuff things
2929
public static Settings settings = new Settings();
3030
public static IniFileParser iniParser = new IniFileParser();
@@ -450,8 +450,13 @@ static internal void FileRenameCancel(IntPtr bufferRenamedId)
450450
shouldRenameGrepperForm = false;
451451
}
452452

453+
/// <summary>
454+
/// called once when Notepad++ is shutting down normally (in response to <see cref="NppMsg.NPPN_SHUTDOWN"/>
455+
/// </summary>
453456
static internal void PluginCleanUp()
454457
{
458+
// turn off auto-validation because we're about to remove jsonFileInfos
459+
settings.auto_validate = false;
455460
if (grepperForm != null && !grepperForm.IsDisposed)
456461
{
457462
grepperForm.Close();

JsonToolsNppPlugin/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
// Build Number
2929
// Revision
3030
//
31-
[assembly: AssemblyVersion("8.4.0.3")]
32-
[assembly: AssemblyFileVersion("8.4.0.3")]
31+
[assembly: AssemblyVersion("8.4.0.4")]
32+
[assembly: AssemblyFileVersion("8.4.0.4")]

JsonToolsNppPlugin/Release_x64.zip

2.23 KB
Binary file not shown.

JsonToolsNppPlugin/Release_x86.zip

2.29 KB
Binary file not shown.

JsonToolsNppPlugin/Tests/RemesPathTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public static bool Test()
3434
JsonParser jsonParser = new JsonParser();
3535
RemesParser remesparser = new RemesParser();
3636
Npp.AddLine($"The queried JSON in the RemesParser tests is named foo:{fooStr}");
37+
string hugeIntegerStr = ArgFunction.StrMulHelper("10", 160);
3738
var testcases = new Query_DesiredResult[]
3839
{
3940
// subtraction
@@ -164,6 +165,10 @@ public static bool Test()
164165
new Query_DesiredResult("17 == 16.6", "false"),
165166
new Query_DesiredResult("16.6 < 17", "true"),
166167
new Query_DesiredResult("16.6 == 17", "false"),
168+
new Query_DesiredResult($"{hugeIntegerStr} < Infinity", "true"), // integer bigger than largest double is less than Infinity
169+
new Query_DesiredResult($"Infinity > {hugeIntegerStr}", "true"), // integer bigger than largest double is less than Infinity
170+
new Query_DesiredResult($"-{hugeIntegerStr} > -Infinity", "true"), // integer lower than largest negative double is greater than -Infinity
171+
new Query_DesiredResult($"-Infinity < -{hugeIntegerStr}", "true"), // integer lower than largest negative double is greater than -Infinity
167172
// uminus tests
168173
new Query_DesiredResult("-j`[1]`", "[-1]"),
169174
new Query_DesiredResult("-j`[1,2]`**-3", "[-1.0, -0.125]"), // check uminus comes after exponentiation

0 commit comments

Comments
 (0)