Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Uncaught TypeError: Cannot read property 'removeTrailingWhitespace' of undefined #94

Closed
santanajames opened this issue Jun 18, 2016 · 2 comments · Fixed by #106
Closed
Assignees

Comments

@santanajames
Copy link

[Enter steps to reproduce below:]

  1. Open command palette in Atom editor
  2. use command 'EditorConfig: Generate Config' to generate config file.

Atom Version: 1.8.0
System: Mac OS X 10.11.5
Thrown From: editorconfig package, v1.4.1

Stack Trace

Uncaught TypeError: Cannot read property 'removeTrailingWhitespace' of undefined

At /Users/santanajames/.atom/packages/editorconfig/commands/generate.js:40

TypeError: Cannot read property 'removeTrailingWhitespace' of undefined
    at atom-workspace.init (/Users/santanajames/.atom/packages/editorconfig/commands/generate.js:40:45)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:183:32)
    at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
    at space-pen-div.atom.commands.add.core:confirm (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

 11x -1:26.7.0 core:move-up (atom-text-editor.editor.is-focused)
     -1:21.7.0 core:move-down (atom-text-editor.editor.is-focused)
  2x -1:21.4.0 core:move-up (atom-text-editor.editor.is-focused)
     -1:19.1.0 core:save (atom-text-editor.editor.is-focused)
     -1:10.7.0 snippets:expand (atom-text-editor.editor.is-focused)
     -1:10.7.0 emmet:expand-abbreviation-with-tab (atom-text-editor.editor.is-focused)
     -1:09.2.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:58.6.0 core:copy (div.package-readme.native-key-bindings)
     -0:40.4.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  2x -0:37.4.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:35.1.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:35.1.0 EditorConfig:generate-config (atom-text-editor.editor)
     -0:12 tree-view:remove (span.name.icon.icon-file-text)
     -0:07.7.0 command-palette:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:00.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:00.9.0 EditorConfig:generate-config (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)

Config

{
  "core": {
    "disabledPackages": [
      "whitespace",
      "atom-ternjs",
      "timecop",
      "markdown-preview",
      "autoflow",
      "wrap-guide",
      "welcome",
      "spell-check",
      "open-on-github",
      "metrics",
      "exception-reporting"
    ],
    "packagesWithKeymapsDisabled": [
      "activate-power-mode"
    ],
    "projectHome": "/Users/santanajames/Projects/",
    "themes": [
      "atom-light-ui",
      "lumens-syntax"
    ]
  }
}

Installed Packages

# User
atom-alignment, v0.12.1
atom-beautify, v0.29.8
atom-cli-diff, v1.3.0
atom-typescript, v8.11.0
autocomplete-plus, v2.31.0
change-case, v0.6.0
color-picker, v2.1.1
editorconfig, v1.4.1
emmet, v2.4.3
emmet-snippets-compatibility, v1.0.6
file-icons, v1.7.14
javascript-snippets, v1.2.1
language-apache, v1.5.0
linter, v1.11.10
lumens-syntax, v0.1.0
merge-conflicts, v1.4.4
pigments, v0.29.2
tree-ignore, v0.6.2

# Dev
No dev packages
@florianb
Copy link
Collaborator

Thank you for reporting! I am a week on vacation, i will take a deeper look as soon as I am back. 😉

@florianb
Copy link
Collaborator

Beautiful @santanajames - thank you very much for reporting! 🍬

This issue happens because your whitespace-package is disabled, which is something we don't check. I will try to apply a patch as soon as possible.

@florianb florianb self-assigned this Jun 30, 2016
@florianb florianb added this to the Fievel Mousekewitz milestone Oct 17, 2016
florianb pushed a commit that referenced this issue Oct 20, 2016
This is the final reorder of the PRs around the next minor release fulfilling containing the following changes:

* Clicking in the statusbar-icon displays a notification, showing the currently applied config and helpful tips if something seems misconfigured (fixes #89)
* Added clickable statusbar-icon to reflect the state of atom-editorconfig for the currently displayed TextBuffer
* Editing `.editorconfig`-files from within Atom now reapplies the settings to all open editors (fixes #85)
* The `trim_trailing_whitespace`-property is now implemented (fixes #3)
* The `insert_final_newline`-property is now implemented (fixes #4)
* The `generate`-command now uses `config.get()` to fetch the defaults for `trim_trailing_whitespace` and `insert_final_newline` (fixes #94)
* The `tab_width`-property now falls back to `indent_size` if missing (fixes #91)

This PR takes the PRs #104 & #102 over.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants