-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Vue file. Intellisense shows outdated list of exported members #355
Comments
Thanks for report. This is a known issue. Vue language server, the underlying server that power vetur, implements file change depending solely on editors. We need to change file change via file watching. |
Thank you for your reply. Yes I thought this must have indeed been a known issue. Looking forward to the next versions of vetur (expecially TLint integration).I am very impressed by it. Absolutely great job! |
This issue seems very irritating now. I have to restart the editor very frequently or do hacks like changing I could help implementing a fix, but I would need some general guidance how to do it and where could it fit. This especially includes the general setup of plugin development. Done it before for atom, but vscode seems very different in that aspect. |
Need to think about how to do this, since the suggested file watching approach can be expensive on large projects. |
I tried to look around how is it currently tackled, just out of curiousity. Could you explain a bit how does the plugin manage to respond on *.vue file updates, or maybe how does the typescript language server manages to do the same with all ts/d.ts/js files? |
@Frizi https://github.com/vuejs/vetur/blob/master/server/src/modes/script/serviceHost.ts#L97-L120 And grepping updateCurrentTextDocument will tell you how vetur updates vue file script. For tsserver, you can read the source code in TypeScript's repo. Implementing file watching isn't that hard. But I don't have the confidence to spend that much man effort for it. Indeed, two full time TS core team members spend about several weeks to implement tsserver IIRC. |
Sadly, the watcher API is only for code transpilation. No Language Service is supported 😢 |
I don't want to sound ungrateful, because you clearly have done a tremendous job with this project - thank you for that. However, this issue obviously is the most critical showstopper for anyone considering TypeScript for single-file components, and it's beyond me how this is unadressed for such a long time. Anything but the most trivial applications will run into this problem immediately, and the whole benefit of your great plugin is turned useless by that. I personally have given up SFC solely because of this issue. :( Anyway, I just wanted to leave some feedback to maybe add some more importance to it; please don't take it as bashing, I still marvel at what you have achieved so far. |
@octref Can you give a look at this? I'm really busy with my new day job. Working on weekend doesn't allow me to invest much time on OSS. |
partially fix #355, a crude watcher
I have pushed a crude watcher for this ticket. I don't think is well refined. Let's reopen this issue. |
@HerringtonDarkholme That watcher implementation looks like a fine solution to me for the time being; I've just tested it and it seems to work fine. What makes you think it is not well refined? I agree this is quite ugly, but as long as VS doesn't provide their own Watcher API, it seems to be the only solution. I would be in favor of releasing the Plugin with this fix, this issue has been open for way too long for being this critical. |
I am very very grateful for all your good work, but this needs to be fixed soon. |
You can download preview version here. https://github.com/vuejs/vetur/releases/tag/0.11.8 The preview has a watcher for script update outside of vue file. |
Vetur:0.11.8 Add a crude file watcher. Now Vetur will pick up text change in TS/JS. Note this feature is experimental. Partially fix |
This is still an issue as of 0.12.3. |
I just saw, is it something that is going to be fixed as soon as the new VSCode version comes out or will a fix have to be developed once it does? |
I believe it doesn't have any dependencies on vscode, FileEvents are available today. From my POV that's some ongoing work to centralize and unify some internal things in vetur, which also resolves the current issue. @octref please correct me if I'm wrong :) |
I was wondering because of microsoft/vscode#49327, the "Extension Contributions" part. However I just setup Insiders and it doesn't seem to make a difference. I'm not sure if this means that some new APIs are going to come out that are going to help with this. |
I just tried the latest revision out with the latest version of Insiders, and there seems to be an improvement! However I'm noticing that the linter will only update/refresh if you type in the Is this intended? Other linters update as soon as any referenced file is invalidated. |
@Tenrys do you use TSLint Vue plugin? I believe it should catch all cases. |
Probably @octref better knows the answer. For me it feels like an issue. |
@Tenrys Did you build from source and is running it? I haven't published the change yet. |
Yeah I did, I cloned last revision then followed the instructions from |
@Tenrys Can you try to create a minimal example out of https://github.com/octref/veturpack? Also you need to show how your Vue file looks like. I can't guess all the problems. I need repro cases to debug. |
I'm not sure what I can showcase better using that repository, so here's a visual example of my issue, with the file structure and the code being displayed. I am using the latest Insiders build and the latest revision from this repository, built using the instructions from https://tenrys.pw/ShareX/2018/Jun/fteE.mp4 Hopefully this helps you a bit more than what I sent earlier. |
@Tenrys Thanks for the report. The issue is I'm not retriggering error-checking on Vue files for each update/file change in TS. |
That's fixed too. I'm rerunning error-checking on all opened Vue files when you change JS/TS files. Let me know if this causes any performance problems. |
Great work! Now it does the error checking as soon as I save or change a file. I'll make sure to notify you here if there is any performance issue with this change. |
This change is published to 0.12.4. |
Info
Problem
Sorry if this was already brought up, but I can't seem to find this mentioned in other issues.
In a .vue file, VS Code intellisense fails to retrieve exported members that have been added after the language server has started. third doesn't show up in the list.
From a plain .js file intellisense shows all exported members
Other that obviously closing and reopening VS Code, I found that changing the lang attribute in the script tag does refresh the list of exported members, while closing and reopening the file has no effect.
This happens for both js/ts.
Happy to provide additional details if needed.
The text was updated successfully, but these errors were encountered: