morbac / xmltools

XML Tools plugin for Notepad++
GNU General Public License v3.0
260 stars 57 forks source link

When trying to save a new XSLT (Save As...) in Notepad++, the App goes to "not responding" #154

Closed lucky1luc closed 2 years ago

lucky1luc commented 2 years ago

Notepad++ v8.3.3 (64-bit) Build time : Mar 13 2022 - 17:20:02 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 11 (64-bit) OS Version : 2009 OS Build : 22000.556 Current ANSI codepage : 1252 Plugins : ComparePlugin.dll mimeTools.dll NppConverter.dll NppExport.dll NppHorizontalRuler.dll SQLinFormNpp64.dll XMLTools.dll

image

The XSLT is +/-49000 lines big. I reproduce this by

Remarks:

vinsworldcom commented 2 years ago

@lucky1luc have a try on this pre-release. You'll need to manually install over your current XMLTools.dll but let us know if it solves the problem. This is 3.1.1.13 prerelease that is addressing few other new issues that cropped up lately - perhaps due to the Notepad++ / Scintilla API changes.

Cheers.

morbac commented 2 years ago

@lucky1luc, @vinsworldcom, a new pre-release was built to fix issue #152 I suspect that both issues have same cause : an internal conversion UTF-8 to UCS2 (required by MSSQL) was not optimized and very slow on big files. This conversion is perfomed on XML syntax check. Therefore if you have the "Enable XML syntax auto-check" option enabled, the XML syntax check is performed automatically on every Save.

lucky1luc commented 2 years ago

Thank you, I will first attempt to switch off the "Enable XML syntax auto-check" before trying to install software which is not on GitHub. With all due respect, I do not want to download a file from an unknown source. That is an unacceptable risk for me. Then I rather wait until the official version comes out, and it can be installed from the official site.

mimccu commented 2 years ago

I disabled the "Enable XML syntax auto-check" and I was able to save a 2 MB XML file quickly. However, when using "Evaluate XPath Expression" it still failed (hour glassed). I'm assuming it did a XML syntax check at that point. Any word on when a regular release is coming and not a pre-release?

mimccu commented 2 years ago

@vinsworldcom - what is the most recent prior version of Notepad++ that uses an older version of the Scintilla API that is compatible with the XML Tools plugin? I can go back to a prior version of Notepad++ to make this work.

vinsworldcom commented 2 years ago

@mimccu I think 8.2.1

morbac commented 2 years ago

Any word on when a regular release is coming and not a pre-release?

I plan to build a new release during incoming weekend.

mimccu commented 2 years ago

My colleague is on Notepad++ 8.2.1 and she does not have issues. However, I went back to version 8.2.1 and still have issues, so I'm not entirely sure it's due to the Scintilla API changes in more recent versions of Notepad++.

My plugin version is: image

Gitoffthelawn commented 2 years ago

What's the easiest way to check which version of Scintilla your current version of Notepad++ is using?

Surprisingly, it doesn't seem to be specified in the Notepad++ About or Debug Info windows.

rdipardo commented 2 years ago

@Gitoffthelawn,

What's the easiest way to check which version of Scintilla your current version of Notepad++ is using?

The only place to find that is the version.txt file in the git repository.

But the above discussion has nothing to do with the version of Scintilla. All Notepad++ versions from 7.9.4 to now have used Scintilla 4.4.6.

What did change after version 8.2.1 is the size of an important data structure that plugins like XMLTools depend on. Notepad++ made this change independently of Scintilla, in order to support files sizes of >2 GB.

Funny thing is, Scintilla has provided this ability for a long time. The announcement of Scintilla 4.1.6 reads in part:

The major feature of this release is support for files larger than 2 gigabytes in SciTE

("SciTE" being the original Scintilla-based text editor.)

So, Notepad++ committed itself to an API that is not only incompatible with all plugins that worked in 8.2.1 — it's not even compatible with the current Scintilla!

mimccu commented 2 years ago

Thanks @rdipardo. Maybe we should petition Notepad++ to reverse course and use the large file size capabilities that are inherent to Scintilla instead of going outside Scintilla to support large file sizes? (I'm hoping I interpreted what you said correctly).

morbac commented 2 years ago

New release 3.1.1.13 should fix the issue

mimccu commented 2 years ago

Thanks very much @morbac -- I used release 3.1.1.13 with Notepad++ 8.3.3 64 bit version for Windows and both saving a XML file and evaluating XPath expressions are working now. Note that using the Plugin Admins tool under Notepad++ does not see XML Tools version 3.1.1.13 yet -- it only sees the prior version available for download.

mimccu commented 2 years ago

On a separate note, can you tell me if this is a known issue under XML Tools? I have a FHIR Bundle that declares a default namespace at the top level. If I use evaluate XPath expression with the default namespace, it does not find any entries that match. However, if I remove the default namespace, evaluate XPath expression works. I tried to declare a default namespace under evaluate XPath expression but that didn't produce any better results. Here's an example:

Thanks, Mike

537mfb commented 2 years ago

Can confirm version 3.1.1.13 fixes the not responding issue

morbac commented 2 years ago

Note that using the Plugin Admins tool under Notepad++ does not see XML Tools version 3.1.1.13 yet -- it only sees the prior version available for download.

A pull request has been sent and merged in NPP plugin a few days ago. Therefore plugin admin will show version 3.1.1.13 when next NPP version will be released.