Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Added completions for symbols from unimported pkg if there are multiple matches for pkg name #1900

Merged
merged 5 commits into from
Sep 20, 2018

Conversation

shreyaskarnik
Copy link
Contributor

Fixes #1884

@ramya-rao-a
Copy link
Contributor

@shreyu86 With your change, after the user chooses from the completion list, they need to trigger completions one more time to get the symbols from the selected package.

I have pushed a commit to automatically trigger the suggestions.

Can you try it out and update the unit tests accordingly?

@shreyaskarnik
Copy link
Contributor Author

Thanks, @ramya-rao-a I tested the new change. How do I go about updating the unit test? Can I hit tab on the first suggestion to trigger subsequent suggestion and then check for those?

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 4, 2018

Or you can run the command acceptSelectedSuggestion using the vscode.commands.executeCommand function

@shreyaskarnik
Copy link
Contributor Author

@ramya-rao-a I will update the tests and have this PR up for review soon, sorry I was out of office.

@ramya-rao-a
Copy link
Contributor

No problem, take your time. I was out last week on vacation as well :)

@shreyaskarnik
Copy link
Contributor Author

@ramya-rao-a I attempted to refactor the tests but was not successful in acceptSelectedSuggestion can you please provide some samples/pointers?

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 10, 2018

Keep the existing test case as is and create a new one with the same sample test file

  • After showTextDocument, set editor.selection to the right position where we want suggestions to be triggered
  • Then use vscode.commands.executeCommand('editor.action.triggerSuggest') followed by vscode.commands.executeCommand('acceptSelectedSuggestion')
  • Then check the document contents

Note: These are just ideas, I havent tried them out myself :)

@shreyaskarnik
Copy link
Contributor Author

@ramya-rao-a I tried couple of options ^^ and I was not able to get the test refactored, can you please help?

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 20, 2018

The problem is that the suggest widget is not completely rendered before the accept suggestion command is executed.

Never mind, I think we can skip that.

I pushed a commit for some extra checks in your test case. This is good to go. Just waiting for travis tests to pass

Thanks again!

@shreyaskarnik
Copy link
Contributor Author

Thanks a lot for help on this! Really appreciate it.

@ramya-rao-a ramya-rao-a merged commit eff0139 into microsoft:master Sep 20, 2018
@shreyaskarnik
Copy link
Contributor Author

Thanks a lot @ramya-rao-a

@ramya-rao-a
Copy link
Contributor

No problem at all

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

Successfully merging this pull request may close these issues.

2 participants