Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Show LESS errors in console #8736

Merged
merged 2 commits into from
Oct 13, 2014
Merged

Show LESS errors in console #8736

merged 2 commits into from
Oct 13, 2014

Conversation

jasonsanjose
Copy link
Member

For @larz0 to help debug LESS errors, e.g.

/Users/jasonsj/Library/Application%20Support/Brackets/extensions/user/extension/styles/override.less:322 variable @bc-border-radius is undefined 

try {
result.resolve(tree.toCSS());
} catch (toCSSError) {
console.error(toCSSError.filename + ":" + toCSSError.line + " " + toCSSError.message);
Copy link
Member

Choose a reason for hiding this comment

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

@jasonsanjose On master, I assume the uncaught exception falls through to the top of the stack, causing dev tools to log a stack trace plus the value of toCSSError.toString(). Does the toString() not include this info already? Or were you not even seeing the exception getting logged at all for some reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, uncaught exception without a useful toString():

image

@redmunds
Copy link
Contributor

@jasonsanjose What types of LESS errors should I expect to see?

I tried inserting an undefined var at the beginning of brackets.less which break Brackets styles, but I don't see any error in chrome console. I'm also not seeing info messages that I'm seeing in master such as:

less: css for file:///C:/Users/redmunds/dev/github/brackets-shell/Release/dev/src/styles/brackets.less generated in 578ms (less-1.7.0.min.js:13)
less: less has finished. css generated in 579ms (less-1.7.0.min.js:13)

@jasonsanjose
Copy link
Member Author

@redmunds try modifying LESS for an extension that loads a .less file at runtime.

@redmunds
Copy link
Contributor

OK, I am getting info messages with valid syntax. Looks good. Merging.

redmunds added a commit that referenced this pull request Oct 13, 2014
@redmunds redmunds merged commit 92e5452 into master Oct 13, 2014
@redmunds redmunds deleted the jasonsanjose/less-toCSS-errors branch October 13, 2014 22:50
peterflynn added a commit that referenced this pull request Oct 15, 2014
…o the

console (not just the output stage). Also covers cases where the file
doesn't exist, for both CSS & LESS.
@peterflynn
Copy link
Member

@jasonsanjose I ran across a case where this still didn't emit any warnings. Posted PR #9557 to make this cover more cases. Want to review it?

@peterflynn
Copy link
Member

(One example case is an extra stray { in the LESS code)

peterflynn added a commit that referenced this pull request Dec 5, 2014
…o the

console (not just the output stage). Also covers cases where the file
doesn't exist, for both CSS & LESS.
peterflynn added a commit that referenced this pull request Dec 8, 2014
…-file-system

* upstream/master: (113 commits)
  Don't keep focus on mouse clicks on tabs.
  Refinement of PR #8736: also log LESS errors from the parsing stage to the console (not just the output stage). Also covers cases where the file doesn't exist, for both CSS & LESS.
  fix documentation issues
  fix documentation issues
  convert status styles/tooltips array to object
  remove unused modules
  update Copyright year to 2014
  fix JSHint issue
  update name in transport package.json
  During rename in the tree, allow only default behavior.
  Fix bug #9966 ([CEF 2171] JSLint doesn't work) - Switch to a private fork of JSLint with the bug fix cherry-picked in so we're not stuck upgrading to a much newer JSLint which has the fix but is significantly stricter / less configurable.
  fix params passed to internal funcs
  Ensure that the baseDir for createNewItem is within the project.
  Further improvde readability by grouping the first part of the expression together.
  Improve readability of fix.
  Fixes the exception thrown when the provider list for a given language is empty/undefined.
  remove errant whitespace from previous commit
  add methods to align it with LiveDevelopment API
  remove array from event arguments
  Clone the providers array returned for a given path to prevent outside modification.
  ...

Conflicts:
	src/LiveDevelopment/main.js
	src/document/DocumentCommandHandlers.js
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants