Skip to content

Offer completion on non-imported items. #327

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
kungfusheep opened this issue Aug 19, 2015 · 4 comments
Closed

Offer completion on non-imported items. #327

kungfusheep opened this issue Aug 19, 2015 · 4 comments

Comments

@kungfusheep
Copy link
Contributor

So essentially an 'auto import' feature for classes within modules/namespaces that are accessible in the current context.

This would be a massive time saver. I realize there are multiple ways to do import's now, but the type of import could be inferred from the module type in tsconfig.

Cheers

@DanielRosenwasser
Copy link
Member

Do you mean something like C#'s "add references"? Or do you mean like completion in the following scenario?

import { } from /*cursor here*/

@kungfusheep
Copy link
Contributor Author

Sorry, I could've been more specific.

What I mean is, say I have this class in MyClass.ts

module my_module {
    export class MyClass {}
}

Then in MyOtherClass.ts I can begin writing this line...

module my_other_module {
    export class MyOtherClass{
        public method() : void {
            var myClass = new MyCla /* Now show completions for MyClass - my_module */
        }
    }
}

Upon hitting enter, an import statement (based on the current module type) would be inserted to the top of the module like so...

module my_other_module {
    import MyClass = my_module.MyClass;
    export class MyOtherClass{
        public method() : void {
            var myClass = new MyClass();
        }
    }
}

It seems to me that sublime is all about speed and simplicity. Having to move to the top of the file during authoring breaks your flow, doesn't it, so something like this would be fantastic at helping you keep up the pace.

Thanks!

@DanielRosenwasser
Copy link
Member

Closing in favor of microsoft/TypeScript#4370. Thanks for the suggestion.

@kungfusheep
Copy link
Contributor Author

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants