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

Fix object property completion when have hyphen #1808

Merged
merged 3 commits into from
Jul 31, 2020

Conversation

yoyo930021
Copy link
Member

Fixed #1804

@yoyo930021 yoyo930021 changed the title Fix object property completion when hyphen Fix object property completion when have hyphen Mar 26, 2020
@littlee

This comment has been minimized.

@octref
Copy link
Member

octref commented Jul 31, 2020

I have a simpler fix. The ranking is not preserved but that's a VS Code issue: microsoft/vscode#103682

return {
uri: doc.uri,
position,
preselect: entry.isRecommended ? true : undefined,
Copy link
Member

Choose a reason for hiding this comment

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

I'll split this into another commit...Let one PR do one thing, don't include unrelated changes, or it becomes harder to review. Thanks!

const { label, detail } = calculateLabelAndDetailTextForPathImport(entry);
const kind = toCompletionItemKind(entry.kind);
const insertTextFormat =
kind === CompletionItemKind.Function || kind === CompletionItemKind.Method
Copy link
Member

Choose a reason for hiding this comment

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

In VS Code this is behind typescript.suggest.completeFunctionCalls which defaults to false. I don't think we should turn this on by default.

kind === CompletionItemKind.Function || kind === CompletionItemKind.Method
? InsertTextFormat.Snippet
: undefined;
const insertText = entry.insertText || entry.name;
Copy link
Member

Choose a reason for hiding this comment

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

No need to do this. If entry.insertText is undefined just pass it in.

@yoyo930021
Copy link
Member Author

yoyo930021 commented Jul 31, 2020

@octref I forget why write this code.
I just remember I reference this code in vscode.

I found that it has changed a lot.
I need to tidy up.

@yoyo930021 yoyo930021 marked this pull request as draft July 31, 2020 09:10
@octref
Copy link
Member

octref commented Jul 31, 2020

I think it's ok to merge now. The typescript-language-features extension will always be changing. No worries.

@octref octref marked this pull request as ready for review July 31, 2020 09:19
@octref octref merged commit 047f7fb into vuejs:master Jul 31, 2020
octref added a commit that referenced this pull request Jul 31, 2020
octref added a commit that referenced this pull request Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Object property with quotes will not show in auto complete hints
3 participants