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

#2063 only suggest exported member name at start of comment #2070

Merged
merged 3 commits into from
Jan 20, 2019
Merged

#2063 only suggest exported member name at start of comment #2070

merged 3 commits into from
Jan 20, 2019

Conversation

kagof
Copy link
Contributor

@kagof kagof commented Nov 1, 2018

Resolves #2063 - only suggest the exported member name if the current comment has no content.

Copy link
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @kagof!

I see that this is your first contribution to this project, Welcome and Thanks!

We still want the suggestion to show up when we are in the first word in the comment.

For example, in the below case, when completion is triggered after He, we want the suggestion to show up

// He
func Hello() string {
   return "hello"
}

@kagof
Copy link
Contributor Author

kagof commented Nov 4, 2018

Hi @ramya-rao-a , thanks for the clear feedback and the warm welcome! I've added another commit which allows the suggestion to show up in the first word. I've also rebased off of master to resolve a minor conflict.

@rubenzinho07
Copy link

rubenzinho07 commented Nov 4, 2018 via email

src/goSuggest.ts Outdated Show resolved Hide resolved
src/goSuggest.ts Outdated Show resolved Hide resolved
src/goSuggest.ts Outdated Show resolved Hide resolved
suggestionItem = new vscode.CompletionItem(memberType[3], vscodeKindFromGoCodeClass(memberType[1], ''));
suggestionItem = new vscode.CompletionItem(memberType[3], vscodeKindFromGoCodeClass(memberType[1], ''));
}
return resolve(suggestionItem ? [suggestionItem] : []);
Copy link
Contributor

@ramya-rao-a ramya-rao-a Nov 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to move this return statement? With this change, when typing any text in the comments, we would end up calling gocode instead of exiting early

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can you update the existing test case to reflect the bug fix? See https://github.com/Microsoft/vscode-go/blob/0.7.0/test/go.test.ts#L1014

@ramya-rao-a ramya-rao-a merged commit 260b78e into microsoft:master Jan 20, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants