How can I edit in indented SASS but commit in SCSS? - visual-studio-code

I'm a fan of the clean, Pythonesque feel of indented SASS, but I recognize that it's better for my team to use SCSS since it's an extension of CSS, and there's more support for SCSS in docs and forums. So how might I view and edit files as SASS but commit them as SCSS?
Checkout .scss files from a repo
Open them in an editor and see indented SASS
Make changes in indented SASS
Commit changes as .scss
I expect that it's possible since, as one of the developers who helped create Sass wrote,
The difference is syntax. Underneath the textual exterior they are identical. This is why sass and scss files can import each other. Actually, Sass has four syntax parsers: scss, sass, CSS, and less. All of these convert a different syntax into an Abstract Syntax Tree which is further processed into CSS output or even onto one of the other formats via the sass-convert tool.
Use the syntax you like the best, both are fully supported and you can change between them later if you change your mind.
I'm using VSCode, and I've looked through dozens of extensions and linters, but I haven't found any that appear to offer this feature. Reasons why this is a bad idea are welcome if they're in good faith or good fun.

Related

Use doxygen to ^create^ README.md?

Many people document applications in the source files themselves, e.g. https://github.com/docopt/docopt.cpp . In the spirit of DRY (don't repeat yourself), I would like source documentation to appear in my README.md on GitHub (auto-generated from the source.) I see many user-community questions about including README.md in output documentation, but nothing about going the other way, src documentation -> README.md. doxygen seems like the tool that should own this space, but has no output formatters for markdown files.
Does it make sense to anybody else to create an output formatter for markdown?
Apparently it does make sense, and has been proposed before, as well as some bolt-on solutions developed: https://github.com/doxygen/doxygen/issues/6760

How do TextMate grammars and themes work with VSCode?

VSCode is built on top of MonacoEditor which doesn't support Textmate grammars and themes. But somehow VSCode made it possible. I am curious how VSCode is able to do this.
I am asking because I am making a code editor (based on Monaco) with TextMate grammar and theme support. But I am unable to understand how I can achieve it.
Though there are packages like monaco-textmate to make TextMate grammars work with Monaco, syntax highlighting is still not working properly.
TextMate grammars depend on a particular regex implementation / library called Oniguruma, which is implemented in C. Monaco however is designed to run in the browser, and the JavaScript regex engine available there is not compatible with Oniguruma. All of this is explained in detail in the "Why doesn't the editor support TextMate grammars?" section of Monaco's FAQ. It also mentions the possibiliy of perhaps eventually compiling Oniguruma to WebAssembly to work around this.
VSCode itself uses vscode-textmate for its TMLanguage handling, which has the Oniguruma library as a native dependency. VSCode can have native dependencies because it doesn't run in a browser environment.
According to monaco-textmate's readme, it is actually heavily based on vscode-textmate:
99% of the code in this repository is extracted straight from vscode-textmate
And it does use the WASM approach mentioned earlier:
monaco-textmate relies on onigasm package to provide oniguruma regex engine in browsers. onigasm itself relies on WebAssembly.
As to why syntax highlighting doesn't always work as expected with monaco-textmate... I have no idea, I expect this is simply a bug in the implementation. Perhaps wait for a response from the maintainer, the issue you linked is fairly new.
At least conceptually there shouldn't be a reason why it couldn't achieve the same syntax highlighting VSCode does, since it uses the same regex flavour.

Reformat code style with another code style when using GitHub

Context : I'm working in a large project (more than 20 developpers) and we just set a "default" code style we should always apply before commit our files. The whole actual project is already updated with the "default" code style so we won't have thousand of lines that appear "modified" when we only update 2 lines of code and reformat code.
Everyone is using his own code style and when they forget to reformat code before pushing, it messes up everything.
Question : is it possible to automatically reformat code with a different code style (other than actual one) when one saves or commits or pushes files ?
We are using Android Studio and GitHub. Thanks.
No, this is not possible as of Android Studio 1.1.
Generally speaking, everyone using their own code style is not a sustainable approach for a project. Consider that Google, a company where the number of developers is three orders of magniture larger, somehow manages to agree on a single code style for all of their projects.
It's a terrible idea, since automatic style formatters always mess up, purging even intentional style violations done for extra readability. It's incredibly hard to design a formal style definition that encompasses all cases.
So it's best to agree on a single style and use it throughout the project.
Well, if you're still certain and you've found a command-line utility able to reformat code to your liking, you can hang it onto the Git's (not Github's) pre-commit hook, so that it's run for every commit attempt.

Is there an auto complete in Sublime Text 2 when integrating it with SASS?

I've noticed that it does auto completes CSS properties and values, but not the case with SCSS.
Check out the sass-textmate-bundle port for ST2. According to the readme,
This add-on adds syntax highlighting and tab/code completion for Sass and SCSS files. It features Zen Coding shortcuts for many CSS properties, making you look like some kind of stylesheet wizard to everyone around you. You've got to like that.
You might also want to take a look at SublimeCodeIntel. While not specifically for SASS/SCSS, it features context-sensitive autocomplete based on what you've already typed in the file, so it may be useful on top of what ST2 already provides.
Both of these are available through Package Control.

How can I make Emacs org docs more beautiful in github repository?

github supports several markup languages, one of which is Emacs org mode docs.
But it always look ugly with the default CSS file(much better than
the default one in built-in org mode, though.
Also it seems that the
source code block does not have syntax highlight either.
So is it possible to make it more beautiful with some minor changes in org files? Or can you give me some advice or good practice?
Github uses org-ruby to convert org-mode to html. It appears that recent versions of org-ruby support both lower case org-mode keywords and syntax highlighting in the source code blocks (among other nice things). Until it is upgraded in the official Github, it looks like the only options are either to use upper case BEGIN_SRC/END_SRC or export your org files to html/md in emacs with any options/css/etc you like and post the resulting files on Github.
Githubs Org-Mode support is upgraded but #+TITLE: is unsupported, like links that are mostly bugged. So it works mostly.