{"action":"closed","issue":{"url":"https://api.github.com/repos/igordejanovic/textX/issues/108","repository_url":"https://api.github.com/repos/igordejanovic/textX","labels_url":"https://api.github.com/repos/igordejanovic/textX/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/igordejanovic/textX/issues/108/comments","events_url":"https://api.github.com/repos/igordejanovic/textX/issues/108/events","html_url":"https://github.com/igordejanovic/textX/issues/108","id":381507218,"node_id":"MDU6SXNzdWUzODE1MDcyMTg=","number":108,"title":"Object processor with imports","user":{"login":"dkrikun","id":509444,"node_id":"MDQ6VXNlcjUwOTQ0NA==","avatar_url":"https://avatars1.githubusercontent.com/u/509444?v=4","gravatar_id":"","url":"https://api.github.com/users/dkrikun","html_url":"https://github.com/dkrikun","followers_url":"https://api.github.com/users/dkrikun/followers","following_url":"https://api.github.com/users/dkrikun/following{/other_user}","gists_url":"https://api.github.com/users/dkrikun/gists{/gist_id}","starred_url":"https://api.github.com/users/dkrikun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkrikun/subscriptions","organizations_url":"https://api.github.com/users/dkrikun/orgs","repos_url":"https://api.github.com/users/dkrikun/repos","events_url":"https://api.github.com/users/dkrikun/events{/privacy}","received_events_url":"https://api.github.com/users/dkrikun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-16T09:04:48Z","updated_at":"2018-11-22T14:50:42Z","closed_at":"2018-11-22T14:50:42Z","author_association":"CONTRIBUTOR","body":"I have a scoping provider `PlainNameImportURI`, with two files `a.dsl` and `b.dsl`:\r\n\r\n```\r\nimport 'b.dsl';\r\nclass A {}\r\n```\r\n\r\n```\r\nclass B {}\r\n```\r\n\r\nI register a model processor and an object processor for the class object. Then I observe that model processor callable is called as expected, but object processors are called twice for each object (that is 4 times in the example above, 2 for each 'class'). Also I see that they are only called while processing the main model (the one that imports).\r\n\r\nThe code looks like this:\r\n```python\r\ndef print_obj(x):\r\n    print(x.name)\r\n\r\ndef print_model(m, mm):\r\n    print(m._tx_filename)\r\n\r\nmm.register_scope_providers({'*.*', scoping_providers.PlainNameImportURI()}\r\nmm.register_obj_processors({'Class': print_obj})\r\nmm.register_model_processor(print_model)\r\n```\r\n\r\nThe output is then:\r\n```\r\nb.dsl\r\nA\r\nB\r\nA\r\nB\r\na.dsl\r\n```\r\n\r\nI'm using textX from pypi, version 1.8.0\r\n\r\nIs it expected? I would expect to see:\r\n```\r\nB\r\nb.dsl\r\nA\r\na.dsl\r\n```"}}
{"actor":{"display_login":"dkrikun"}}