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

no property autocomplete in JSX(related with an empty space) #40941

Closed
tiye opened this issue Dec 29, 2017 · 3 comments · Fixed by #43349
Closed

no property autocomplete in JSX(related with an empty space) #40941

tiye opened this issue Dec 29, 2017 · 3 comments · Fixed by #43349
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug plan-item VS Code - planned item for upcoming suggest IntelliSense, Auto Complete verified Verification succeeded
Milestone

Comments

@tiye
Copy link

tiye commented Dec 29, 2017

  • VSCode Version: Version 1.19.1 (1.19.1) 0759f77

  • OS Version: macOS, 10.12.6

Steps to Reproduce:

TypeScript React, and https://twitter.com/jiyinyiyong/status/946642303950626817

Reproduces without extensions: Yes.

@vscodebot vscodebot bot added the javascript JavaScript support issues label Dec 29, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Jan 2, 2018

@jrieken For the case:

const z = <div c>

where the user has just typed c, LineContext.shouldAutoTrigger returns false since getWordAtPosition returns null. This in turn is caused by <div c> having the following language ranges for the string <div c>:

<div c>
xxxxxTx

where x = jsx-tags and T = javascriptreact. These language ranges cause getWordAtPosition to take > as the current word, which does not match against the known word patterns

@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Jan 2, 2018
@jrieken jrieken added suggest IntelliSense, Auto Complete and removed javascript JavaScript support issues labels Jan 3, 2018
@kevinmlong
Copy link

Any update on this? The Ctrl-Space works and provides the correct autocomplete options for props with associated type. Would be nice if I didn't have to do that each time.

@gopeter
Copy link

gopeter commented Feb 8, 2018

@kevinmlong Have the same problem, but wonder about: "... autocomplete options for props ...". Is VS Code capable to autocomplete my custom propTypes from an imported component?

mjbvz added a commit that referenced this issue Feb 9, 2018
Fixes #40941

**Bug**
Suggestions not auto triggered when you `x` in `const z = <div x>`. See #40941 (comment) for explaination of root cause

**Proposed fix**
In the case where suggestions are triggered at the boundary between two languages, I believe we should trigger. This change adds special logic to handle that case by making sure we check the word at the  previous character position instead of at the current character positon when at language boundaries
mjbvz added a commit that referenced this issue Mar 16, 2018
Fixes #40941

**Bug**
Suggestions not auto triggered when you `x` in `const z = <div x>`. See #40941 (comment) for explaination of root cause

**Proposed fix**
In the case where suggestions are triggered at the boundary between two languages, I believe we should trigger. This change adds special logic to handle that case by making sure we check the word at the  previous character position instead of at the current character positon when at language boundaries
@mjbvz mjbvz added this to the March 2018 milestone Mar 16, 2018
@mjbvz mjbvz added the plan-item VS Code - planned item for upcoming label Mar 16, 2018
alexdima added a commit that referenced this issue Mar 20, 2018
Fix #40941 - Suggest trigger at language boundaries
@jrieken jrieken added the verified Verification succeeded label Mar 28, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug plan-item VS Code - planned item for upcoming suggest IntelliSense, Auto Complete verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants