Skip to content
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

code completion for js? #228

Open
nimo23 opened this issue Dec 16, 2017 · 3 comments
Open

code completion for js? #228

nimo23 opened this issue Dec 16, 2017 · 3 comments

Comments

@nimo23
Copy link

nimo23 commented Dec 16, 2017

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
Copy link
Author

nimo23 commented Dec 19, 2017

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

@nimo23 nimo23 closed this as completed Dec 19, 2017
@angelozerr
Copy link
Owner

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 nimo23 reopened this Dec 21, 2017
@nimo23
Copy link
Author

nimo23 commented Dec 21, 2017

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:

  • Preferences->..->Typescript->"Use Salsa as JavaScript Inference" (enabled)
  • Typescript.java 1.4
  • JBoss Tools Java Standard Tools provides an adapter to Tern.java project. version 3.8
  • enabled tern-repository (Preferences->..->Tern->Development->Repository): EcmaScript 6, es_modules, Browser, Browser_extension, Gulp, Node.js, Outline, Webpack
  • Eclipse Oxygen.1a Release (4.7.1a)

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:

  • No default Proposals
  • No template Proposals
  • No basic Proposals
  • No tern completion Proposals
  • No typescript Proposals

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

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

No branches or pull requests

2 participants