Common Lisp language support for VS Code
This VS Code extension supports Syntax Highlighting, Snippets, Completion, Hover, Definition, References, Document Symbol, Call Hierarchy, and Semantic Tokens for Common Lisp.
Usage and Recommendation
Beginner's Guide: Overview.
For huge files, in some rare cases, semantic highlighting might lose synchronization when switching files or some large change happens quickly. You only need to type any character in the file to recover.
The language identifier (id) is
If you need to customize your setting only for Common Lisp files, in
Bracket pair colorization:
Also, there are some built-in settings of this extension that can customize more advanced preferences, for example, which language feature provider should be used, which token range should be excluded, and how to deal with the backquote part. See wiki.
Because of the functional features of Common Lisp, we use the intuition of Common Lisp to design syntax highlighting instead of the intuition of non-functional language to design syntax highlighting. That is, we strictly follow the CL-ANSI 22.214.171.124 to classify the 978 external symbols in COMMON-LISP package.
We processed Common Lisp HyperSpec to get the kind of each symbol. The result is in
We assign different colors to different kinds of symbols, and the assignment rule can be found in the start comment of
Currently, we use a very simple hand-written parser and combine it with regex to parse the code. Thus, the accuracy, precision, and performance are not good enough. However, we have no plans to complicate the parser further since it is like rebuilding a new wheel (new parser) using TypeScript.
Since this extension is designed as a Web Extension, we are considering using node-tree-sitter as the parser in the future. However, we have no plan to update the parser recently since we are still evaluating its impact on the architecture of VS Code language service (see Anycode).
See Developer Guide.
draft proposed American National Standard for Information Systems—Programming Language—Common Lisp X3J13/94-101R (CL-ANSI)