Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Log the file scope in debug command #835

Merged
merged 3 commits into from
Mar 5, 2017

Conversation

Arcanemagus
Copy link
Member

@Arcanemagus Arcanemagus commented Mar 3, 2017

Display the scopes of the last cursor in the current file in the debug command so they can be verified against the scopes allowed in the configuration of the package.

Also guards against an invalid TextEditor somehow getting returned from atom.workspace.getActiveTextEditor().

Somehow this function can be called outside of a TextEditor, so guard
against that case.
Clearly show where the path to ESLint starts like the other values.
Display the scopes of the last cursor in the current file in the debug
command so they can be verified against the scopes allowed in the
configuration of the package.
@Arcanemagus
Copy link
Member Author

Example debug output from this modification:

Atom version: 1.15.0-beta4
linter-eslint version: 8.1.2
ESLint version: 3.16.1
Hours since last Atom restart: 0
Platform: win32
Using local project ESLint from: C:\Users\Landon Abney\Documents\GitHub-release\linter-eslint\node_modules\eslint
Current file's scopes: [
  "source.js",
  "string.quoted.template.js",
  "source.js.embedded.source",
  "meta.method-call.js",
  "meta.arguments.js",
  "variable.other.property.js"
]
linter-eslint configuration: {
  "disableWhenNoEslintConfig": false,
  "lintHtmlFiles": false,
  "useGlobalEslint": false,
  "showRuleIdInMessage": true,
  "eslintrcPath": "",
  "globalNodePath": "",
  "advancedLocalNodeModules": "",
  "eslintRulesDir": "",
  "disableEslintIgnore": false,
  "disableFSCache": false,
  "fixOnSave": false,
  "scopes": [
    "source.js",
    "source.jsx",
    "source.js.jsx",
    "source.babel",
    "source.js-semantic"
  ],
  "rulesToSilenceWhileTyping": [],
  "rulesToDisableWhileFixing": []
}

Copy link
Member

@IanVS IanVS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Arcanemagus Arcanemagus merged commit 9bd6aac into master Mar 5, 2017
@Arcanemagus Arcanemagus deleted the arcanemagus/add-current-scope branch March 5, 2017 01:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants