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

Recompile current LESS without saving it #1632

Open
RaptorCZ opened this issue Nov 11, 2014 · 10 comments
Open

Recompile current LESS without saving it #1632

RaptorCZ opened this issue Nov 11, 2014 · 10 comments

Comments

@RaptorCZ
Copy link

Hi, is there any way how to force recompile current LESS (opened in editor or selected in solution view) without saving LESS file? Sometimes I need to just recompile whole LESS to apply changes from other imported LESS files (no auto resolve build) but without TFS checkout of current LESS.

All I'm looking for is option "Recompile this". There are "Recompile all" in WE menu, but it is not what I'm looking for.

@am11
Copy link
Contributor

am11 commented Nov 26, 2014

Yeah, I think it was removed long time ago. It should not hurt to bring that option back?

@madskristensen, @SLaks, do we have enough room in WE's solution-explorer context-menu for each compilers entry or should we just provide one option Compile it for all compilable assets (and use MEF to resolve the applicable compiler)?
The best solution would be to rename menu items' values on the fly, but I am not sure if it is possible. Like same item, when right-clicking on .less file should say Compile LESS, for .scss Compile SASS and so on.
This way, we can probably squash Run TSLint, CoffeeLint and JSHint to one menu-item and free up some space. Not sure about Run JSCS option though..

@SLaks
Copy link
Collaborator

SLaks commented Nov 26, 2014

It is possible to rename menu items on the fly, although I've never done it.
I think you can do it either using QueryStatus() in OleConmandTarget or using OleMenuCommandService

@madskristensen
Copy link
Owner

We have the top-level menu item for recompiling all LESS files.

@RaptorCZ
Copy link
Author

But I don't want to recompile all :-) If project is under source control, recompile all forces source control to check-out all css files. And why to do that, if all I want is to change single one?

@robertmclaws
Copy link

I agree with @RaptorCZ and for the exact same reasons. I run into this all the time and it drives me nuts. PLEASE PLEASE PLEASE add a context-menu option for recompiling individual files, no matter what state WE thinks it is in. We need more control over how these files are processed, especially with all of the bugs in the 2.5.x releases.

@bradlis7
Copy link

This would probably be more of a headache, but in my case, detecting all parent less files and compiling them would be great (so if I edit buttons.less in Bootstrap, it compiles bootstrap.less). If that's too much work, then the context menu would be excellent.

@CodeChief
Copy link

Very annoying having to edit master files which should not be changed. I'm looking for a clean solution where the bootstrap source is auto-updated and only the variables are replaced. File time stamps are important and editing old files just to make them compile is a dirty workaround and makes them appear newer than the updated version! Surely it's a trivial task just to re-enable the menu item, or better use the Visual Studio build/custom tool action as other extensions do neatly. Please add either of those features (the second is the best as it supports auto-update).

@SLaks
Copy link
Collaborator

SLaks commented Apr 12, 2015

@CodeChief WE should automatically recompile all files that import any file you save (Auto-compile dependant files on save in options)

@CodeChief
Copy link

Yes I noticed after the first "edit" it does it again. Just a design/usability issue here. It's not at all intuitive to see the context menu with all disabled options and have to edit (save) a master file you don't want to change just to indirectly trigger the tool to do something it should have the option for directly.

By the way the correct method other extensions use is to select the build action or custom tool property to persist a developer's decision as to what should normally be done with one file or another in a project. You answered a similar post here relating to ".weignore" claiming it will not allow the parent item to be build type "none" or "content" but that is wrong because that is exactly what the normal use case is, look at resource files, settings files and many other Visual Studio files types for example. The parent item and auto-generated (project linked items) can have their own build types.

What we have here is more like a custom tool. We are generating code off master files. The custom tool pattern also gives the user the built-in "run custom tool" option for manual override. Saving the file to cause a compilation is just wrong. Even if it's only a one off action and has a workaround, it's the first stepping stone for new users, not a special case, so should be fixed with priority to avoid putting people off.

@robertmclaws
Copy link

The whole point is, I want control over when an individual LESS file is recompiled. Meaning I should be able to trigger a recompilation of an individual file whenever I want. There are certain situations where I am debugging an ASP.NET app, and I change a LESS or TS file, and because the debugger is running, it won't recompile the file, even if I changed it and saved it. That is very irritating. I just want to be able to right-click a LESS file and select "compile", regardless of whether or not it thinks I should/need to.

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

No branches or pull requests

7 participants