Skip to content

Exclude packages from intellisense #54135

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

Closed
thany opened this issue May 4, 2023 · 6 comments
Closed

Exclude packages from intellisense #54135

thany opened this issue May 4, 2023 · 6 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@thany
Copy link

thany commented May 4, 2023

I'd like to excludes packages (whether from @types or not) from intellisense.

Use-case: in a Next.js project, you'll have typings for Node.js. And then even when you're not in server context, but instead are writing typescript meant to run in the browser, typing log will yield:

image

That's annoying, and you'd almost never want that one anyway. Not even when writing serverside code.

I've tried fiddling with tsconfig to no avail, looking around in editor.suggestions settings, but there's only options for reordering. I would like a way to exclude stuff there.

In this particular case, I would like to exclude the console package, or maybe just all Node.js related packages.

Current workaround is to use the setting "editor.snippetSuggestions": "top".
This achieves the goal of being able to go l o g Enter and end up writing a console.log( );

But it's only a workaround, because the offending package is still there, and this problem might very well occur for other suggestions. I guess the bottomline is, I don't want suggestions for Node.js packages when writing browser code.

@mjbvz mjbvz transferred this issue from microsoft/vscode May 4, 2023
@mjbvz mjbvz removed their assignment May 4, 2023
@RyanCavanaugh
Copy link
Member

This is supported, see #49578

@RyanCavanaugh RyanCavanaugh added the Question An issue which isn't directly actionable in code label May 4, 2023
@typescript-bot
Copy link
Collaborator

This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow or the TypeScript Discord community.

@thany
Copy link
Author

thany commented May 8, 2023

In that case it doesn't seem to be working:

"typescript.preferences.autoImportFileExcludePatterns": [
    "console"
]

Even when expanding to all apparent possible ways to find it:

"typescript.preferences.autoImportFileExcludePatterns": [
    "console",
    "**/console",
    "/**/console",
    "*/**/console",
    "/*/**/console"
]

So let's not be too sure about this issue being a question, before it actually works 😊

@RyanCavanaugh
Copy link
Member

Please file bug report using the template if you believe you have a bug. Thanks!

@thany
Copy link
Author

thany commented May 10, 2023

I'm not going to create another issue if a perfectly good one already exists.

If this can't be a feature request, then consider it a bug report. If you need more information, do ask.

@RyanCavanaugh
Copy link
Member

To expedite the triage process, we need everyone to follow the issue template and instructions.

When you clicked "Create New Issue", the issue form was pre-populated with a template and some instructions. We need you to read those instructions completely, follow them, and then fill in all the fields in that template.

We are not able to assist with issues that don't follow the template instructions as they represent a significantly larger amount of work compared to issues which are correctly specified. Thank you for understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

4 participants