syntax-highlighting

Highlighting #defined value in VIM

China☆狼群 提交于 2019-12-13 03:56:19
问题 I have XYZ highlighted in the header file where I have defined XYZ. However at the point of where it is used, XYZ is not highlighted. How would I fix this ? I have attached two screen shots (see TH_SYN in the code) to clarify my question- link text Any pointers are welcome. 回答1: I have done a very crude way of doing this for Java constants (static finals), based on the fact that all constants, are all caps with underbars. Almost no other identifiers match that criteria. So a very simple, and

Jekyll incorrect syntax highlighting

谁都会走 提交于 2019-12-13 03:39:13
问题 I want to have correct syntax highlighting for a small snippet of C code. I'm currently using the following tags: {% highlight c %} ... code snippet ... {% endhighlight %} When I serve my page locally using "jekyll serve" everything works as expected. However, when I do a git push and view the page on the web the results of the syntax highlighting are incorrect. A number of the lines incorrectly appear as comments. If I inspect the source locally, I see the following: <code class="language-c"

multiple syntax highlighting in sublimetext 3 with .sublime-syntax file type

允我心安 提交于 2019-12-13 03:20:05
问题 I'm using zk framework and I need to do a sublime-syntax file that highlights in XML syntax, but in the zscript snippet uses java syntax highlighting and in style context uses CSS syntax. This is an example of zk code: <zk> <style> .myClass{ width=300px; } </style> <div id="panel1" class="myClass" visible="true" > <hlayout width="100px"> <image id="icon1" src="/Desktop/image1.png" width="32px"></image> <image id="icon2" src="/Desktop/image1.png" width="50px"></image> </hlayout> </div>

Map input to ast types in boost spirit

不羁的心 提交于 2019-12-13 02:40:09
问题 I want to implement color highlighting of input string that is being fed to given spirit grammar. Is there an easy (or any, if not easy) way to map given character from input into rule/ast type that it matches? Preferable in form of array/vector of rule/ast types where index is index of character of input string. Or maybe better - iterator rages to ast types. 回答1: Of course there is. Several answers on this site demonstrate similar things. You'll have to decide how you want to treat subrules.

Plug-in Development: Creating Problem Marker for a Given Resource

霸气de小男生 提交于 2019-12-13 02:03:30
问题 I seem to be having a problem with associating a problem marker with a resource; in my case, I'm trying to create a problem marker for the editor. To achieve this, I've tried to do the following: public class MyEditor extends TextEditor{ private ColorManager colorManager; public MyEditor() { super(); ... IResource resource = (IResource) getEditorInput().getAdapter(IResource.class); try { marker = resource.createMarker(IMarker.PROBLEM); } catch (CoreException e) { e.printStackTrace(); } }

How do you display your php source code with highlight or view source?

梦想的初衷 提交于 2019-12-13 01:50:47
问题 How do you display your php source code with highlight or view source or is there more alternatives to this? 回答1: PHP has two native functions that might be of interest: highlight_file() and highlight_string(). If neither of those are ideal, you could also use Google Code Prettify to achieve this result. This is the solution many use, including StackOverflow itself. Alternatives: SyntaxHighlighter SHJS jQuery Chili Lighter for MooTools GeSHi 回答2: You can use the php highlight_file function to

Coda syntax highlighting for Silverstripe

拥有回忆 提交于 2019-12-12 18:04:44
问题 I've just moved onto a new machine. On my old work horse, I had Silverstripe template (.ss) files following HTML syntax highlighting in Coda. I can't for the life of me remember how I turned this on (I remember it was something I did myself though). Google has turned up no results. Any suggestions? 回答1: UPDATE: The real way In Coda, open Preferences, go to Editor, at the bottom, add a Custom Syntax Mode. As per this guide: Right click on Coda.app in /Applications and select Show Package

How to force emacs recolor

安稳与你 提交于 2019-12-12 11:05:29
问题 Every once and a while Emacs fails at syntax highlighting and the coloring gets all funky in a buffer. Is there any way to force Emacs to "recolor" the syntax? Just try over? I don't mind if it takes a moment. 回答1: I think M-x font-lock-fontify-buffer will do what you are looking for. Or select a region and do M-o M-o (or M-x font-lock-fontify-block ). 回答2: I once wrote the following simple function to reset the buffer to its natural mode, refontify it, bring the line where the cursor is to

Groovy syntax highlighting in Vim 7.4

南笙酒味 提交于 2019-12-12 09:43:49
问题 Since I updated Vim to version 7.4, Groovy syntax highlighting was broken. For example: int i1 = 100 / 2 * 5 + 120 In example above code after / char is highlighted as string literal while another / char will not be found there. Is anyone met this error? UPDATED: Groovy regexp strings can be written as /regexp/ , but in official Groovy documentation this string is not highlighted (I think because it is very difficult to separate this regexp and division expression). In previous (7.3) major

Language server with semantic highlight in VSCode

不打扰是莪最后的温柔 提交于 2019-12-12 09:38:14
问题 I'd like to write a language server to VSCode with semantic highlight support. The language I'm using has very complex rules, so I'd like not to rely on a tokenizer to distinguish between identifiers and keywords. I already have a language service in VS Community , where I've written my own Classifier. It's possible to write own classifier in VSCode , or the only way to colorize a document is add TextMate language specification file to a VScode package? 回答1: Semantic coloring is not supported