Predelnik / DSpellCheck

Notepad++ Spell-checking Plug-in
GNU General Public License v2.0
198 stars 32 forks source link

API support to set the language #309

Closed ffes closed 4 months ago

ffes commented 1 year ago

There are several plugin that would like to set the spell language, for instance see this discussion in https://github.com/editorconfig/editorconfig/issues/315, but I would like it to add it to https://github.com/ffes/nppfilesettings as well.

I was wondering if it would be possible add some sort of API in DSpellCheck for other plugins to change the current language used for spell checks. I know it is not possible at the moment, but having this feature to set the spell language for the docs of a project would be very useful.

I know there is NPPM_MSGTOPLUGIN, but I never used it. What I understand from the docs is that the sending plugin needs to set CommunicationInfo struct properly and send the message to the other plugin. The receiving plugin needs to handle that message in beNotified() (I think).

If this would be possible to add such an API, a second endpoint to enable or disable the spell check would be useful to have.

Predelnik commented 1 year ago

It should not be hard, could be implemented

ffes commented 4 months ago

Great news, thanks.

Is there an easy way to test this before it gets released?

Predelnik commented 3 months ago

Great news, thanks.

Is there an easy way to test this before it gets released?

Unfortunately haven't implemented artifact upload by github actions yet, will do this soon, then it would be easy.

Predelnik commented 3 months ago

Now can be tried with this version: https://github.com/Predelnik/DSpellCheck/actions/runs/8587165792/artifacts/1391687586 Using this api: https://github.com/Predelnik/DSpellCheck/blob/master/include/PluginMsg.h

ffes commented 3 months ago

Thanks for the download. I've tried it and it works as expected. Great!

There is just one thing I run into. I've opened #339 for this.