From: SourceForge.net <no...@so...> - 2007-09-24 09:36:58
|
Feature Requests item #1800610, was opened at 2007-09-23 16:12 Message generated for change (Comment added) made by shlomy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350588&aid=1800610&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: core Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ondra (pekarna) Assigned to: Nobody/Anonymous (nobody) Summary: Syntax Highlighting to Have Unlimited Number of Token types Initial Comment: Hello, I found the fixed number of token types in jEdit very restrictive and unpleasant. When I have some combined code (HTML + PHP + evt. JavaScript + CSS), jEdit colors everything in the similar colors. But having blocks written in different language looking different would be so nice... I studied jEdit's highlighting definition syntax and figured out that this is not limited by the highlighting system, but by the number of token types. I've tried jEdit long time ago, then it was quite user unfriendly, crashing and run slowly on my then computer. Now I've found that with plugins, it has all features I look for to switch from my favorite but old editor, HomeSite (which's developement has already ended), EXCEPT for the genial syntax coloring of HomeSite... I will put a screenshot at http://ondra.zizka.cz/temp/HomeSite_screenshot.png . (Intentionally synthetized mix of all languages together, what is bad practice). So, my feature request is: As far as the "parsing" system is capable of the feature I ask for, and even the mode files would not have to be rewritten, I guess this is only a matter of the following: Let's not have fixed set of token types; instead, let's track all token types of each mode and let it be configurable similarly to shortcuts: 1) Separate color configuration for each mode, and 2) Global default color config for certain token types (comment, keyword1, operator), which would be applied if the specific mode setting would be "use default for this token type". Regards, Ondra Žižka ---------------------------------------------------------------------- >Comment By: Shlomy Reinstein (shlomy) Date: 2007-09-24 11:36 Message: Logged In: YES user_id=1477607 Originator: NO My discussions were not public. I actually suggested that each mode file defines the token types it uses, and that jEdit collects the token types from the mode files and enables their customization in the Global Options dialog. At least some of the token types have hard-coded semantics, so the token types can't be purely defined in the mode files. The plugin is currently very limited and only provides a user friendly way to customize the existing token type styles. In its current, limited version, it will only be available after the next release of jEdit (4.3pre11 or something like that). Thanks for your suggestion to help, maybe we can work together on this. I suggest to continue the discussion you started in the community site. Regarding token types: I don't think we are limited by the number of token types. jEdit defines 17 token types, do you know of a language that requires more? Regarding delimiters between languages: This is not a matter of token types. The concept is that a buffer is opened in an edit mode (a single edit mode). I don't know if jEdit currently handles several languages in the same buffer, as far as I know it does not (correct me if I'm wrong...), and if this is the case, a massive change is required in jEdit to support that and I doubt this will ever happen due to the complexity. However, I think it can be done, to some extent, in a plugin. I suggest to discuss this along with the other requested features on the community site until we reach some decision. ---------------------------------------------------------------------- Comment By: Ondra (pekarna) Date: 2007-09-23 18:03 Message: Logged In: YES user_id=1053064 Originator: YES Ah... and was that discussion public? And, if jEdit core devs decide to keep limited number of token types, could they at least add some? That shouldn't be that hard. My suggestion is below. I know that such solution is not much systemic, but better than nothing. When do you assume that plugin could be ready for use? I would love to help, but yet I do not know anything about jEdit plugins writing. If you had some task that common Java programmer could do, tell me. Suggested token types: Most important: DELIMITER for delimiters between different languages (E.G. HTML / PHP <? ?>, C++ / embeded SQL, etc.) Such delimiters are the very important when editing combined code. Also imporant: MARKUP2 - MARKUP8 for different colors for different XML/HTML tags - having the same colors for all tags is really ugly. See the attachment for an example of nice colored HTML and you simply must agree that such coloring is much prettier and much more lucid. FUNCTION2 (e.g. for PHP built-in functions) FUNCTION3 (e.g. for JavaScript -||-) FUNCTION4 (e.g. for CSS selectors) OPERATOR2 (e.g. for PHP's @ operator, which is kind of exceptional). OPERATOR3 (e.g. for PHP's . operator, which usualy appears between strings and should be more visible). KEYWORD 5 to 8 - each language has it's own keywords and it's own highlighting style (or should have)... ---------------------------------------------------------------------- Comment By: Shlomy Reinstein (shlomy) Date: 2007-09-23 16:36 Message: Logged In: YES user_id=1477607 Originator: NO I don't think we are limited by the number of tokens, although I agree that in principle there is no reason to limit the number of tokens. I've had a few discussions with some of the developers about syntax highlighting. I, too, suggested to do all that you ask in this feature request, and more. However, since the jEdit core is fairly complex already, I've written a plugin named SyntaxHelper. Currently, this plugin only makes it easy to configure the style of each token, by showing you the syntax highlighting option pane in a dockable window and letting it follow the caret and show you the style of the token under the caret. Unfortunately, it depends on the latest jEdit development version and can't be released until jEdit 4.3pre11 (or 4.3final) comes out. A future plan for this plugin is to enable mode-specific token styles and names. That is, each mode will be able to bind its own names for the existing token types, which will be more meaningful for the mode, and also suggest default styles for these token types. Users will be able to customize the global defaults as well as the mode-specific styles for each token type using the plugin. I don't want to introduce more complexity into jEdit for something that can easily be done in a plugin. I also thought of some revolutionary idea, where the plugin will let the user pick an arbitrary editor window on the screen (of some other editor) and "import" the style settings from that editor by querying the OS for the text style where possible (or apply some AI technique, but this gets out of scope for a SyntaxHelper plugin :-) and use it for the token type that jEdit would map this text to. But both of these are long-term plans. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350588&aid=1800610&group_id=588 |