[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Semantic: update or remove?
From: |
Lynn Winebarger |
Subject: |
Re: Semantic: update or remove? |
Date: |
Tue, 1 Apr 2025 15:19:23 -0400 |
On Mon, Mar 31, 2025 at 1:35 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Lynn Winebarger <owinebar@gmail.com>
> > Date: Mon, 31 Mar 2025 13:19:11 -0400
> > Cc: dancol@dancol.org, emacs-devel@gnu.org
> >
> > On Wed, Mar 19, 2025 at 9:44 AM Eli Zaretskii <eliz@gnu.org> wrote:
> > >
> > > > From: Lynn Winebarger <owinebar@gmail.com>
> > > > Date: Wed, 19 Mar 2025 01:05:04 -0400
> > > > Cc: emacs-devel <emacs-devel@gnu.org>
> > > >
> > > > I almost always turn on Semantic/CEDET. I wish either tree-sitter or
> > > > eglot had been integrated to (easily)
> > > > override the built-in parsing engine.
> > >
> > > Can you tell more how you tunr it on and what can you do after that
> > > which you couldn't do without turning on Semantic/CEDET?
> >
> > Well, I would turn it on either using the items (for Semantic and EDE)
> > in the "Tools" menu or by having saved options after doing so.
> >
> > The second part seems a bit loaded. I haven't been including
> > tree-sitter support in my emacs builds, so I can't compare features
> > that might be available through it. I have used both eglot and the
> > various lsp-* modes with various LSP servers, but those are not
> > included in a bog-standard emacs installation, so I'm not sure
> > features they provide are really something I "could do" without
> > turning on Semantic/CEDET.
>
> Thanks. I didn't mean to ask you to compare Semantic/CEDET with
> tree-sitter and Eglot. I meant to ask you to describe what useful
> stuff could you do after turning on Semantic/CEDET which you couldn't
> easily do before you turn it on. IOW, which features provided by
> Semantic/CEDET you used to use after turning it on?
So, I am the eccentric that pre-loads the world so I will be able to
see every available functionality in the customization menus, at least
on machines that I spend a lot of time working on.
In that situation, I will flip on basically every feature Semantic
offers, and only turn it off if I am using an LSP or the parsing
engine is disruptive. For the emacs code base, that's not a real
problem.
Properly speaking, the CEDET "environment" has a number of components
which function at different levels. At the lowest level "semantic"
provides low-level parsing engine functionality corresponding to the
parsing engine and tables, plus the defining grammars and the parsing
table generator (and corresponding lexing tools). As an IDE user, I
would rarely directly "use" that functionality directly, but rather
through all the higher-level interactive features.
* Senator is the component for navigating by syntactic units, which I
think are those defined by the grammar for the language in the buffer
* SRecoder is the refactoring engine - but I haven't really made use
of it, not sure if it's actually usable
* EDE is the project manager, but I have never actually figured out
how to make use of it.
* Speedbar - provides an "explorer" type interface. It's better with
the external "sr-speedbar" package that allows the "explorer" window
to open in the same frame, but that's out of scope. Appears to be
tied to the xref engine now.
* SemanticDB - persistent database to cache parsing results
Some of the interactive features I enjoy:
* Implemented completely by minor modes so features are additive to
existing major modes for languages
* The "analyzer" functionality that traces symbol dependencies and
calculates completion lists. Precursor of LSP type functionality, but
without knowledge of compiler flags. Really requires configuring
include paths specific to project, unless they are in a very standard
location (/usr/include or current directory)
* Stickyfunc - show the start of the top-level syntactic unit in the
header line after it scrolls off
* Breadcrumbs in header line
* "Decorations" - e.g. highlight #include directive, provides
context-menu for actions on included file.
* "Summary" information - shown in minibuffer, very configurable, e.g.
simple prototype, prototype + doc string/comments, etc
* Symref - apparently basis of xref library, but wired into
interface/analyzer/etc
* Symbol completion - fed from analyzer results, allows display of
completion in tooltips without any additional packages
* Visually mark boundaries of syntactic units, or "tag boundaries"
* Adds faces for these features over and above anything specified for
major mode of the associated language
I don't really understand why tree-sitter functionality wasn't built
out as an additional parsing engine for Semantic/CEDET functionality,
to layer over existing major modes, rather than adding all those "-ts"
major modes. Maybe the extensive use of EIEO/CLOS design was too much
of a barrier for writing a tool to import tree-sitter grammars into
the Bovine/Wisent format so the rest of the framework would tie to the
syntactic symbols generated by tree-sitter?
Lynn
- Re: Semantic: update or remove?,
Lynn Winebarger <=