Skip to content

jdrupal-dev/drupal_ls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drupal LS

The missing language server for Drupal.

Features

Hover
  • Service references
  • Service class
  • Route references
  • Route controller/form
  • Hook references
  • Permission references
  • Plugin references
Go to definition
  • Service references
  • Service class
  • Route references
  • Route controller/form
  • Hook references
  • Permission references
  • Plugin references
Completion
  • Services
  • Routes
  • Snippets
    • A few QoL improving snippets.
    • Hooks
    • form-[ELEMENT]
    • render-[ELEMENT]
  • Permissions
  • Plugin IDs (limited to:)
    • EntityType
    • QueueWorker
    • FieldType
    • DataType
    • FormElement
    • RenderElement
Code actions
  • Add translation placeholders to t() functions.

Installation

VSCode

You can download the VSCode extension by searching for drupal-ls in VSCode or going to the marketplace.

Currently the extension is supported on the following platforms:

  • MacOS (darwin-x64, darwin-arm64)
  • Linux (linux-x64, linux-arm64)
Neovim (lazy.nvim)

You can download a pre-built binary from the Releases page, or you can compile it from source.

{
  "jdrupal-dev/drupal_ls",
  event = { "BufReadPre", "BufNewFile" },
  -- Requires cargo to be installed locally.
  -- Only needed when compiling from source.
  build = "cargo build --release",
  config = function()
    vim.lsp.config.drupal_ls = {
      cmd = {
        -- Replace this path, if you download a prebuilt binary.
        vim.fn.stdpath("data") .. "/lazy/drupal_ls/target/release/drupal_ls",
        "--file",
        "/tmp/drupal_ls-log.txt",
      },
      filetypes = { "php", "yaml" },
      root_markers = {
        'composer.json',
      },
    };

    vim.lsp.enable("drupal_ls");
  end,
}

Roadmap

VSCode

  • Build VSCode extention in Ci.

Completion

  • Autocomplete #theme functions.

Code actions

  • Generate __construct doc block.

About

The missing language server for Drupal

Resources

License

Stars

Watchers

Forks

Packages

No packages published