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

Create a vue language service extension for typescript #5763

Closed
lucastheisen opened this issue May 26, 2017 · 4 comments
Closed

Create a vue language service extension for typescript #5763

lucastheisen opened this issue May 26, 2017 · 4 comments

Comments

@lucastheisen
Copy link

What problem does this feature solve?

Provides types for custom components written as SFC (.vue), imported by other files (like unit tests). Right now, you suggest:

declare module '*.vue' {
    import Vue from 'vue'
    export default typeof Vue
}

But that results in every imported SFC component being of type Vue rather than the component type (which extends Vue). It makes it much more difficult (annoying) to test.

What does the proposed API look like?

It would conform to the recently released (ts version 2.3) language server plugin supporty

@lucastheisen
Copy link
Author

Support for .vue files was mentioned in the typescript git repo, but that essentially just said:

I've spoken with Evan (@yyx990803) before. Supporting .vue files would be something that ideally a language service extension would take on (see #10160 for details).

So now, i would like to request that an extension for .vue files gets written.

@ktsn
Copy link
Member

ktsn commented May 26, 2017

There is a language service implementation for vscode by @octref and we currently working for it.
https://github.com/octref/vetur

@yyx990803
Copy link
Member

^ we currently don't have plan to implement it as a standalone project, so if you want some IDE-like experience, you'll need to use VSCode + vetur. Maybe @octref will be able to extract the language service into a standalone project in the future?

@octref
Copy link
Member

octref commented May 27, 2017

Tracked in vuejs/vetur#168 but not going to happen soon, since the language service is undergoing a major rewrite to have better template IntelliSense (previously dealing with each html/css/js regions using multiple language services separately, now combining them together so vetur can provide even more advanced IntelliSense in template, using info from css/js sections).

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

No branches or pull requests

4 participants