Skip to content

C and C++, PHP, Ruby, HTML and CSS

These languages get code insight through their language servers: completion, navigation, find usages, rename where the server offers it, diagnostics and formatting. They have no build model of their own in Ferris IDEA, so run configurations are ones you write (Run configurations). C, C++, PHP, Ruby, HTML and CSS are Works; the languages under Other languages are Experimental.

  • Server: clangd. .c files are C; .cc, .cpp, .cxx, .h, .hh, .hpp and .hxx are C++. clangd reads compile_commands.json for the flags; without it, it guesses.

    Terminal window
    xcode-select --install

    Ferris IDEA names: Xcode command line tools, brew install llvm, or the distribution's clangd package.

  • Debug: lldb-dap, as for Rust. Ferris IDEA does not build C or C++ programs before debugging; build them with debug information first and debug the program through a Command configuration.

  • Move File rewrites relative #include "…" lines that point to the moved file.

  • No CMake or Makefile project model, and no test runner.

  • Servers, in order: intelephense, then phpactor.

    Terminal window
    npm install -g intelephense

    Or: composer global require phpactor/phpactor

  • The free intelephense has no rename, implementations, type declarations, code actions or type hierarchy. Rename then says “intelephense does not offer renaming”.

  • No project model, debugger or test runner.

  • Servers, in order: ruby-lsp, then solargraph. A server locked in Gemfile.lock is preferred and started with bundle exec.

    Terminal window
    gem install ruby-lsp

    Or: gem install solargraph

  • Ruby versions: Ferris IDEA reads the requested version from .ruby-version, .tool-versions, mise.toml or the Gemfile’s ruby line, and finds versions installed with rbenv, rvm, chruby, asdf and mise. The servers are looked for in that Ruby’s bin, the gem folders, then the PATH.

  • ruby-lsp is not started in a project you have not trusted, because it runs Bundler.

  • Formatting and style checks need RuboCop or Syntax Tree in the project.

  • No build model, debugger or test runner: Ruby projects get no detected run configurations.

  • Servers: the HTML, CSS (also SCSS and Less) and JSON servers from one package:

    Terminal window
    npm install -g vscode-langservers-extracted
  • Ferris IDEA adds its own features that need no server: go from a class or id in HTML to its CSS rule, complete class names and ids from the project’s style sheets, rename a class or id across files, and colour swatches in the gutter.

  • Angular templates get the Angular server when angular.json exists; see JavaScript and TypeScript.

For these, a server is registered and syntax highlighting works; they are not checked further.

Language Server Install
JSON vscode-json-language-server npm install -g vscode-langservers-extracted
XML lemminx the lemminx binary from the vscode-xml releases
YAML yaml-language-server npm install -g yaml-language-server
Markdown marksman from the marksman releases
TOML taplo npm install -g @taplo/cli or cargo install taplo-cli --features lsp
Shell bash-language-server npm install -g bash-language-server
Dockerfile docker-langserver npm install -g dockerfile-language-server-nodejs
Groovy groovy-language-server build it from source and put a start script on the PATH
Scala metals cs install metals (Coursier)
Swift sourcekit-lsp comes with Xcode or the Swift toolchain
Lua lua-language-server from the LuaLS releases
R the languageserver package install.packages("languageserver") in R

Formatting notes: Markdown is formatted by Ferris IDEA itself, whole files only; Shell needs shfmt; Scala needs a .scalafmt.conf; Groovy has no formatter. metals, sourcekit-lsp, lua-language-server and the R server are not started in a project you have not trusted.

Ferris IDEA starts only the servers it knows. A language that is not in this list gets no code insight; a plugin can add a file type, completion and inspections.

  • detect_languagereadsDetect the programming language of a file name; returns the LSP language id or null.
  • file_diagnosticsreadsErrors and warnings of workspace files from their language server (clangd, rust-analyzer, pyright, typescript-language-server, gopls), followed by Ferris IDEA's own findings (source Ferris IDEA).
  • format_filechangesdry run by defaultwritetrusted-projectFormat a workspace file (or a range) as Reformat Code does.
  • language_serversreadsLanguage servers per language: the candidates Ferris IDEA can use, which one is selected on this machine, why the others are unusable (missing, not executable, rustup proxy without the component in the toolchain the workspace folder uses) and how to install them.