tern_for_sublime icon indicating copy to clipboard operation
tern_for_sublime copied to clipboard

Unknown error when typing argument

Open max-mykhailenko opened this issue 9 years ago • 9 comments

Tern settings

{
  "tern_argument_hints": true,
  "tern_output_style": "tooltip",
  "tern_argument_completion": true,
  "tern_arguments": ["--no-port-file"],
  "tern_command": ["tern"]
}

.tern-project

{
  "ecmaVersion": 7,
  "libs": [],
  "dontLoad": [
    "node_modules"
  ],
  "plugins": {
    "complete_strings": {},
    "node": {},
    "modules": {},
    "jsx": {},
    "es_modules": {},
    "doc_comment": {
      "fullDocs": true
    }
  }
}
screen shot 2016-11-10 at 9 41 53 am

max-mykhailenko avatar Nov 10 '16 07:11 max-mykhailenko

Can you reproduce this without the jsx plugin? If so, can you give me a source file that triggers it?

marijnh avatar Nov 10 '16 08:11 marijnh

I can't now reproduce it, but it appears regularly. I'll send you a file when get this bug again.

max-mykhailenko avatar Nov 21 '16 07:11 max-mykhailenko

I can reproduce with ST4, when typing a space at the end of the string or line(in script area of .vue file), it continuously popup the empty message. image

~~And this might be the error log:~~

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 893, in on_query_completions
    norm_res(callback(v, prefix, locations))
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 129, in profiler
    return event_handler(*args)
  File "/Users/brownsugar/Library/Application Support/Sublime Text 3/Packages/tern_for_sublime/tern.py", line 68, in on_query_completions
    pathFirstCh = pathPrefix[0]
IndexError: string index out of range

I use Package Resource Viewer to debug, and I found the exception was came from https://github.com/ternjs/tern_for_sublime/blob/master/tern.py#L381 image

brownsugar avatar Jun 02 '20 02:06 brownsugar

Can you find any .tern-port file in the project?

othree avatar Jun 02 '20 06:06 othree

@othree No, there is no config file for Tern in the project.

brownsugar avatar Jun 02 '20 06:06 brownsugar

@brownsugar Can you provide a sample code and steps to reproduce(including configs you added). And AFAIK latest official release of Sublime Text is version 3. How do you use ST4?

othree avatar Jun 04 '20 09:06 othree

@othree The only config I have is:

{
  "tern_argument_hints": true,
}

I think is not about the code, it happens randomly, I tested by same code in two files, one happened and the other not. You can download ST4 from ST official Discord server.

brownsugar avatar Jun 04 '20 09:06 brownsugar

I believe it’s crashed or don’t have any request then it stopped itself. If it is crashed we have to find out why.

Lay [email protected]於 2020年6月4日 週四,下午5:44寫道:

@othree https://github.com/othree The only config I have is:

{ "tern_argument_hints": true, }

I think is not about the code, it happens randomly, I tested by same code in two files, one happened and the other not. You can download ST4 from ST official Discord server.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ternjs/tern_for_sublime/issues/147#issuecomment-638742259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEAWSXQTOOKLMW55QDSXDRU5UI7ANCNFSM4CVZPC3A .

-- OOO

othree avatar Jun 04 '20 10:06 othree

@othree OK, I'll reply if there are more info I can provide.

brownsugar avatar Jun 04 '20 11:06 brownsugar