Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334123 - [editor] flaw in javascript editor comment detection
Summary: [editor] flaw in javascript editor comment detection
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Editor (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 0.3 RC1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-12 10:27 EST by maarten meijer CLA
Modified: 2011-10-11 15:40 EDT (History)
3 users (show)

See Also:


Attachments
showing screen with false comment color (107.02 KB, image/png)
2011-01-12 10:27 EST, maarten meijer CLA
no flags Details
javascript file containing erroneous code (11.78 KB, application/x-javascript)
2011-01-12 10:28 EST, maarten meijer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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