NotepadPlusPlusPluginPack.Net icon indicating copy to clipboard operation
NotepadPlusPlusPluginPack.Net copied to clipboard

Q: Extending it to be usable as a lexer template

Open Ekopalypse opened this issue 4 years ago • 4 comments
trafficstars

I am currently trying to add a lexer class to the plugin pack so that it can be used to write lexers in C#. The additional exports needed have been added in UnmanagedExports.cs. The problem I face is that the methods in the ILexer class are garbage collected. But from what I have read, static classes or static members of a class should not be garbage collected. Any idea? Sorry, I am very new to C#. Btw. My current declaration of the class is different from what is available on github and looks like this.

internal static class ILexer

Ekopalypse avatar May 20 '21 14:05 Ekopalypse

What is it ILexer?

omid99visual avatar May 21 '21 09:05 omid99visual

A wrapper to the C++ Interface provided by scintilla.

Ekopalypse avatar May 21 '21 09:05 Ekopalypse

@Ekopalypse is it newly added to scintilla interface definitions, if so the ILexer class doesn't need to be added manually, instead there is a generator script which updates the C# file, that needs to be run.

We can re-run the generator to update C# scintilla interface. Please let us know.

mahee96 avatar May 23 '21 13:05 mahee96

@mahee96 No, it is not new, I assume the ILexer interface is about as old as scintilla itself. I assume you are talking about the scintilla.iface file, which is used to describe the scintilla interface. If that is the case, then no, ILexer is not defined there, it is defined in ILexer.h. The only reference in scintilla.iface is the call SetILexer which would be used to set an external lexer. As far as I can see, the ILexer interface is not wrapped by the PluginPack.

Ekopalypse avatar May 23 '21 19:05 Ekopalypse