bcomnes / sublime-standard-format

:sparkles: Runs standard --fix against the javascript in your ST3 window on save or manually.
https://packagecontrol.io/packages/StandardFormat
MIT License
60 stars 21 forks source link

KeyError: 'jsx' #91

Open crapthings opened 1 year ago

crapthings commented 1 year ago
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1703, in run_
    return self.run(edit)
  File "/Users/monsterstep/Library/Application Support/Sublime Text/Installed Packages/StandardFormat.sublime-package/standard-format.py", line 347, in run
KeyError: 'jsx'

what is wrong?

i've tried add this to config, but error is missing, still doesn'f format the file

https://github.com/bcomnes/sublime-standard-format/issues/47#issuecomment-381756724

{
  "format_on_save": false,
  // Arbitrary $PATH additions.
  "PATH": [],
  // walk the file system looking for node_modules/.bin to prepend to PATH
  "use_view_path": true,
  // fall back to project paths when a view path isn't available
  // e.g. with an unsaved view buffer, open in a project view
  "use_project_path_fallback": true,
  // Search the global user ENV $PATH for commands.  Actually uses your
  // real ENV variables!
  "use_global_path": true,

  // array of file extensions to format on save  e.g. file.js
  "extensions": ["js", "jsx"],

  // An array of scopes for individual file extensions.
  // If a selector for an extension exists, StandardFormat will pass
  // the scope's content (rather than the whole file)
  // to whatever commands you specify.
  "selectors": {
      "html": "source.js.embedded.html",
      "vue": "source.js.embedded.html",
      "jsx": "source.js.jsx"
  },

  // Array of command and flags to run against.
  // Content will be piped into this command
  // This is a string array that is passed to subprocess
  // The first command found in the search PATH is the one
  // that gets used.
  "commands": [
      ["standard", "--stdin", "--fix"],
      ["semistandard", "--stdin", "--fix"],
      ["ts-standard", "--stdin", "--fix", "--stdin-filename", "{FILENAME}"]
  ],

  // log error output
  "log_errors": true,

  //
  // ADVANCED
  //

  // You probably don't need to mess with these.

  // Try to report the version of the command found
  "check_version": false,
  // Enable status logging on view change.
  "logging_on_view_change": false,

  // Pop up error window on formatting errors
  "loud_error": true,

  // Calculate user path from a shell.
  "calculate_user_path": true,

  // path calculation command
  "get_path_command": ["/usr/bin/env", "bash", "-l", "-i", "-c", "echo $PATH"],
}
OpenGL Context Information:
  GL API Version: 4.1 Metal - 83.1
  GLSL Version: 4.10
  Vendor: Apple
  Renderer: Apple M1 Max
first paint time: 0.420652
environment variables loaded using: /bin/zsh -l
reloading python 3.3 plugin 0_package_control_loader.00-package_control
reloading plugin Default.arithmetic
reloading python 3.3 plugin 0_package_control_loader.01-sublime_lib
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading python 3.3 plugin 0_package_control_loader.10-lsp_utils
reloading python 3.3 plugin 0_package_control_loader.50-backrefs
reloading python 3.3 plugin 0_package_control_loader.50-bracex
reloading python 3.3 plugin 0_package_control_loader.50-pathlib
reloading python 3.3 plugin 0_package_control_loader.50-pyyaml
reloading python 3.3 plugin 0_package_control_loader.55-mdpopups
reloading python 3.3 plugin 0_package_control_loader.55-wcmatch
reloading plugin Default.colors
reloading python 3.3 plugin ayu.activation
reloading python 3.3 plugin ayu.Icons
reloading python 3.3 plugin LSP-typescript.commands
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.html_print
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.keymap
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin A File Icon.plugin
reloading plugin Emmet.main
reloading plugin StandardFormat.standard-format
reloading python 3.3 plugin LSP-typescript.plugin
reloading python 3.3 plugin LSP-typescript.plugin_types
reloading python 3.3 plugin LSP.boot
reloading python 3.3 plugin Package Control.1_reloader
reloading python 3.3 plugin Package Control.2_bootstrap
reloading python 3.3 plugin Package Control.Package Control
reloading python 3.3 plugin SideBarEnhancements.SideBar
reloading python 3.3 plugin SideBarEnhancements.SideBarAPI
reloading python 3.3 plugin SideBarEnhancements.SideBarDefaultDisable
plugins loaded
StandardFormat:
  global_path: /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/libxml2/bin:/Users/monsterstep/.nvm/versions/node/v16.15.1/bin:/Users/monsterstep/.cargo/bin
  search_path: /Users/monsterstep/dev/trendintek/node_modules/.bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/libxml2/bin:/Users/monsterstep/.nvm/versions/node/v16.15.1/bin:/Users/monsterstep/.cargo/bin
  root_path: None
  found standard at /Users/monsterstep/dev/trendintek/node_modules/.bin/standard
  command: ['standard', '--stdin', '--fix']
Package Control: Skipping automatic upgrade, last run at 2023-05-24 14:56:18, next run at 2023-05-24 15:56:18 or after
reloading settings Packages/User/StandardFormat.sublime-settings
reloading settings Packages/User/StandardFormat.sublime-settings
bcomnes commented 1 year ago

Thanks, I'll take a look ASAP.