Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quick option to turn on/off debugging rules for easier debugging in dev tools #60

Closed
timkindberg opened this issue Feb 12, 2013 · 12 comments
Labels

Comments

@timkindberg
Copy link

I'd like an easy way to enable the dumpLineNumbers feature which will allow me to more easily debug my compiled css using Chrome (or other dev tools). See the Debugging sub-section in the Usage section. http://lesscss.org/#usage

I think this could be implemented similar to the minify checkbox column.

@szilveszterandras
Copy link

I'd love to see this feature. By the way, is there any hard option to do this? Some config file maybe?

@timkindberg
Copy link
Author

I looked all morning and tried editing the less.js that ships with WinLess. I tried adding less.env = "development" and less.dumpLineNumbers = "all" to various locations and still nothing happens. I opened the C# project and saw that it uses lessc cmd line app to compile the less. I'm not sure how to tell lessc to dumpLineNumbers...

@timkindberg
Copy link
Author

Oh actually I just stumbled onto it. There is a flag --line-numbers that lessc accepts. Someone would have to add the option in to the C#, because I've never worked with C# before. I think on line 91 in LessCompiler.cs we'd have to add a condition block similar to the minify block that adds the --line-numbers flag. That's all I got!

@marklagendijk
Copy link
Owner

At the moment WinLess doesn't let you use all the options which lessc actually offers. The main reason for this is the interface: how can I add those features in such a way that the interface doesn't become bloated?

When we run lessc.cmd -h we get:

usage: lessc [option option=parameter ...] <source> [destination]

If source is set to `-' (dash or hyphen-minus), input is read from stdin.

options:
  -h, --help              Print help (this message) and exit.
  --include-path          Set include paths. Separated by `:'. Use `;' on Windows.
  --no-color              Disable colorized output.
  -s, --silent            Suppress output of error messages.
  --strict-imports        Force evaluation of imports.
  --verbose               Be verbose.
  -v, --version           Print version number and exit.
  -x, --compress          Compress output by removing some whitespaces.
  --yui-compress          Compress output using ycssmin
  -O0, -O1, -O2           Set the parser's optimization level. The lower the number, the less nodes it will create in the tree. This could matter for debugging, or if you want to access the individual nodes in the tree.
  --line-numbers=TYPE     Outputs filename and line numbers. TYPE can be either 'comments', which will output the debug info within comments, 'mediaquery' that will output the information within a fake media query which is compatible with the SASS format, and 'all' which will do both.
  -rp, --rootpath         Set rootpath for url rewriting in relative imports and urls. Works with or withour the relative-urls option.
  -ru, --relative-urls    re-write relative urls to the base less file.

Of above options the following options are the options which might be useful, but are currently ignored by WinLess:

  --include-path          Set include paths. Separated by `:'. Use `;' on Windows.
  --line-numbers=TYPE     Outputs filename and line numbers. TYPE can be either 'comments', which will output the debug info within comments, 'mediaquery' that will output the information within a fake media query which is compatible with the SASS format, and 'all' which will do both.
  -rp, --rootpath         Set rootpath for url rewriting in relative imports and urls. Works with or withour the relative-urls option.
  -ru, --relative-urls    re-write relative urls to the base less file.

My thoughts about these:

include-path does anyone know what this does exactly? What is it useful for?
line-numbers: useful for debugging purposes, should be added to WinLess.
rootpath and relative-urls: very important features of LESS, shoud be added to WinLess.

The question remains: how should I add these to WinLess without making the interface to bloated? I don't think adding 4 columns to the filelist is a good idea. Should WinLess get a third pane where you can define all options for the file which you have currently selected: folder list - file list - file details?
If so, what columns should remain in the file list?

@szilveszterandras
Copy link

Hey, for me even adding these options in compiler settings works. My main concern is being able to use debug info because, although wide support for less debugging isn't available yet it will is an amazing improvement in CSS preprocessing. Honestly, I don't think ease of use of the tool is that much of a concern. Any way works for me at least :)

@timkindberg
Copy link
Author

include-path lets you pass in multiple paths to be compiled into a single css output. See this stack overflow question. This could definitely be interesting. Right now in Winless every checked less file compiles to its own css file. So with this option WinLess could allow marking multiple files to be combined into a single css (similar to using @import, but its set manually during compile time).

I'm with @szilveszterandras for the most part. What I'd love most is just the debugging, but I see how adding all of these features could be nice too. I'm personally not opposed to 4 new columns if that would provide me a quicker and easier to glance at view of my compile settings. So I wouldn't rule it out. I like your idea about a new pane though too. Honestly WinLess is a set it and forget it kind of thing, you pretty much set it up at the beginning of a project and just keep it running in the bg, so you may want to go for quickest easiest implementation.

@smajl
Copy link

smajl commented Mar 5, 2013

@marklagendijk Just bumped into problem of using debug line number in FireLess extension while compiling in WinLess. It would be great if you just add a basic support in the beginning for this option. Let's say a new checkbox in File->Settings which will enable global env: "development" and dumpLineNumbers: "all" (e.g.). Should be easy and quick to implement, you will make developers happy and then we can discuss a way to display more detailed settings for less compiler in your great app. :)

@KingYes
Copy link

KingYes commented Mar 28, 2013

👍
Anyone know what happen now for less debug?

@gnomishperson
Copy link

👍 Would love to see this added.

@PayteR
Copy link

PayteR commented Jun 15, 2013

Nothing new about this? It should be really simple to add this feature, for example there can be some button in that list for every *.less file and developer can insert here any of custom options of these, what do you say?

@joffff
Copy link

joffff commented Jul 28, 2013

+1 Even if there was a config file that could be edited to enable this it would be a vast improvement over what we have now.

@marklagendijk
Copy link
Owner

Closing all issues.
WinLess 1.x is now in maintenance mode. This means that at this time no feature requests will be accepted. Bug reports are still welcome, but all current issues are closed to make sure that the open issues are only about current bugs.

WinLess 2.x is a rewrite of WinLess using node-webkit. The development of WinLess 2.0 can be followed here. Most of the work is done, however, since my priorities have shifted it is now not clear whether it will ever be finished. Feature requests will only be accepted after the 2.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants