question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CompletionProvider / IntelliSense

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:21
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

18reactions
octrefcommented, Mar 6, 2017

An update:

  • v-* directives and slot, key, and ref IntelliSense are now supported. Upgrade to 0.5.0 to try it out.
  • Correct import / export is not done yet, but should involve just tweaking TypeScript’s compiler options https://github.com/octref/vetur/blob/master/server/src/modes/javascriptMode.ts#L18. I probably won’t have time until next weekend, so I’m pushing out 0.5.0 with directives IntelliSense first.
  • Next version of TS adds a feature called contextual this, which will be very useful for providing correct IntelliSense and even type check for vue component. @sandersn from TS team is working on a plugin to provide better IntelliSense for vue (see #75), and I’ll work with him to bring it to vetur.
14reactions
octrefcommented, Mar 21, 2017

Thanks to @sandersn’s PR https://github.com/octref/vetur/pull/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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a CompletionProvider to provide additional ...
CompletionProviders are IDE extensions that provide completion items in the intellisense list when user is editing code in the Visual Studio IDE:
Read more >
Writing a Visual Studio Code Completion Provider - Blog
An overview of writing VSCode completion providers (intellisense) as an extension developer.
Read more >
CompletionProvider Intellisense in extension working only for ...
I have added registerCompletionItemProvider with the triggerCharacters as ':' it works but when i change the triggerCharacters to dot '.' the ...
Read more >
ICompletionSourceProvider Interface - Microsoft Learn
Intellisense. Assembly: Microsoft.VisualStudio.Language.Intellisense.dll. Important ... Creates a completion provider for the given context.
Read more >
Roslyn Cookbook by Manish Vasani - O'Reilly
Creating a CompletionProvider to provide additional intellisense items while editing code. CompletionProviders are IDE extensions that provide completion ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found