nativescript-vscode-extension icon indicating copy to clipboard operation
nativescript-vscode-extension copied to clipboard

Auto importing doesn't work in VSCode

Open NickIliev opened this issue 6 years ago • 2 comments

From @larssn on September 19, 2018 8:8

Tell us about the problem

So our company just switched to NativeScript from Cordova, and we're used to VSCode being able to auto-import classes etc. that reside in node_modules. However that doesn't seem to work for NativeScript, where it works for everything else.

Which platform(s) does your issue occur on?

Mac/Windows

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.2.3
  • Cross-platform modules: 4.2.0
  • Runtime(s): 4.2.0 & 4.2.0
  • Plugin(s): "nativescript-angular": "^6.1.0", "nativescript-plugin-firebase": "^6.8.1", "nativescript-theme-core": "~1.0.4", "nativescript-ui-listview": "^3.6.1", "nativescript-ui-sidedrawer": "~4.2.0",

Please tell us how to recreate the issue in as much detail as possible.

Just create a new NS angular project. Go into app.component.ts and paste the following constructor.

constructor(
    private modalService: ModalDialogService
  ) { }

Confirm that VSCode can't figure out where ModalDialogService is located ('No suggestions' dialog). Now confirm that you have the module already, by pasting the import import { ModalDialogService } from 'nativescript-angular/directives/dialogs';

Auto imports is a really important feature to us, being new at the framework in general. It greatly speeds up our workflow.

Copied from original issue: NativeScript/NativeScript#6279

NickIliev avatar Sep 19 '18 11:09 NickIliev