Common Lisp language support for VS CodeThis VS Code extension supports Syntax Highlighting, Snippets, Completion, Hover, Definition, References, Document Symbol, Call Hierarchy, and Semantic Tokens for Common Lisp. FeaturesSyntax HighlightingSnippetsUsage and RecommendationBeginner's Guide: Overview. Quick GuideFile Types:
Snippets support: 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. PreferenceThe language identifier (id) is If you need to customize your setting only for Common Lisp files, in
Bracket pair colorization:
Hover tooltip:
Quick suggestions:
Semantic highlighting:
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.
DesignSyntax HighlightingBecause 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 1.4.4.14 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
Static AnalysisCurrently, 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). Learn MoreSee Developer Guide. AcknowledgmentCL-ANSI Standard Draft, Common Lisp HyperSpec, vscode-scheme, Scheme.tmLanguage, Lisp.tmLanguage, regex101, OSS license from structure101 Image CreditsThe |