Git Product home page Git Product logo

Comments (18)

Ismael-Oliv avatar Ismael-Oliv commented on June 1, 2024 2

I installed it again and it's not working yet

Captura de tela de 2020-07-25 15-56-38

if is there something that I can do to help you, just tell me.

from atom-ide-javascript.

lierdakil avatar lierdakil commented on June 1, 2024 1

Without @types/* packages in scope, TypeScript server should generally recognize require, but only offers sub-directories of node_modules as "bare" import suggestions. If you add ./ to the argument, it switches to local files instead. Generally a good idea to add relevant @types to devDependencies in any case, although I appreciate it can be a bit of a hassle. Also, unless require is defined somewhere in the ambient declaration, tsserver doesn't assume require is even defined, so it doesn't offer it as a suggestion.

There is a caveat however, TypeScript will sometimes cache type definitions in $HOME/.cache/typescript and might use those even if there aren't any installed in the current project. There is very little information on when exactly this happens however, so I couldn't tell you how that works if my life depended on it.

Including/enabling Node definitions by default isn't the greatest idea, because some of us write code for the browser (shocking, I know), and we don't really want to see Node-specific suggestions that won't work.

from atom-ide-javascript.

lierdakil avatar lierdakil commented on June 1, 2024 1

Typing npm i --save-dev --only=dev @types/node once per project isn't that much of a chore I reckon, so I don't see much value in inventing new ways to add some definitions (which aren't even necessarily correct, because who knows what node version does the user intend to use) only for the sake of saving a couple keystrokes.

The "hassle" I was talking about above is tracking down and installing definitions for all the dependencies -- that is a bit of a chore.

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

Does it show any other autocomplete? Something like:

["1"].conc

should suggest concat.

from atom-ide-javascript.

Ismael-Oliv avatar Ismael-Oliv commented on June 1, 2024

yeah, It does

Captura de tela de 2020-07-25 14-18-37

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

@lierdakil Any idea about this? Has anything changed from the TypeScript side?

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

@Ismael-Oliv Please try with v1.2.1 and see if this fixes it.

from atom-ide-javascript.

Ismael-Oliv avatar Ismael-Oliv commented on June 1, 2024

Not yet, but it worked when I installed the express types' => @types/express.

Captura de tela de 2020-07-25 14-58-47

And I think it's because of autocomplete-paths package , its showing so many stuffs .

Captura de tela de 2020-07-25 15-04-01

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

If you type

const fs = require('f

doesn't it offer 'fs'?

It offers all the installed dependencies and Node libraries to me:
image

If you want a specific library you should install it inside package.json, otherwise, it will only show the Node libraries.

from atom-ide-javascript.

Ismael-Oliv avatar Ismael-Oliv commented on June 1, 2024

yeah, But it just shows the "require" options because I had installed the express types of typescript

Captura de tela de 2020-07-25 15-11-13

When I try to import anything without installing any library, it's not showing ...

Captura de tela de 2020-07-25 15-18-48

But I'm gonna remove atom and Install again with all packages. to see if it work

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

OK. Now I understand the problem better. When you do not have any library installed, it does not show it. Although I cannot reproduce it, I will take a closer look.
image

I do not think reinstalling Atom helps much. If you install atom-ide-javascript only, it will install all the deps automatically.

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

I can confirm that sometimes the autocomplete is not fast/intelligent enough here. It might be because of the TypeScript server. @lierdakil and I will take a look into this.

image

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

Try installing @types/node for now, which you should always do when writing Node programs, until we see if we can reproduce this.

from atom-ide-javascript.

Ismael-Oliv avatar Ismael-Oliv commented on June 1, 2024

Alright, no problem. 👍

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

I think I should add an option for automatic Nodejs completions. Maybe it works on my system out of the box because I have @types/node installed globally.

from atom-ide-javascript.

Ismael-Oliv avatar Ismael-Oliv commented on June 1, 2024

Alright, I'm gonna try it ...

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

I have a suggestion. We can add a command and a Tool-bar button to add Nodejs support by using that. People who need Node should click or run that command first, or should install the @types

from atom-ide-javascript.

aminya avatar aminya commented on June 1, 2024

I am planning to add a npm IDE which adds GUI and clickable buttons for running various operations. I think we can address installing the types in that package!

from atom-ide-javascript.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.