Skip to content

Use node require for auto imports? #20292

Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#38773

Repo

Using the same project as #19629:

// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
// @ts-check

var vscode = require('vscode');

RelativePat|

Accept the completion for RelativePattern from vscode

Expected
Respects existing module style and adds require:

// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
// @ts-check

var vscode = require('vscode');
var { RelativePattern } = require('vscode');

RelativePattern

Actual
import inserted before everything else in the document:

import { RelativePattern } from 'vscode';

// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
// @ts-check

var vscode = require('vscode');

RelativePattern

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions