Code outlining breaks after syntax error

Code Writer App Suggestions and Support Forum

Posted 6 years ago by Jarrich Van de Voorde
Version: 3.0.22
Avatar

Version 3.1 Build 23 on Windows 10 FCU x64

 

When I'm editing a JSON document; the left sidebar display - and + as you would expect to expand/collapse regions.

 

However that functionality completely stops working after the first line of code that contains a syntax erorr (and it red underlined by the syntax helper/checker)

 

Quite frustrating because I work in a lot of JSON/XML files serve as templates for code generation and they contain a lot of "flexible fields" that are not valid JSON.

 

If you need more information or anything else like a screenshot just ask.

 

I'm happy to help

 

Cheers,

Jarrich

PS Loving the app so far. Quick, easy and straightforward.

Comments (3)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jarrich,

Sure if you want to post a couple very small snippets (paste text snippets here using the "Insert a Code Block" button instead of a screenshot) that show the issue, we can have a look to see if we can improve parse error recovery.


Actipro Software Support

Posted 6 years ago by Jarrich Van de Voorde
Avatar
  {
  "id": "/{ENV}/octotrip.universe",
  "apps": [
    {
      "id": "travelaggregation.flights",
      "dependencies": [],
      "env": {
        "ASPNETCORE_URLS": "http://0.0.0.0",
		    "PathBase" : "/{ENV}/flights"
      },
      "instances": 1,
      "cpus": 0.1,
      "mem": 512,
      "disk": 0,
      "container": {
        "type": "DOCKER",
        "volumes": [],
        "docker": {
          "image": "{REGISTRY}/travelaggregation.flights:{BUILD_NUMBER}",
          "network": "BRIDGE",
          "portMappings": [
            {
              "containerPort": 80,
              "hostPort": 0,
              "servicePort": {SP_FLIGHTS},
              "protocol": "tcp",
          "labels": {}
        }
        ],
        "privileged": false,
        "parameters": [],
        "forcePullImage": false
      }},
      "labels": {
        "HAPROXY_0_MODE": "http",
        "HAPROXY_GROUP": "external",
        "HAPROXY_0_VHOST": "{AGENTS_FQDN}",
        "HAPROXY_0_PATH": "/{ENV}/flights"
      },
      "portDefinitions": [
        {
          "port": {SP_FLIGHTS},
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "uris": [
        ""
      ]
    },
    {
      "id": "apigateway",
      "dependencies": [],
      "env": {
        "ASPNETCORE_URLS": "http://0.0.0.0",
		    "PathBase" : "/{ENV}/api"
      },
      "instances": 1,
      "cpus": 0.1,
      "mem": 64,
      "disk": 0,
      "container": {
        "type": "DOCKER",
        "volumes": [],
        "docker": {
          "image": "{REGISTRY}/apigateway:{BUILD_NUMBER}",
          "network": "BRIDGE",
          "portMappings": [
            {
              "containerPort": 80,
              "hostPort": 0,
              "servicePort": {SP_APIGATEWAY},
              "protocol": "tcp",
          "labels": {}
        }
        ],
        "privileged": false,
        "parameters": [],
        "forcePullImage": false
      }},
      "labels": {
        "HAPROXY_0_MODE": "http",
        "HAPROXY_GROUP": "external",
        "HAPROXY_0_VHOST": "{AGENTS_FQDN}",
        "HAPROXY_0_PATH": "/{ENV}/api"
      },
      "portDefinitions": [
        {
          "port": {SP_APIGATEWAY},
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "uris": [
        ""
      ]
    },
    {
      "id": "travelaggregation.flights.integration.routehappy",
      "dependencies": [],
      "env": {
        "ASPNETCORE_URLS": "http://0.0.0.0",
		    "PathBase": "/{ENV}/routehappy"
      },
      "instances": 1,
      "cpus": 0.1,
      "mem": 128,
      "disk": 0,
      "container": {
        "type": "DOCKER",
        "volumes": [],
        "docker": {
          "image": "{REGISTRY}/travelaggregation.flights.integration.routehappy:{BUILD_NUMBER}",
          "network": "BRIDGE",
          "portMappings": [
            {
              "containerPort": 80,
              "hostPort": 0,
              "servicePort": {SP_ROUTEHAPPY},
              "protocol": "tcp",
          "labels": {}
        }
        ],
        "privileged": false,
        "parameters": [],
        "forcePullImage": false
      }},
      "labels": {
        "HAPROXY_0_MODE": "http",
        "HAPROXY_GROUP": "external",
        "HAPROXY_0_VHOST": "{AGENTS_FQDN}",
        "HAPROXY_0_PATH": "/{ENV}/routehappy"
      },
      "portDefinitions": [
        {
          "port": {SP_ROUTEHAPPY},
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "uris": [
        ""
      ]
    },
    {
      "id": "tripcreation",
      "dependencies": [],
      "env": {
        "ASPNETCORE_URLS": "http://0.0.0.0",
		    "PathBase" : "/{ENV}/tripcreation"
      },
      "instances": 1,
      "cpus": 0.1,
      "mem": 64,
      "disk": 0,
      "container": {
        "type": "DOCKER",
        "volumes": [],
        "docker": {
          "image": "{REGISTRY}/tripcreation:{BUILD_NUMBER}",
          "network": "BRIDGE",
          "portMappings": [
            {
              "containerPort": 80,
              "hostPort": 0,
              "servicePort": {SP_TRIPCREATION},
              "protocol": "tcp",
              "labels": {}
            }
          ],
          "privileged": false,
          "parameters": [],
          "forcePullImage": false
        }
      },
      "labels": {
        "HAPROXY_0_MODE": "http",
        "HAPROXY_GROUP": "external",
        "HAPROXY_0_VHOST": "{AGENTS_FQDN}",
        "HAPROXY_0_PATH": "/{ENV}/tripcreation"
      },
      "portDefinitions": [
        {
          "port": {SP_TRIPCREATION},
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "uris": [
        ""
      ]
    },
	{
      "id": "travelaggregation.hotels",
      "dependencies": [],
      "env": {
        "ASPNETCORE_URLS": "http://0.0.0.0",
		    "PathBase" : "/{ENV}/hotels"
      },
      "instances": 1,
      "cpus": 0.1,
      "mem": 512,
      "disk": 0,
      "container": {
        "type": "DOCKER",
        "volumes": [],
        "docker": {
          "image": "{REGISTRY}/travelaggregation.hotels:{BUILD_NUMBER}",
          "network": "BRIDGE",
          "portMappings": [
            {
              "containerPort": 80,
              "hostPort": 0,
              "servicePort": {SP_HOTELS},
              "protocol": "tcp",
          "labels": {}
        }
        ],
        "privileged": false,
        "parameters": [],
        "forcePullImage": false
      }},
      "labels": {
        "HAPROXY_0_MODE": "http",
        "HAPROXY_GROUP": "external",
        "HAPROXY_0_VHOST": "{AGENTS_FQDN}",
        "HAPROXY_0_PATH": "/{ENV}/hotels"
      },
      "portDefinitions": [
        {
          "port": {SP_HOTELS},
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "uris": [
        ""
      ]
    },
	{
      "id": "travelaggregation.hotels.integration.travelpayouts",
      "dependencies": [],
      "env": {
        "ASPNETCORE_URLS": "http://0.0.0.0",
		    "PathBase" : "/{ENV}/travelpayouts"
      },
      "instances": 1,
      "cpus": 0.1,
      "mem": 512,
      "disk": 0,
      "container": {
        "type": "DOCKER",
        "volumes": [],
        "docker": {
          "image": "{REGISTRY}/travelaggregation.hotels.integration.travelpayouts:{BUILD_NUMBER}",
          "network": "BRIDGE",
          "portMappings": [
            {
              "containerPort": 80,
              "hostPort": 0,
              "servicePort": {SP_TRAVELPAYOUTS},
              "protocol": "tcp",
          "labels": {}
        }
        ],
        "privileged": false,
        "parameters": [],
        "forcePullImage": false
      }},
      "labels": {
        "HAPROXY_0_MODE": "http",
        "HAPROXY_GROUP": "external",
        "HAPROXY_0_VHOST": "{AGENTS_FQDN}",
        "HAPROXY_0_PATH": "/{ENV}/travelpayouts"
      },
      "portDefinitions": [
        {
          "port": {SP_TRAVELPAYOUTS},
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "uris": [
        ""
      ]
    }
  ]
}

 From line 22 the outlining toggles break.

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thanks for the sample.  We've updated our JSON parser grammar to have some better error recovery for this scenario.  This will roll into Code Writer's next version.


Actipro Software Support

The latest build of this product (v4.2.42) was released 3 years ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.