Intellisense and custom steps file #4091
-
So I've run into a bit of a nuisance. I noticed that any code we add into the custom steps file isn't detected by VS Code https://codecept.io/pageobjects/#actor This is leading to a lot of confusion and sometimes team members removing required code due to their IDE telling them it's redundant. Our codebase uses Javascript module.exports = function() {
return actor({
async myAsyncFunction(param) {
// logic goes here
},
async myOtherFunction(param) {
await this.myAsyncFunction(param)
}
});
}; In this example there will are 2 problems. One, You can't deep-link back to myAsyncFunction by cmd+clicking it (MacOS) And two, the IDE will berate you for using await on a non-promise These are example from within the steps file itself, but it extends past that. When using these functions inside of tests they also don't support intellisense and complain about using await on non-promises. Additional note, the native CodeceptJS functions do support intellisense, this only happens for code that's new in the steps file. The problem does not seem to exist in other IDE's. Colleagues that use Jetbrains seem to be able to use this without issues. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Did you try this with your step file? // in this file you can append custom step methods to 'I' object export = function() {
}); |
Beta Was this translation helpful? Give feedback.
-
did you try to run |
Beta Was this translation helpful? Give feedback.
#4153