{"action":"created","issue":{"url":"https://api.github.com/repos/cucumber/cucumber-eclipse/issues/291","repository_url":"https://api.github.com/repos/cucumber/cucumber-eclipse","labels_url":"https://api.github.com/repos/cucumber/cucumber-eclipse/issues/291/labels{/name}","comments_url":"https://api.github.com/repos/cucumber/cucumber-eclipse/issues/291/comments","events_url":"https://api.github.com/repos/cucumber/cucumber-eclipse/issues/291/events","html_url":"https://github.com/cucumber/cucumber-eclipse/issues/291","id":383345650,"node_id":"MDU6SXNzdWUzODMzNDU2NTA=","number":291,"title":"Support custom parameter type","user":{"login":"qvdk","id":6142398,"node_id":"MDQ6VXNlcjYxNDIzOTg=","avatar_url":"https://avatars3.githubusercontent.com/u/6142398?v=4","gravatar_id":"","url":"https://api.github.com/users/qvdk","html_url":"https://github.com/qvdk","followers_url":"https://api.github.com/users/qvdk/followers","following_url":"https://api.github.com/users/qvdk/following{/other_user}","gists_url":"https://api.github.com/users/qvdk/gists{/gist_id}","starred_url":"https://api.github.com/users/qvdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qvdk/subscriptions","organizations_url":"https://api.github.com/users/qvdk/orgs","repos_url":"https://api.github.com/users/qvdk/repos","events_url":"https://api.github.com/users/qvdk/events{/privacy}","received_events_url":"https://api.github.com/users/qvdk/received_events","type":"User","site_admin":false},"labels":[{"id":18509268,"node_id":"MDU6TGFiZWwxODUwOTI2OA==","url":"https://api.github.com/repos/cucumber/cucumber-eclipse/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-22T01:14:14Z","updated_at":"2018-11-26T20:58:52Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Cucumber expressions are supported since #285 \r\n\r\nHowever, only built-in parameter types are supported. \r\nFor example: `I have a {word} ball`.\r\n\r\nThere are other built-in parameter types like `{int}`, `{float}` or `{string}`. The full list of [built-in parameter types](https://docs.cucumber.io/cucumber/cucumber-expressions/) is available in the cucumber docs.\r\n\r\nBut cucumber expressions allow to supply your own parameter type.\r\nFor example: `I have a {color} ball`\r\n\r\nYou can define your `color` parameter type with the following snippet: \r\n```java\r\ntypeRegistry.defineParameterType(new ParameterType<>(\r\n    \"color\",           // name\r\n    \"red|blue|yellow\", // regexp\r\n    Color.class,       // type\r\n    Color::new         // transformer function\r\n))\r\n```\r\nThe previous link on the documentation provides more details.\r\n\r\nFor now, the plugin does not detect cucumber expressions with custom parameter type. \r\nSo, the steps written with these ones are detected with no matching glue code. \r\n\r\n![screenshot from 2018-11-22 02-02-50](https://user-images.githubusercontent.com/6142398/48875708-c6570a00-edfa-11e8-8919-7dc251db670a.png)\r\n\r\nMore, the user can not jump to the matching glue code with <kbd>CTRL</kbd>+<kbd>click</kbd> or <kbd>F3</kbd>.\r\n\r\nThe issue comes with the following snippet from cucumber.eclipse.steps.integration.Step.setText(String)\r\n```java\r\nthis.expression = new ExpressionFactory(new ParameterTypeRegistry(locale)).createExpression(text);\r\n```\r\n\r\nIn order to support custom parameter type, the plugin should retrieve all `ParameterType` available in the classpath, then register them to the `ParameterTypeRegistry`. \r\n\r\nThe issue can be reproduced with the [java-calculator sample project](https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-calculator)."},"comment":{"url":"https://api.github.com/repos/cucumber/cucumber-eclipse/issues/comments/441795665","html_url":"https://github.com/cucumber/cucumber-eclipse/issues/291#issuecomment-441795665","issue_url":"https://api.github.com/repos/cucumber/cucumber-eclipse/issues/291","id":441795665,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTc5NTY2NQ==","user":{"login":"qvdk","id":6142398,"node_id":"MDQ6VXNlcjYxNDIzOTg=","avatar_url":"https://avatars3.githubusercontent.com/u/6142398?v=4","gravatar_id":"","url":"https://api.github.com/users/qvdk","html_url":"https://github.com/qvdk","followers_url":"https://api.github.com/users/qvdk/followers","following_url":"https://api.github.com/users/qvdk/following{/other_user}","gists_url":"https://api.github.com/users/qvdk/gists{/gist_id}","starred_url":"https://api.github.com/users/qvdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qvdk/subscriptions","organizations_url":"https://api.github.com/users/qvdk/orgs","repos_url":"https://api.github.com/users/qvdk/repos","events_url":"https://api.github.com/users/qvdk/events{/privacy}","received_events_url":"https://api.github.com/users/qvdk/received_events","type":"User","site_admin":false},"created_at":"2018-11-26T20:58:52Z","updated_at":"2018-11-26T20:58:52Z","author_association":"CONTRIBUTOR","body":"@laeubi help needed :+1: \r\n\r\nYour are  right. Ideally, the plugin should search after `TypeRegistryConfigurer`.\r\n\r\nHowever, I do not known how to get, compile and execute the previous search results."}}
{"actor":{"display_login":"qvdk"}}