I only want to use VSCode as a syntax highlighter. I don't want any linting, annotations, error handling, or anything besides for syntax highlighting, for any languages. I've been looking all over but I can't find a setting for this.
Related
Is it just that linting is a type/subset of debugging? Like, linting will analyze static code syntax but debugging uses a variety of techniques to fix code in a variety of ways? Or is it more complicated than that?
Linting can prevent debugging by catching bugs before you manually run your program. It will run the code and check for errors. Debugging is something you manually do after a bug is found.
I've configured stylelint to read SCSS and I keep getting browser hack warnings on SCSS items like $variables and !default. I loaded in the stylelint-scss plugin thinking this might fix it but it hasn't. I want the browser hacks rule to be enabled for true browser hacks but I'll have to turn this off if it fails on all of the SCSS items.
Does anyone know how I can keep the browser hack rule enabled but not have it fail on non-browser hacks like the standard variables for SCSS?
The no-browser-hacks rule is not compatible with SCSS syntax. This is documented in the rule's README.
I can think of three options available to you:
Continue to use SCSS and turn off the no-browser-hacks rule.
Continue to use SCSS and contribute SCSS compatibility to stylehacks (the underlying library that powers the rule). The author of the library is happy to accept a Pull Request for this.
Discontinue using SCSS in favour of using standard CSS syntax and constructs.
Adding the stylelint-scss plugin will not resolve the issue as it provides additional rules specific to SCSS syntax and constructs. It does not change stylelint's core rules.
I want to add support for syntax highlighting for lex and yacc-files in Visual Studio 2010.
How can I do this?
Following the given link to Syntax Coloring leads to another, more pertinent page Implementing Syntax Coloring, where it is noted
Visual Studio does not specify a parser interface, and parser implementation is completely up to you. However, a default parser implementation is provided in the Visual Studio Language Package project. For managed code, the managed package framework (MPF) provides complete support for colorizing text.
Depending on what you want:
trivial, coloring only the C code portions of the lex/yacc files
much harder, coloring the patterns so that one can make sense of them
you could in principle make a parser using just lex (yacc isn't necessary). For yacc files, that's not so hard, but for lex there's the complication of regular expressions. vi-like-emacs does that and while the interface differs in detail, conceptually it's similar. Reading the lexers might give you some ideas how to apply that approach:
lex syntax filter
yacc syntax filter
There is documentation from Microsoft on integrating yacc/bison & flex/lex with Visual Studio. Although a URL only link is discouraged on SO, its best to go to the source for this kind of detailed information:
https://msdn.microsoft.com/en-us/library/aa730877(VS.80).aspx#vccustombr_topic3
It lays out all the steps necessary for integrating with the build tools. Syntax highlighting is covered elsewhere as described in Add a new language to Visual Studio 2010 with syntax highlighting and intellisense. In particular the guidance for syntax colouring can be found here: https://msdn.microsoft.com/en-us/library/bb166778(v=vs.100).aspx.
However, I'm not aware of anyone who has published extra colouring rules for the grammar specific components of flex and yacc. However, most of the body of flex and yacc files are written in C or C++ for which there are syntax highlighting rules that can be applied, and suit most peoples needs.
Is there anywhere in Internet such compilation of "universal" example source codes - in different programming languages - for checking if code's syntax highlighting in IDE/editor works good?
Source code samples, which uses every available language's keywords and statements to check if syntax highlighting works well.
It should look like Octopress "Syntax Highlighting Test" test page. But there, in few examples, the language syntax isn't fully utilized, to show full potential to user.
I'm now building a developers editor using Lazarus and as every good developers editor, it needs to have a syntax highlighting, because of this that I want to know some things:
How is syntax highlight normally built(using many ifs to change the font on a TextField?
TSynEdit is very nice to do this?
How to use TSynEdit(links and resources)?
You can actually see an excellent example for yourself if you look at the editor for SharpDevelop. It's implemented in C# but uses great OOP that should be readily portable to other platforms or languages.
Most home-brewed syntax highlighters tend to use the MS Windows RichText control but they're usually slow and clunky and really slow down when a lot of code is added.
You could read the source code of Eclipse or VIM. In Eclipse you will find an Abstract Syntax Tree base. On top of it are parsers that are carefully written to be tolerant of errors, since code in progress often does not satisfy the full grammar of the language. The highlighting uses the information in the syntax tree.