From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Anand Tamariya Newsgroups: gmane.emacs.devel Subject: Re: Semantic font-lock for Java Date: Wed, 22 Jan 2020 11:22:05 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007372f3059cb42017" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="19406"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 22 06:59:16 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iu92o-0004zh-Mo for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jan 2020 06:59:14 +0100 Original-Received: from localhost ([::1]:37108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu92n-0007zB-6P for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jan 2020 00:59:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59850) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu8w6-0007jC-L2 for emacs-devel@gnu.org; Wed, 22 Jan 2020 00:52:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu8w5-0004ed-9z for emacs-devel@gnu.org; Wed, 22 Jan 2020 00:52:18 -0500 Original-Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:44203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu8w5-0004eO-5A for emacs-devel@gnu.org; Wed, 22 Jan 2020 00:52:17 -0500 Original-Received: by mail-io1-xd31.google.com with SMTP id e7so797052iof.11 for ; Tue, 21 Jan 2020 21:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=q4O270ZnFw2PxqvvKRgY+/RBNIypSy7NT7NM8C3EJaQ=; b=IyZmApU9URvo2xeuge/suAGjFt4EpUDBtDBZfbLkRUX4Fqvjp6YM12o73kFQOb1bVt zNQmBnnl3aHQxEDiReNlz0U0lcmbP8ci/UIWanhioILnYas0j8dWB0XXl3zqyWAYiCcK Rz2w0baYPb+Uo+B9fuHVvScwKwACxaG1e1mMMgufL4fyDcKy7fPh2/3VyKJNxHmupZ4M Oq2uoF49ArQ0EYny5CU+BoF3QsXclaH0cVjPrJaytAJ2zV27nwPaCWdrl74wtm8G65I3 K2OsOK5zuGqV6SsarAb6+IjKrcE26DAtkvLQlaLnGDlwRga5LqYvZ8K6NYCpDzBfYgVe ZIrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=q4O270ZnFw2PxqvvKRgY+/RBNIypSy7NT7NM8C3EJaQ=; b=pgzoZINWr1pVl6ITQrTd9qluSnlNiTURwUrk+YD9FcW/lG65YR+tSb4psR7x14jaLQ /m4UJy1Vsl/rgtHuIvaYLpQE6W1Ckv7sR9JDGEFylW0f03E5K3yQ7ePqdf8jR2lMc906 Jb+yoGvfGWnFCeX+j4nHaSKsWZ66kCByAArBimSfHKGkmqO5KV98To4E1OjOQnFrWCL3 /Va6Q7Omb8eDku8agcuacA7k1OVwHcnxhk564bI0F3wNezYg+f6v95fy+cmgzGoWxr0y fwvR6F1Kv5mFPnBnOJ4nekM7IVoojqJH78+3tneAOksvi9JLY+O2+sAZFzmPDlu0dCph MqiQ== X-Gm-Message-State: APjAAAXmAvJI+wwyN+hp3wyAwd35c65UK4s0lXCMNe6+xT33PD06YhWX Oo+ZR9OheFumXI3ikeM1bZ0S5eAT0H/xVKh7droBgi9rgkw= X-Google-Smtp-Source: APXvYqxMY5jxv5QKC3giFk08xFcYeeESeHCWFxk+C5sAe8/PEdjd1M96/o+aBMLzijK74nxeHiiF5S1GT3BsrRZnqmo= X-Received: by 2002:a6b:e204:: with SMTP id z4mr2499914ioc.308.1579672336034; Tue, 21 Jan 2020 21:52:16 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d31 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244483 Archived-At: --0000000000007372f3059cb42017 Content-Type: text/plain; charset="UTF-8" Also want to highlight some noticeable features in the comparison pic: 1. Static variables and functions are highlighted differently. 2. Constant variables are highlighted differently. 3. Not only the declaration, but the usages are highlighted also. 4. Package is highlighted correctly. [image: Post image] On Tue, Jan 21, 2020 at 5:09 PM Anand Tamariya wrote: > I've been working on Semantic font-lock for Java using CEDET Semantic > infrastructure which uses Wisent incremental parsing under the hood. So far > the results look promising. Hence I'm sharing the same. > [image: Post image] > > > It uses following face definitions for highlighting. > > (defvar semantic-format-face-alist > `( (function . font-lock-function-name-face) > (variable . font-lock-variable-name-face) > (type . font-lock-type-face) > ;; These are different between Emacsen. > (include . ,'font-lock-constant-face) > (package . , 'font-lock-constant-face) > ;; Not a tag, but instead a feature of output > (label . font-lock-string-face) > (comment . font-lock-comment-face) > (keyword . font-lock-keyword-face) > (annotation . font-lock-builtin-face) > (constant . bold) > ;;(member . font-lock-member-face) > (abstract . italic) > (static . italic) > (documentation . font-lock-doc-face) > ) > > *Code:* Emacs customization (https://gitlab.com/atamariya/emacs/tree/dev) > --0000000000007372f3059cb42017 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Also want to highlight some noticeable features in the comparison pic:

  1. Static variables a= nd functions are highlighted differently.

  2. Constant vari= ables are highlighted differently.

  3. Not only the declara= tion, but the usages are highlighted also.

  4. Package is h= ighlighted correctly.

3D"Post

On Tue, Jan 21, 2020 at 5:09 PM Anand Tamariya <atamariya@gmail.com> wrote:

I've been working on Semantic font-lock for Java using CEDET Semantic=20 infrastructure which uses Wisent incremental parsing under the hood. So=20 far the results look promising. Hence I'm sharing the same.

3D"Post

It uses following face definitions for highlightin= g.

(defvar semantic-format-face-alist
  `( (function . font-lock-function-name-face)
     (variable . font-lock-variable-name-face)
     (type . font-lock-type-face)
     ;; These are different between Emacsen.
     (include . ,'font-lock-constant-face)
     (package . , 'font-lock-constant-face)
     ;; Not a tag, but instead a feature of output
     (label . font-lock-string-face)
     (comment . font-lock-comment-face)
     (keyword . font-lock-keyword-face)
     (annotation . font-lock-builtin-face)
     (constant . bold)
     ;;(member . font-lock-member-face)
     (abstract . italic)
     (static . italic)
     (documentation . font-lock-doc-face)
     )

Code: Emacs customization (https://gitlab.com/atamariya/emacs/tree/dev)

--0000000000007372f3059cb42017--