-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support typing of fixture parameters #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this!
@nickjmiller please release it if the feature is approved. |
The new tests don't seem to be passing on a windows machine and the functionality isn't working either. I can look into it a little deeper this weekend, it may just be related to the path separator. |
Now tests are independence other installed plugins
I improved tests and test data. It is now independent what other pytest plugins your have in your system. Instead of compare if the fixture list is match, now it checks if the expected fixtures exist in the fixture list reported by pytest. I downloaded and start a Windows virtual machine and run all tests successfully both on Windows and Linux OS. |
Thanks, the tests are working now and the functionality as well, I just didn't read the README close enough before. I do think it's a bit unintuitive to trigger this, what do you think of including the return type in the original CompletionItem, e.g.: let fixtureName = fixture.name;
if (fixture.returnType) {
fixtureName += `: ${fixture.returnType}`;
}
let item = new vscode.CompletionItem(
fixtureName,
vscode.CompletionItemKind.Snippet
);
... I think this might be a nice way to expose this, but it would need to be a toggleable option since earlier versions of python wouldn't support it and some people might not want typing. Or maybe two suggestions could be provided: let fixtureName = fixture.name;
let item = new vscode.CompletionItem(
fixtureName,
vscode.CompletionItemKind.Snippet
);
if (fixture.returnType) {
let itemWithType = new vscode.CompletionItem(
fixtureName: `${fixtureName}: ${fixture.returnType}`,
vscode.CompletionItemKind.Snippet
);
... |
I started with the solution to autocomplete fixture with the type as you showed above. I found some drawbacks and it is not intuitive.
|
src/fixtureParser.ts
src/suggestionProvider.ts
Add 2 more tests for typing of fixture parameters