Skip to content
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

Show usages of a step implementation #16

Closed
2 tasks done
zabil opened this issue Oct 12, 2017 · 8 comments
Closed
2 tasks done

Show usages of a step implementation #16

zabil opened this issue Oct 12, 2017 · 8 comments
Assignees

Comments

@zabil
Copy link
Member

zabil commented Oct 12, 2017

Show a code lens over the step implementation that will bring up a usages view.

Acceptance criteria

  • List number of usages above the step implementation
2 references
step("Vowels in English language are <vowels>.", function(vowelsGiven) {
  assert.equal(vowelsGiven, vowels.join(""));
});
  • If the step has multiple implementations then all the implementations should show the usages

Test cases

  • Should list number of usages
  • Multiple implementations should show all the usages
@nehashri
Copy link
Contributor

nehashri commented Nov 7, 2017

should be available in nightly gauge, gauge-js, gauge-vscode >= 07-11-2017

@sswaroopgupta
Copy link
Contributor

Issues

  • Multiple step implementations for the same step does not show the warning

@nehashri
Copy link
Contributor

nehashri commented Nov 9, 2017

@sguptatw The issue talks about showing code lens for references of step.
The acceptance criteria

If the step has multiple implementations then the warning message should be shown instead of the usage count

and test case

Multiple implementations for the same step should show the warning

looks like it is mixing up problem diagnostics and references.
If a duplicate step implementation exists in a different file, it is hard for the user to find the duplicate. References also will not be shown if we decide to show a warning instead.
Also a code lens cannot be used to show a warning. It is more like an action that can be invoked by a user. It should not be used to show warnings to a user.

To handle the issue you have pointed out, to show a warning
We should be populating it with problem diagnostics for javascript files.
OR
Show another code lens with which takes you to the duplicate implementation.

In either case, it should not be mixed up with showing usages of a step.

@zabil
Copy link
Member Author

zabil commented Nov 9, 2017

If a duplicate step implementation exists in a different file, it is hard for the user to find the duplicate. References also will not be shown if we decide to show a warning instead.

Agreed, didn't consider this scenario.

@zabil
Copy link
Member Author

zabil commented Nov 9, 2017

New test case

  • Highlight the step text (Almost all words have vowels) in the preview pane, to locate it easily

highlightreference

@sswaroopgupta
Copy link
Contributor

sswaroopgupta commented Nov 9, 2017

@nehashri Thanks for the clarification

Question

In code when there is a duplicate step implementation how should the references are displayed?

Current behavior
If the step implementations are in 2 different files, the number of usages are displayed for all the duplicate step implementations.
If the duplicate step implementation is in the same file, only one of the step implementations have the usage number. The other step implementation(s) will not have the code lens link.

How should this be handled?

@zabil
Copy link
Member Author

zabil commented Nov 10, 2017

In code when there is a duplicate step implementation how should the references are displayed?

The references code lens must be displayed for all duplicated methods.

kashishm pushed a commit to getgauge/gauge-js that referenced this issue Nov 15, 2017
* Storing duplicate step file locations in step registry, getgauge/gauge-vscode#16

* refactoring step registry count function
@nehashri
Copy link
Contributor

changes should be available in gauge, gauge-js, gauge-vscode nightly >= 15-11-2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants