Skip to content

pherrymason/c3-lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C3 LSP

Go

WIP LSP for C3 language
Using tree-sitter grammar rules from https://github.com/cbuttner/tree-sitter-c3.git

Server

Features

  • Indexes workspace variables and function definitions
  • TextDocumentCompletion. Suggests symbols located in project's source code. See notes.
  • Go to declaration.
  • Go to definition.
  • Hover Displays information about symbol under cursor.

Installation

Precompiled binaries for the following operating systems are available:

You can also build from source:

  • Download and install golang: https://go.dev/
  • Clone this repo
  • Run make build: This will create c3-lsp in server/bin folder.

IDE extensions

There's a simple vscode extension available for download here: download vix
Be sure to configure it with the path of the lsp server binary.

Current status
Index status

  • Attributes
  • Variables & type
  • Global constants
  • Functions
  • Function parameters
  • Function return type
    • Enums + Enumerators
    • base type
    • enum methods
  • Faults
  • Structs
    • Struct members
    • Struct methods
    • Struct implementing interface
    • Anonymous bitstructs
    • [~] Struct subtyping: Only for those subtypes defined in same file.
  • bitstruct
  • Unions
    • Union members
  • [~] defines
  • Interfaces
  • [~] Macros
    • return type
  • imports
  • modules
  • multiple modules per file
  • implicit module name is assumed to be the file name, converted to lower case, with any invalid characters replaced by underscore (_).
  • Generics
  • Language Builtins

LSP Features Status

  • Index scopes and its hierarchy to improve hover and Auto Completion.
  • Complete Go to declaration
    • Find symbol in same scope
    • Find symbol in parent scope
    • Find symbol present in same module, but different file
    • Find symbol in imported module
    • Find symbol in implicit parent module.
    • Find symbol in stdlib
  • [~] TextDocumentCompletion:
    • Struct methods are not suggested until first letter is written.
    • Completion of symbols defined in stdlib.

Useful links: