Fuchsia Language Server

LSP server for Fuchsia-specific languages (FIDL, CML).

What's here?

  • /lsp: The Language Server implementation
  • /chava: A flexible parser & utilities for FIDL in Rust

See the individual subdirectories for more information.

How do I build this?

All crates here use a normal Rust build process. The LSP server itself is the default project for this workspace, so you can simply run cargo build --release from the root of the repository and get a built LSP in /target/release.

How do I use this?

See /lsp for more details, but the TL;DR is:

  • If using VS Code, grab the Fuchsia extension, which comes with a prebuilt copy, or can be configured to use a custom copy in the extension settings

  • Otherwise, follow the appropriate editor configuration for adding language servers to your editor. For example, for neovim with nvim-lspconfig:

    require('lspconfig.configs').fuchsialsp = {
    	default_config = {
    	  name = 'Fuchsia Language Server',
    	  cmd = {'/path/to/your/built/lsp'},
    	  filetypes = {'fidl', 'cml'},
    	  -- this'll be changing a bit in the future to be clearer
    	  root_dir = require('lspconfig').util.find_git_ancestor,
    	}
    }
    require('lspconfig').fuchsialsp.setup {
      -- your setup here
    }