Skip to content

atom-typescript installed but no autocomplete, no format code, only get the typescript status bar #549

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
samuelneff opened this issue Aug 30, 2015 · 25 comments

Comments

@samuelneff
Copy link

I installed atom-typescript and when I open a TS file I do get the TypeScript status bar on the bottom that says "Error In Open Files" and "Last Build Output" and such.

I don't get any autocomplete though. Nothing pops up at all as I type. Nothing pops up when I hover over variables, go to declaration doesn't work, pretty much nothing works except for the status bar.

The status bar does update as I type (mostly just "Js emit is outdated" and "Js emit is up to date").

Initially I did not have any tsconfig.json file. I added one to the root with mostly default options and an exclude for node modules. I still had the problem so I replaced the tsconfig.json with empty options, {}. Still same issue.

What can I look into to resolve what's going on? Seems like it must be something wrong with my setup (I just installed Atom today, was using WebStorm previously).

Thanks,

Sam

atom-typescript\package.json snippet (too long to post full file)

{
  "name": "atom-typescript",
  "version": "6.0.0",
  "main": "./dist/main/atomts",
  "bin": {
    "atbuild": "./dist/main/bin/atbuild"
  },
  "preferGlobal": "true",
  "description": "The only TypeScript plugin you will ever need.",
  "engines": {
    "atom": ">=0.199.0 <2.0.0",
    "node": "*"
  },
  "providedServices": {
    "autocomplete.provider": {
      "versions": {
        "2.0.0": "provide"
      }
    },
    "linter": {
      "versions": {
        "1.0.0": "provideLinter"
      }
    }
  },
  "consumedServices": {
    "snippets": {
      "versions": {
        "0.1.0": "consumeSnippets"
      }
    }
  },
  ...
  "dependencies": {
    "atom-package-dependencies": "https://github.com/basarat/atom-package-dependencies/archive/cb2.tar.gz",
    "atom-space-pen-views": "^2.0.4",
    "babel": "^5.6.23",
    "basarat-text-buffer": "6.0.0",
    "d3": "^3.5.5",
    "emissary": "^1.3.3",
    "escape-html": "^1.0.1",
    "fuzzaldrin": "^2.1.0",
    "glob-expand": "0.0.2",
    "htmltojsx": "0.2.4",
    "immutable": "^3.7.3",
    "json2dts": "0.0.1",
    "mkdirp": "^0.5.0",
    "ntypescript": "1.201508230720.1",
    "react": "^0.13.3",
    "season": "^5.1.4",
    "strip-bom": "^2.0.0"
  },
  ...
}
@basarat
Copy link
Member

basarat commented Aug 31, 2015

I don't get any autocomplete though. Nothing pops up at all as I type.

Did you get the message : AtomTS: Dependencies installed correctly. Enjoy TypeScript ♥

Ref : https://github.com/TypeStrong/atom-typescript#installation 🌹

@ggrumbley
Copy link

I am having the exact same issue. I installed the typescript package in the manner described on the README but I still have no autocomplete or hover functionality. I did not see the AtomTS: Dependencies installed correctly. Enjoy TypeScript ♥ message displayed.

@eliorcohen
Copy link

I had the same issue. it's seems to be related to permissions.
the only way i get it to work successfully was to start the atom from the project folder with "sudo" command.

sudo atom ./

and the autocomplete started to work as expected.
using the open project from the menu seems to cause some problems.

@laurelnaiad
Copy link

Wow, I just realized how much better atom-typescript is when you launch atom with sudo!

Would be nice not to have to do this, though.

@hitchcockwill
Copy link

I'm experiencing this issue as well. I tried installing atom-typescript through the UI then removed it and tried installing through CLI. The CLI install resulted in: Installing atom-typescript to /Users/willhitchcock/.atom/packages ✓ but not the AtomTS: Dependencies installed correctly. Enjoy TypeScript ♥ readout mentioned above. I also tried opening atom with sudo atom ./, no luck there.

@basarat
Copy link
Member

basarat commented Dec 11, 2015

Anyone have any stack trace (open dev tools https://github.com/TypeStrong/atom-typescript/blob/master/CONTRIBUTING.md#workflow) 🌹

@hitchcockwill
Copy link

Just installed the development version and rebooted. I'm getting a few errors in the console:

Error: Project file contains invalid options
    at Object.getProjectSync (/Users/willhitchcock/Projects/Development/atom-typescript/dist/main/tsconfig/tsconfig.js:260)
    at getOrCreateProjectFile (/Users/willhitchcock/Projects/Development/atom-typescript/dist/main/lang/projectCache.js:74)
    at Object.getOrCreateProject (/Users/willhitchcock/Projects/Development/atom-typescript/dist/main/lang/projectCache.js:141)
    at Object.getCompletionsAtPosition (/Users/willhitchcock/Projects/Development/atom-typescript/dist/main/lang/projectService.js:104)
    at Child.RequesterResponder.processRequest (/Users/willhitchcock/Projects/Development/atom-typescript/dist/worker/lib/workerLib.js:49)
    at process.<anonymous> (/Users/willhitchcock/Projects/Development/atom-typescript/dist/worker/lib/workerLib.js:227)
    at emitTwo (events.js:87)
    at process.emit (events.js:172)
    at handleMessage (internal/child_process.js:685)
    at Pipe.channel.onread (internal/child_process.js:440)

and

Uncaught (in promise)

{
  "method": "getOutputJsStatus",
  "message": "Project file contains invalid options",
  "stack": "Error: Project file contains invalid options\n    at Object.getProjectSync (/Users/willhitchcock/Projects/Development/atom-typescript/dist/main/tsconfig/tsconfig.js:260:32)\n    at getOrCreateProjectFile (/Users/willhitchcock/Projects/Development/atom-typescript/dist/main/lang/projectCache.js:74:36)\n    at Object.getOrCreateProject (/Users/willhitchcock/Projects/Development/atom-typescript/dist/main/lang/projectCache.js:141:27)\n    at Object.getOutputJsStatus (/Users/willhitchcock/Projects/Development/atom-typescript/dist/main/lang/projectService.js:602:34)\n    at Child.RequesterResponder.processRequest (/Users/willhitchcock/Projects/Development/atom-typescript/dist/worker/lib/workerLib.js:49:60)\n    at process.<anonymous> (/Users/willhitchcock/Projects/Development/atom-typescript/dist/worker/lib/workerLib.js:227:23)\n    at emitTwo (events.js:87:13)\n    at process.emit (events.js:172:7)\n    at handleMessage (internal/child_process.js:685:10)\n    at Pipe.channel.onread (internal/child_process.js:440:11)",
  "details": {
    "projectFilePath": "/Users/willhitchcock/Projects/Development/proeditors-CustomerUI/tsconfig.json",
    "errorMessage": "Unknown Option: compileOnSave"
  }
}

I'm seeing this second error message several times with different methods:
getCompletionsAtPosition getProjectFileDetails editText

@basarat
Copy link
Member

basarat commented Dec 13, 2015

I'm seeing this second error message several times with different methods:

@hitchcockwill sorry for the late reply. That is by design. We are just erroring out on invalid projects. We show a message for this as well :

image

That if you click would guide you to the fix. Basically you have something like :

{
    "compilerOptions": {
        "compileOnSave": false,
        "target": "es5",
        "module": "commonjs",
        "declaration": false,
        "noImplicitAny": false,
        "removeComments": true,
        "noLib": false
    },

When you should have :

{
    "compileOnSave": false,
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "declaration": false,
        "noImplicitAny": false,
        "removeComments": true,
        "noLib": false
    },

@hitchcockwill docs : https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#options. So that fixes your error 🌹

Anybody else got a stacktrace with a valid error ? : rose: If not I will close this.

@hitchcockwill
Copy link

After making that change in the tsconfig file I started getting autocomplete suggestions as expected in my .ts files. They are pretty slow, but they do work.

@basarat
Copy link
Member

basarat commented Dec 14, 2015

@hitchcockwill check that the tsconfig is not touching all files. See FAQ https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md#for-really-large-projects-atom-typescript-gets-slow for details 🌹

We should probably be easily able to figure out the intent and understand that its a folder exclusion ourselves at some point 🌹

@hitchcockwill
Copy link

Thanks @basarat I was having some other issues with the plugin and just discovered that I needed to configure my tsconfig. I've got it set up correctly now and everything seems to be working at lot better.

@basarat
Copy link
Member

basarat commented Dec 15, 2015

Cool. Since no one else has reported back, closing this 🌹

@canda
Copy link

canda commented May 30, 2016

There was no error displayed on atom until I opened the tsconfig.json
Wouldn't it be nice if we show a message to know why the autocomplete isn't working?

@gurumohanreddy
Copy link

For atom-typescript and any new typescript project in general, for things like autocomplete to work correctly, you must have a tsconfig.json file. atom-typescript has a command to generate you a file, when you're editing a .ts file.

Press Ctrl+Shift+P and type create file and click on the first result from typescript

@jasoninrapid
Copy link

For anyone that stumbles across this on a Google search and is looking for a solution on Windows 7, just give it time. When I installed and started working on an existing project it took a couple of minutes for Atom to process through a number of items in the status at the bottom. Once it finally got done with those then my autocomplete and related features started working.

@AskYous
Copy link

AskYous commented Aug 20, 2016

I pressed this button and it started working:

image

@jasonmorita
Copy link

Make sure you have a tsconfig.json either in the root of your project or in the directory in which you are working.

@7stud
Copy link

7stud commented Jan 14, 2017

I've got a tsconfig.json file in the root of my project directory:

 ~/a2_angular_projects/angular2-get-started

and this is it:

~/a2_angular2_projects/angular2-get-started$ cat tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true
  }
}

I'm trying to edit files in the directory:

~/a2_angular_projects/angular2-get-started/app

First, in the TypeScript area at the bottom of the editor, I see the message:

-tsconfig.json   X JS Outdated 

Sometimes it goes away, and then it just comes back (when I open another file?). Saving the file does not get rid of the message.

Second, the autocomplete does not work as shown in the demo. When I type out the same example shown:

 var foo = 123;
 var bar = foo.toString();

I don't see anything popping up (as in zero). If I type:

 var bar = foo.

and wait, then after at least 3 seconds and sometimes as long as 7 seconds, an autocomplete menu displays.

When I assign the wrong type to bar:

bar = 456;

I get no error. I save the file--still no error. Five minutes later, I get an error. Then after I delete that line, I still get the error. I actually have to type something on the line that I deleted in order to make the error go away (is that really the way it's supposed to work).

If I hover over something, sometimes I don't see the type(even after waiting for five seconds), and other times I see the type immediately.

Also, I cannot find a Recent Files list under the File menu, which would enable me to quickly open a project I worked on previously. Is that feature really missing?

Macbook Pro
OSX 10.10.5
atom 1.13.0x64

@amhuhn2
Copy link

amhuhn2 commented Mar 10, 2017

I wasn't getting any autocomplete at all. In the status bar, I clicked on "TypeScript", and it brought up a list of all languages supported....I noticed that there were two Typescript in the list. I clicked on the other one (the one that was not currently selected), and voila! Suddenly I started to get autocomplete functionality.

@DrCo
Copy link

DrCo commented Mar 20, 2017

Changing this atom-typescript tsconfig.json worked for me.
Under packages -> atom-typescript -> lib -> tsconfig.json

{

"compileOnSave": true,

"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"jsx": "react",
"lib": ["es6", "dom"],
"module": "commonjs",
"noLib": false,
"outDir": "../dist",
"preserveConstEnums": true,
"reactNamespace": "dom",
"skipLibCheck": true,
"sourceMap": false,
"strict": true,
"target": "es6"
},
}

The "compileOnSave" line should be moved to the top and comma separated, similar to basarat's 2015 fix

@vedk21
Copy link

vedk21 commented Jun 23, 2017

if anyone still facing this issue please check whether you have installed package angular-2. By disabling or uninstalling this may solve your problem.
cheers.

@peturh
Copy link

peturh commented Aug 30, 2017

@amhuhn2 solutions worked for me!

First in bottem right corner:

image

Then search for TypeScript and choose the one that isn't selected.

image

Works!

@hardy1334
Copy link

I was also facing the similar kind of problem,but I resolved this problem by Installing "TYPESCRIPT PACKAGES" in the atom text editor, this problem is resolved but it's not highlighting the mistakes in the editor itself. It's displays errors in the terminal.

screenshot from 2017-12-03 22-29-33

@akkovachev
Copy link

@amhuhn2 That was the problem for me as well thank you so much it works like a charm now! :)

@danieldogeanu
Copy link

Guys, install ide-typescript package in Atom. It will solve all of your problems! The package is made by the guys at Atom, and is still in beta, but it works like a charm.

PS: Just so you know, the current version of Atom uses language-typescript and not atom-typescript. I don't think language-typescript is supposed to have any of those features anyway.

@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests