-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Autocomplete Pollution #932
Comments
Do you know if there is an option to disable import completion for a specific library in VS Code? Does |
Yeah |
My current work around is to isolate all Valibot related code in their own modules, which is not really ideal. I have schemas in their own files, and re-export things like |
I don't have the "change |
Do you have any idea what we could do to improve this? Without a VS Code extension, we as a library probably have no control over the behaviour of the editor. |
I'm unsure. Some ideas:
|
Thanks for your feedback! I don't have time to work on this issue right now, but I'll keep it in mind. Feel free to contact the TS language server team on GitHub and ask if this is the source of the problem. Feel free to link to this issue or tag me. |
Note that VS Code gives these completions in value context but not in type context: const a = string // suggests v.string
const b: string // suggests string I don’t see anything wrong with this behavior? It’s true that |
It cause specifically "typing lowercase |
|
In VS Code, when you type
string
, VS Code autocomplete suggestsimport { string } from 'valibot'
which is undesirable. This can be turned off by using^valibot$
pattern intypescript.preferences.autoImportSpecifierExcludeRegexes
.However, if you have Valibot imported like so:
When you type
string
, VS Code autocomplete suggests "changestring
tov.string
" which is also undesirable.This not only happens to
string
, but alsoobject
,date
,void
,undefined
,RegExp
(due tov.regex
),await
(due tov.awaitAsync
),return
(due tov.returns
) etc. This makes typing code likeDate.now()
viadate[tab to autocomplete to Date].now()
unusable as tab autocompletes tov.date
instead, and also makes using your own snippets for keywords unusable (for example I haveret
snippet which expands toreturn $0
).The text was updated successfully, but these errors were encountered: