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

CompletionProvider / IntelliSense #26

Closed
octref opened this issue Feb 2, 2017 · 13 comments
Closed

CompletionProvider / IntelliSense #26

octref opened this issue Feb 2, 2017 · 13 comments

Comments

@octref
Copy link
Member

octref commented Feb 2, 2017

The current CompletionProvider based VSCode's html extension needs improvement.
This is to write a new CompletionProvider to satisfy the following goals:

  • Scope based IntelliSense:
    Region-based IS is already there (css using css IS, js using js IS). Scope not yet. For example:
    <span v-text="|"></span> here it should suggest all possible values (props, computed props) for the current component.
  • Correct import / export
    • Importing js libs like lodash should add those methods to js region IS.
    • Importing vue files should add component to template, like FooBar.vue -> <foo-bar>.
  • Use SnippetString in CompletionItem to provide Vue API

Things need to look into:

  • Limitations of SnippetString for IS
  • vscode-textmate for getting scope info
  • How to utilize salsa

While doing it, maybe also add a custom Diagnostics that shows error, such as v-if using non-existing prop.

@mickdekkers
Copy link

Will this also allow for ctrl+clicking to go to definition to work? I noticed that this works in .js files but not .vue files (with vetur v0.3.0)

@octref
Copy link
Member Author

octref commented Feb 2, 2017

@SoullessWaffle Not yet. Will do that after this one.

@sebastiandedeyne
Copy link

While doing it, maybe also add a custom Diagnostics that shows error, such as v-if using non-existing prop.

Wouldn't this be impossible since you won't always be able to infer props from external sources like mixins?

@octref
Copy link
Member Author

octref commented Feb 9, 2017

@sebastiandedeyne Good question. That's doable if you find where the mixin is defined, evaluate(or interpret) it, and use that to do the diagnostics.

However, after looking into the problem, I feel that would take much effort for something not many people want. I'll just do IntelliSense first and look into this later.

A similar scenario would be vuex. I'll look into how you can suggest getters and actions when writing this.$store in SFC.

@octref octref added this to the 0.5 milestone Feb 24, 2017
@octref
Copy link
Member Author

octref commented Mar 1, 2017

Suggesting directives:

image

Suggesting nothing, even v- is typed:

image

Will polish it a bit and make a release this weekend.

@octref
Copy link
Member Author

octref commented Mar 6, 2017

An update:

@octref
Copy link
Member Author

octref commented Mar 21, 2017

Thanks to @sandersn's PR #94, module resolution works now.

I'm planning to find a way to get props / data / computed / methods information from the exported component and use it to power IntelliSense (for both html template and js), and release 0.6 around this weekend.

image

image

@colebrusco
Copy link

When version 0.6 will be release? I'm so exciting to use. Congratulations for this extension.

@TonyPythoneer
Copy link

I expect that it will be release. Would you release 0.5.x and let users use the latest feature? 😄

@oswaldofreitas
Copy link

oswaldofreitas commented Apr 16, 2017

What is the current status? Do you have a roadmap?

@octref
Copy link
Member Author

octref commented Apr 17, 2017

Would rather have stable features before publishing. This way it's better for users and I have less bugs to deal with. A list of things coming with 0.6:

  • Improved Completion for this
  • Consolidated formatter options
  • Type-checking is js/ts

@oswaldofreitas
Copy link

what's the expected release date? I'm sure lots of people waiting for this :)

@octref
Copy link
Member Author

octref commented Apr 19, 2017

0.6 is released with module resolution (not working perfectly for import/export Vue SFC, but works great for node modules and loading js/ts files).

Also better IntelliSense:

image

image

Next step is to improve module resolution for Vue files and IntelliSense in template, but I'll track them in other issues.

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

No branches or pull requests

6 participants