Comments "//" on Scintilla

82 megtekintés
Ugrás az első olvasatlan üzenetre

Slv Prometheen

olvasatlan,
2016. nov. 17. 10:05:242016. 11. 17.
– scintilla-interest
Hi,

I'm looking for solving the problem related there. https://github.com/fdorg/flashdevelop/issues/1250

I've downloaded sources from Scintilla to check architecture and stuff like that. I just can't find the part of the code which adds comments "//" in the editor. Could someone indicate me where to find, approximately of course, what treats this action ?

Thanks a lot

Colomban Wendling

olvasatlan,
2016. nov. 17. 10:11:562016. 11. 17.
– scintilla...@googlegroups.com
Hi,
The file is lexers/LexCPP.cxx. However, beware: that file handles C,
C++ and Java too, so you can't simply remove this feature from the lexer
(the behavior is correct for C and C++).
So you'll likely need to add a lexer property for that.

Regards,
Colomban

Slv Prometheen

olvasatlan,
2016. nov. 17. 10:32:542016. 11. 17.
– scintilla-interest
Thanks a lot Colomban, I'll try this way to do, by adding lexer property :)
Az üzenetet töröltük.

Colomban Wendling

olvasatlan,
2016. nov. 18. 10:55:372016. 11. 18.
– scintilla...@googlegroups.com
Le 18/11/2016 à 08:55, Slv Prometheen a écrit :
> @Colomban Wendling,
> Sorry for disturbing you one again. I discovered the source code
> yesterday and it's hard to find any documentation to describe its logic.
> Would you know where properties are set ?

Properties are defined in each lexer, and in the CPP one it's the
classes OptionSetCPP and OptionsCPP.

> I mean, Lexer is not the main problem as it works for C & C++, so it
> should be a problem when assigning properties to JS, am I right ? If
> it's the case, where is it defined ?

No, you need to alter the lexer so that it understand a new property (a
setting if you will). Then, it's the application's responsibility to
set those properties to the desired value, through the SCI_SETPROPERTY
Scintilla API.

So what you would need to do is:

* add a new property to OptionSetCPP (and OptionsCPP)
* alter LexerCPP::Lex() to check that property and do the appropriate thing
* modify application code/data files to set that property for the
JavaScript language

Regards,
Colomban

Slv Prometheen

olvasatlan,
2016. dec. 1. 3:09:162016. 12. 01.
– scintilla-interest
Here are some modifications made to Scintilla CPP Lexer to allow (or not) to comment escaped line (modifications lines 337, 395, 681, 770). I only added a property and checked its value twice.
LexCPP.patch

Neil Hodgson

olvasatlan,
2016. dec. 1. 16:36:412016. 12. 01.
– scintilla...@googlegroups.com
Slv Prometheen:

> Here are some modifications made to Scintilla CPP Lexer to allow (or not) to comment escaped line (modifications lines 337, 395, 681, 770). I only added a property and checked its value twice.

Scintilla is currently frozen for the 3.7.1 release so this change will be examined after the release.

The commentEscapedLine field is set twice in OptionsCPP and one value or the other is correct.

Neil

Slv Prometheen

olvasatlan,
2016. dec. 2. 4:17:592016. 12. 02.
– scintilla-interest
Oh yeah, sorry. I uncommented one of them instead of deleting it. I'll change this. Thanks.

Anthony
Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet