Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334123

Summary: [editor] flaw in javascript editor comment detection
Product: [ECD] Orion Reporter: maarten meijer <mjmeijer>
Component: EditorAssignee: Project Inbox <orion.editor-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, eclipse.felipe, Silenio_Quarti
Version: unspecified   
Target Milestone: 0.3 RC1   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
showing screen with false comment color
none
javascript file containing erroneous code none

Description maarten meijer CLA 2011-01-12 10:27:04 EST
Created attachment 186642 [details]
showing screen with false comment color

I successfully added an existing workspace to the path and succeeded in opening a javascript file.

However the comment detetcion failed because it triggered on a comment marker inside string delimiters.

The javascript in question is:

SOAPClient._getElementsByTagName = function(document, tagName)
{
	try
	{
		// trying to get node omitting any namespaces (latest versions of MSXML.XMLDocument)
		return document.selectNodes(".//*[local-name()=\""+ tagName +"\"]");
	}
	catch (ex) {}
	// old XML parser support
	return document.getElementsByTagName(tagName);
}

and it shows comments after the /* in the selectNodes call.

The file is a extenral file soapclient.js which I attach, the error is in line 216
Comment 1 maarten meijer CLA 2011-01-12 10:28:06 EST
Created attachment 186643 [details]
javascript file containing erroneous code
Comment 2 Felipe Heidrich CLA 2011-01-12 15:35:42 EST
We are aware of this problem. It has not being fixed yet because we plan to replace the current syntax highlighter by a more porwerful one.

In the future, we would like to have syntax highlight for several different languages. Each supported language should have some type of grammar where the elements of the language are defined.
Comment 3 Silenio Quarti CLA 2011-09-26 12:52:25 EDT
The sample  styler is still being used. It is time to fix it.

Fixed 

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=782eb37b1744d75086b6724e4cca604a55f8d91d