-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
[HELP] Re-order suggestions/auto-imports #220
Comments
Try setting globalLibCompletions.action to remove And yes I always had an idea of prioritising relative imports, not sure if it was implemented |
@zardoy Yeah it worked by removing it, but still no suggestions in Quick Fix. I think this should be fixed on TS side. But then the question is maybe it is possible to re-sort them and make sure that suggestions from |
yes, it's possible via patchSuggestins setting |
@zardoy Would you mind showing me how, packages are named |
Maybe @Ilanaya you know how to do it correctly? |
@svipas I saw your issue, can't help rn. I'll be able to work on this and help you only on this weekend. |
@Ilanaya thank you very much, great news! |
@svipas This will prioritize react-native's "tsEssentialPlugins.replaceSuggestions": [
{
"suggestion": "Text",
"filter": {
"languageMode": "TSX",
"kind": "class"
},
"patch": {
"sortText": "!"
},
},
{
"suggestion": "Text",
"filter": {
"languageMode": "JSX",
"kind": "class"
},
"patch": {
"sortText": "!"
},
},
] I'll see what I can do with quick fixes, but can you clarify this comment in the meantime? I'm not sure if I get the issue here - if you are using Maybe I missing something related to this part of the comment?
|
@Ilanaya wow thank you very much, I will try those things. Another question do you know how I can sort out
So basically if I have a file I want it to take priority and if I type Is that somehow possible? Or maybe at least prioritize project local imports like the one example with I hope you understood what I meant, thank you for helping me! |
Yes it's easily possible, i think you can even achieve it by configuring the setting above so you prioritise any import which import completion which path starts with ./ or ../ . On the other hand I should implement it myself so aliases configured in tsconfig also take the same effect. Btw i think it's worth highlighting aliased import suggestions in the completions list just like we do with lib.dom completions |
@Ilanaya problem was not only with |
@zardoy Still it takes out imports from other packages first I used this: "tsEssentialPlugins.replaceSuggestions": [
{
"suggestion": "./",
"patch": {
"sortText": "!"
},
},
{
"suggestion": "../",
"patch": {
"sortText": "!"
},
},
], |
I see that I can re-order suggestions/auto-imports. How I can do that if it comes locally (from the project) always first, then if it's from
expo
orreact-native
, and, lastly all other suggestions, if of course somehow this is possible or at least make thatexpo
andreact-native
suggestions comes as a first one.Another thing is that I have a issue: microsoft/TypeScript#33511 (comment). TS isn't smart in this case and suggests me
Text
fromlib/lib.dom.d.ts
even thoughText
exists in the React Native and I don't care about built-inText
. How I can fix that I see it as a first in suggestions instead of thatlib/lib.dom.d.ts
Text
? Or maybe even exclude it. And, maybe it would help me to fix quick fix action so it suggests to import?Would really appreciate your help ❤️
The text was updated successfully, but these errors were encountered: