ternjs / tern_for_sublime

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

Unknown error when typing argument #147

Open max-mykhailenko opened 7 years ago

max-mykhailenko commented 7 years ago

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
marijnh commented 7 years ago

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

max-mykhailenko commented 7 years ago

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

brownsugar commented 4 years ago

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

othree commented 4 years ago

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

brownsugar commented 4 years ago

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

othree commented 4 years ago

@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?

brownsugar commented 4 years ago

@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.

othree commented 4 years ago

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 notifications@github.com於 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

brownsugar commented 4 years ago

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