You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vue language server uses : to suggest Vue html properties, such as <div :foo="bar">. However, this can cause : to trigger completions in the <script> section, which is not what the user want.
The only way to achieve it today seems to be splitting the server into two servers, which seem to be a huge amount of work.
I don't know if it's possible to provide a way to let embedded language have its own completionTriggers, but one alternative I can think of is to allow server to say "provide no suggestion on client side" in LSP. Currently returning empty array of CompletionItem still trigger word-based completion.
The text was updated successfully, but these errors were encountered:
I don't know if it's possible to provide a way to let embedded language have its own completionTriggers, but
The concept of an embedded language doesn't exist in API-terms. It's always the "outer languages" that is in charge of decision making. So, it should register : as completion character but then it must decide if that occurrence of the character is valid. Even "simple" languages must do this, e.g the . isn't always a valid trigger character for TypeScript et al.
@dbaeumer
Sorry I had an incomplete understanding of word based suggestions. I thought for each completion trigger, when nothing is being returned VS Code would fallback to word-based suggestions. Turned out it's only when completions are triggered by non-symbol characters.
@jrieken
OK. I'll use completion's position to find character to the left of cursor and determine if it's a valid completion trigger in its embedded context.
Context: vuejs/vetur#705
Vue language server uses
:
to suggest Vue html properties, such as<div :foo="bar">
. However, this can cause:
to trigger completions in the<script>
section, which is not what the user want.The only way to achieve it today seems to be splitting the server into two servers, which seem to be a huge amount of work.
I don't know if it's possible to provide a way to let embedded language have its own
completionTriggers
, but one alternative I can think of is to allow server to say "provide no suggestion on client side" in LSP. Currently returning empty array ofCompletionItem
still trigger word-based completion.The text was updated successfully, but these errors were encountered: