angelozerr / typescript.java

TypeScript IDE for Eclipse with JSDT & tsserver
https://github.com/Microsoft/TypeScript
MIT License
92 stars 15 forks source link

code completion for js? #228

Open nimo23 opened 6 years ago

nimo23 commented 6 years ago

Could typescript.java provide also code completion for js-files (if /typings is installed for that module). Actually it only works if js file is renamed to jsx or ts. So code completion also works for jsx (without renaming to tsx), but it does not work for js-files. I cannot rename all other js files but want to have code completion when using es6-module.

nimo23 commented 6 years ago

no need for this. I can use Tern.java.

angelozerr commented 6 years ago

Could typescript.java provide also code completion for js-files

Yes it should work. If it doesn't work, it's perhaps your project has JSDT nature. If I rememeber you must activate that with TypeScript preferences (from global / window preferences)

nimo23 commented 6 years ago

code completion only works if I rename my js-file to a ts-file.

For js-files, I have no code completion.

I have this settings:

My .tern-config:

{
  "plugins": {
    "guess-types": {

    },
    "outline": {

    },
    "webpack": {

    },
    "es_modules": {

    },
    "node": {

    },
    "gulp": {

    },
    "browser-extension": {

    },
    "angular": {

    }
  },
  "libs": [
    "ecma5",
    "ecma6",
    "browser"
  ]
}

My "ts.eclipse.ide.core.prefs" from within .settings-directory:

eclipse.preferences.version=1
nodeJSPath=/usr/local/bin/node
useNodeJSEmbedded=false
typeScriptBuildPath={"src/js/tsconfig.json"\:{}}

When editing a js-file, I have no code completion for any kind:

How can I force to have code completion with js-files the same as I have with ts-files?