Modify

Opened 9 years ago

Closed 7 months ago

#11277 closed enhancement (worksforme)

Show the line number for syntax errors in preset files

Reported by: Dakon Owned by: team
Priority: normal Milestone:
Component: Core Version: tested
Keywords: template_report, debug Cc:

Description (last modified by Klumbumbus)

What steps will reproduce the problem?

  1. Create a custom MapCSS XML preset file with syntax error
  2. activate it in JOSM
  3. the error is printed, but no hint where in the file it is

What is the expected result?

A easy way to identify the exact point of the error should be printed, preferably the line number, or the XML hierarchy to the object.

What happens instead?

Only the direct anchestor node is shown, which can occur multiple times in the preset.

Please provide any additional information below. Attach a screenshot if possible.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-03-30 01:30:55
Last Changed Author: stoecker
Revision: 8159
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-03-29 14:37:50 +0200 (Sun, 29 Mar 2015)
Last Changed Rev: 8159

Identification: JOSM/1.5 (8159 de) Linux openSUSE 13.1 (Bottle) (x86_64)
Memory Usage: 407 MB / 910 MB (315 MB allocated, but free)
Java version: 1.7.0_55, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: java-1_7_0-openjdk:x86_64-1.7.0.55

Plugins:
- OpeningHoursEditor (30962)
- buildings_tools (30955)
- geochat (31056)
- imagery_offset_db (31056)
- jna (30892)
- log4j (30892)
- native_password_manager (31061)
- osmarender (30892)
- pbf (31010)
- poly (31056)
- public_transport (30892)
- reverter (30990)
- terracer (30892)
- undelete (30892)
- utilsplugin2 (31040)

Attachments (0)

Change History (9)

comment:1 by skyper, 9 years ago

Please, start josm from a terminal and you get the line numbers.

comment:2 by Klumbumbus, 9 years ago

you can check in the console or in the mappaint dialog by right clicking on the mappaint style and then choose info and errors Help/Dialog/MapPaint

comment:3 by Dakon, 9 years ago

On a terminal that is all I get (German version):

Fehler: Defekte Objektvorlage "maxspeed:tilting-Maxspeed of Used by tilting trains (km/h)" - Anzahl der Datenworte in 'display_values' und in 'values' müssen gleich sein

This is exactly where I'm looking at, since in mappaint dialog no errors of presets are shown.

in reply to:  3 comment:4 by Klumbumbus, 9 years ago

Replying to Dakon:

in mappaint dialog no errors of presets are shown.

Yes, mappaint styles and presets are two different completely independent things. I thought you are talking about mappaint styles because you said "mapcss".

You're right the position of a preset syntax error is not printed in the console even in debug mode.

comment:5 by Klumbumbus, 9 years ago

Description: modified (diff)

comment:6 by Klumbumbus, 9 years ago

Keywords: debug added

comment:7 by simon04, 9 years ago

Type: defectenhancement

in reply to:  1 comment:8 by skyper, 9 years ago

Replying to skyper:

Please, start josm from a terminal and you get the line numbers.

Sorry, it is only the tagging-preset-tester plugin which tells you the line and character, atm.

comment:9 by taylor.smock, 7 months ago

Resolution: worksforme
Status: newclosed

I don't know when this was changed, but it is working now:

  • resources/data/defaultpresets.xml

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/resources/data/defaultpresets.xml b/resources/data/defaultpresets.xml
    a b  
    1010    </chunk>
    1111    <chunk id="surface_smoothness">
    1212        <reference ref="surface" />
    13         <combo key="smoothness" text="Smoothness" values_searchable="true" values_sort="false">
     13        <combo key="smoothness" text="Smoothness" values_searchable="true" values_sort="false" foobar>
    1414            <list_entry value="excellent" short_description="Thin Rollers: rollerblade, skateboard" />
    1515            <list_entry value="good" short_description="Thin Wheels: racing bike" />
    1616            <list_entry value="intermediate" short_description="Wheels: city bike, wheelchair, scooter" />

produces
[Fatal Error] :13:102: Attribute name "foobar" associated with an element type "combo" must be followed by the ' = ' character.
Error syntax appears to be :line:column:.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.