Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » TheIDE now supports JavaScript syntax highlighting for .js file extension
TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36610] Wed, 20 June 2012 08:44 Go to next message
mirek is currently offline  mirek
Messages: 13428
Registered: November 2005
Ultimate Member
No Message Body
Re: TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36616 is a reply to message #36610] Wed, 20 June 2012 16:26 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1363
Registered: November 2005
Location: Poland
Ultimate Contributor

Good to hear that! if you could add tag highlighting in xml file as well as tag matching (like bracket matching) that would be awesome Smile

BTW: I'm almost done with preview tab (idea stolen from VS 2012) that prevents opening too many tabs during debugging or browsing files.
Re: TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36617 is a reply to message #36616] Wed, 20 June 2012 17:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13428
Registered: November 2005
Ultimate Member
unodgs wrote on Wed, 20 June 2012 10:26

Good to hear that! if you could add tag highlighting in xml file as well as tag matching (like bracket matching) that would be awesome Smile



Actually, for .xml, I was thinking about integrating XmlView...

I guess html will come in next development cycle - it will need major refactoring of syntax highlighting mechanism (it is now pretty much tied to curly braces languages...).
Re: TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36648 is a reply to message #36617] Sun, 24 June 2012 00:02 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Very good news! Thanks Mirek!

A small proposal: please make true/false hilighted as reserved words in JS (it is a part of JS standard).

[Updated on: Sun, 24 June 2012 00:02]

Report message to a moderator

Re: TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36650 is a reply to message #36617] Sun, 24 June 2012 09:13 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1781
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Wed, 20 June 2012 17:54

I guess html will come in next development cycle - it will need major refactoring of syntax highlighting mechanism (it is now pretty much tied to curly braces languages...).


Funny coincidence: Just a few days before you announced the JS highlighting, I thought that it might be fun to reimplement CodeEditor to support user-defined highlighting. I even started working on it in my free time, so here is a little tasting:
index.php?t=getfile&id=3785&private=0
The image shows CodeEditor using the highlight definition file specifying highlighting of higlighting definition files to highlight highlight definition file specifying highlighting of higlighting definition files. Pretty meta, right? Very Happy

It is based on pcre and caching. Basic highlighting works just fine, some of the higher level features (scope highlighting, matching brackets, ...) are not yet implemented and some are using the old CodeEditor code. The goal is to allow loading user specified highlighters, both at compile time (by include) and at run-time. It requires some pcre skill (or copy&paste skill Smile ) to write one, but otherwise it is very simple format as you can see above - it takes only 16 lines to describe C++ Smile This file imitates current CodeEditor:
Quote:

HL_PATTERN(INK_OPERATOR, "[\\Q!+-*/\%&|=[]:?<>.~^\\E]")
HL_PATTERN(INK_KEYWORD, " \\b(__(asm|cdecl|declspec|except|fastcall|finally|inline|int (16|32|64|8)|leave|stdcall|try|uuidof)|auto|bool|break|case| catch|char|class|const|const_cast|continue|default|delete|dl l(ex|im)port|do|double|dynamic_cast|else|enum|explicit|exter n|false|float|for|force_inline|friend|goto|if|inline|int|lon g|mutable|namespace|new|operator|private|protected|public|re gister|reinterpret_cast|return|short|signed|sizeof|static|st atic_cast|struct|switch|template|this|thread|throw|true|try| typedef|typeid|typename|union|unsigned|using|virtual|void|vo latile|while)\\b ")
HL_PATTERN(INK_UPPER, "\\b[A-Z][A-Z_0-9]*\\b")
HL_PATTERN(INK_UPP, "\\bupp\\b")
HL_PATTERN(INK_MACRO, " ^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)d ef|endif|el(if|se)|if|warning|error|pragma|using)\\b ")
HL_PATTERN(INK_UPPMACROS, " \\b(CLASSNAME|(THIS|PTE)BACK([1-4]?)|QUOTE|X?ASSERT|X?NEVER| X?CHECK|NAMESPACE_UPP|END_UPP_NAMESPACE|NEVER_|ASSERT_)\\b ")
HL_PATTERN(INK_UPPLOGS, " \\b([DLR]?DUMP(C|CC|CC|HEX|M)?|[DLR]?LOG(F|HEX|BEGIN|END|BLO CK|HEXDUMP|SRCPOS)?|[DLR]?TIMING|DEBUGCODE|RQUOTE)\\b ")
HL_PATTERN(INK_CONST_INT, "\\b[0-9]+\\b")
HL_PATTERN(INK_CONST_HEX, "\\b0(x|X)[[:xdigit:]]+\\b")
HL_PATTERN(INK_CONST_OCT, "\\b0[0-7]+\\b")
HL_PATTERN(INK_CONST_FLOAT, "\\b[0-9]+\\.[0-9]*\\b")
HL_PATTERN(INK_CONST_STRINGOP, "TODO")
HL_PATTERN(INK_CONST_STRING, "[\"](\\.|[^\"])*[\"]")
HL_PATTERN(INK_COMMENT, "//.*")
HL_PATTERN_ML(INK_COMMENT, "/\\*", "\\*/")
HL_SCOPE("[{]", "[}]")


If there is anyone interested in more details we can discuss it in separate thread Wink

Best regards,
Honza
Re: TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36651 is a reply to message #36650] Sun, 24 June 2012 09:20 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3268
Registered: August 2008
Senior Veteran
Hello Honza

It is interesting for me. I use a special language and I implemented some very basic syntax highlighting but I would like to use something much better.

Thank you Smile.


Best regards
IƱaki
Re: TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36654 is a reply to message #36651] Sun, 24 June 2012 09:55 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 671
Registered: November 2008
Location: France
Contributor
Hi Honza,

Very intersting Wink

Although I don't need it for the moment, it can get handy when using a DSL or wrting a new one.

What is the perfomance on large files ?
Re: TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36656 is a reply to message #36610] Sun, 24 June 2012 10:03 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1781
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Thanks for interest Koldo & Didier,

I'll respond in a new thread so we don't spam this announcement Wink

Honza
Re: TheIDE now supports JavaScript syntax highlighting for .js file extension [message #36704 is a reply to message #36656] Wed, 27 June 2012 08:31 Go to previous message
mirek is currently offline  mirek
Messages: 13428
Registered: November 2005
Ultimate Member
..in related news, .css is now highlighted as well (well, in fact, not really well, but it is acceptable...Smile
Previous Topic: TheIDE raster image file support
Next Topic: .ini file helpers
Goto Forum:
  


Current Time: Sun Sep 26 23:18:09 CEST 2021

Total time taken to generate the page: 0.01371 seconds