ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

Package import autocompletion causes duplicate quotes #171

Closed TheReturningVoid closed 4 years ago

TheReturningVoid commented 6 years ago

Using any autocompletion of a node module installed with npm causes the quotes used to be duplicated.

Example: GIF recording of issue

This also occurs for imports of the form const React = require('react').

easyfrog commented 6 years ago

Yes, same issue: image

simonhaenisch commented 6 years ago

anyone working on this?

davae1an commented 6 years ago

Can confirm this issue also

codeHamster9 commented 6 years ago

yeap i'm in on this too...any solution in sight ?

it appears that adding '@' before the path works around the problem not sure if this is by design.

just do '@/my-path-to/glory/starts/here' :octocat:

simonhaenisch commented 6 years ago

My current solution was switching to VS Code for the better eco system. It has built-in code analyzing/intelligence for Typescript which can be enabled for Javascript as well with

{
  "javascript.implicitProjectConfig.checkJs": true
}

I still use ST for its speed though and would often prefer it, but too many plugin devs switched to Code and many plugins are not maintained properly anymore. And Code definitely has its benefits 🤓

philipbordallo commented 6 years ago

A quick fix for this is to remove any ' by adding .replace("'", "") to the end of https://github.com/ternjs/tern_for_sublime/blob/91a27a39b1b0a33a9043aa685e1ee48c64a58274/tern.py#L438

berkandirim commented 5 years ago

A quick fix for this is to remove any ' by adding .replace("'", "") to the end of

tern_for_sublime/tern.py

Line 438 in 91a27a3

rec_name = rec.get('name').replace('$', '\$')

This only removes the single quotes but still adding the extra '../' It should be replacing what you typed in quotes completely.

ViggoV commented 4 years ago

Any news on this issue? It is incredibly annoying..