yongkangchen / atom-ctags

better autocomplete for atom, using ctags
https://atom.io/packages/atom-ctags
MIT License
87 stars 35 forks source link

Uncaught TypeError: Path must be a string. Received undefined #141

Open oryol opened 8 years ago

oryol commented 8 years ago

I opened file (C# code) and just pressed Ctrl+R.

Atom Version: 1.2.4 System: Microsoft Windows 8 Pro Thrown From: atom-ctags package, v4.4.2

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:8

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.win32.join (path.js:221:5)
    at module.exports (file:///C:/Users/oryol_000/.atom/packages/atom-ctags/lib/tag-generator.coffee:38:19)
    at Object.module.exports.generateTags (file:///C:/Users/oryol_000/.atom/packages/atom-ctags/lib/ctags-cache.coffee:87:5)
    at Object.module.exports.getOrCreateTags (file:///C:/Users/oryol_000/.atom/packages/atom-ctags/lib/ctags-cache.coffee:97:6)
    at FileView.module.exports.FileView.populate (file:///C:/Users/oryol_000/.atom/packages/atom-ctags/lib/file-view.coffee:101:17)
    at FileView.module.exports.FileView.toggle (file:///C:/Users/oryol_000/.atom/packages/atom-ctags/lib/file-view.coffee:41:8)
    at atom-text-editor.atom.commands.add.atom-ctags:toggle-file-symbols (file:///C:/Users/oryol_000/.atom/packages/atom-ctags/lib/main.coffee:65:62)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\oryol_000\AppData\Local\atom\app-1.2.4\resources\app.asar\src\command-registry.js:260:29)
    at C:\Users\oryol_000\AppData\Local\atom\app-1.2.4\resources\app.asar\src\command-registry.js:3:61

Commands

     -0:24.3.0 editor:move-to-first-character-of-line (atom-text-editor.editor.is-focused)
  2x -0:24.1.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -0:23.2.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:22.7.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
  3x -0:22.3.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:21.7.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:21 snippets:next-tab-stop (atom-text-editor.editor.is-focused)
     -0:21 snippets:expand (atom-text-editor.editor.is-focused)
     -0:20.9.0 editor:indent (atom-text-editor.editor.is-focused)
     -0:17.2.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:10.5.0 autocomplete-plus:cancel (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:07.6.0 core:move-down (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:07.4.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:07.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
     -0:05.6.0 core:save (atom-text-editor.editor.is-focused)
     -0:04.5.0 atom-ctags:toggle-file-symbols (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ],
    "disabledPackages": [
      "symbols-view"
    ]
  }
}

Installed Packages

# User
.bin, vundefined
atom-ctags, v4.4.2
atom-typescript, v7.14.0
color-picker, v2.0.14
linter, v1.11.3
project-manager, v2.6.5
set-syntax, v0.3.0

# Dev
No dev packages
oryol commented 8 years ago

Fixed by creating project folder which contains file which I have opened. But I think it's better to provide some user friendly message in such case even if it's really required to have a project (honestly, I think it would be better to support single-file mode also).

crucialfelix commented 8 years ago

This is IMO a bug. Any file that is opened in atom but is not in your current project (like editing your own stylesheet) causes all symbols to fail.