History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-23382
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Sascha Weinreuter
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

XML validation result displays incorrect line- and column numbers

Created: 19 Nov 07 22:07   Updated: 17 Dec 07 12:58
Component/s: Plugin Support. API, XML editing
Fix Version/s: Diana 8243, Selena 7.0.3

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: None
Image Attachments:

1. screenshot-1.jpg
(27 kb)

2. screenshot-2.jpg
(22 kb)

Build: 7,549
Fixed in build: 7,601


 Description  « Hide
See the screenshot. The numbers are off by one.

The problem is in com.intellij.ide.errorTreeView.ErrorViewStructure#addMessage (called from com.intellij.ide.errorTreeView.NewErrorTreeViewPanel#addMessage): The passed line- and column numbers are zero-based as the OpenFileDescriptor expects them, but at the same time they are included in the displayed message that's supposed to be "human readable". I guess createExportPrefix() and createRendererPrefix() should take care of that.



 All   Comments   Work Log   Change History      Sort Order:
Maxim Mossienko - 19 Nov 07 22:34
Please, report the problem to Xerces developers. IDEA binds Xerces messages to correct place

Maxim Mossienko - 19 Nov 07 22:39
Btw, does RelaxNG external validator has the same problem?

Sascha Weinreuter - 19 Nov 07 22:41
Geez, this is not a Xerces problem at all. IDEA does navigate to the correct place, it just displays the wrong numbes.

Sascha Weinreuter - 19 Nov 07 22:43

Btw, does RelaxNG external validator has the same problem?

I'm not running the validator but using the message view to display messages when converting schemas between RNG, XSD, etc. with Trang.


Maxim Mossienko - 19 Nov 07 22:54
My bad.
Exact message from Xerces validator is not used for Message View

Sascha Weinreuter - 19 Nov 07 23:09
No problem, maybe my report was not specific enough - I thought the issue should be obvious when looking at the code.

If you're going to add 1 in in the create*Prefix methods, make sure you update their usages from com.intellij.openapi.vcs.impl.AbstractVcsHelperImpl as well


Sascha Weinreuter - 12 Dec 07 19:49
Just to make this sure: Only the displayed numbers are incorrect, not the location IDEA navigates to when double-clicking the message. Please don't make it navigate to the wrong location now

Maxim Mossienko - 12 Dec 07 20:05
Surely, only render prefix was changed

Sascha Weinreuter - 13 Dec 07 12:10
OK, I see. But now the file-icon changed from the XML filetype icon to a Java icon because now there's no VirtualFile to get the icon from.

Why didn't you fix it as suggested in com.intellij.ide.errorTreeView.ErrorViewStructure#addMessage? That code is in fact broken because it uses the same numbers for both display and navigation which will always cause a one-off error.

This would have solved the issue without accidentally changing the icon and would have also fixed any other uses of com.intellij.ide.errorTreeView.NewErrorTreeViewPanel#addMessage - including mine.


Maxim Mossienko - 13 Dec 07 23:41
Will be fine in next build

Sascha Weinreuter - 14 Dec 07 13:19
Thanks a lot Maxim, works fine now. However the ValidateXml action still shows a Java icon in Selena. Diana seems to be OK though

Isn't it amazing how much trouble a simple +/- 1 problem can cause?