Skip to content

Settings › Language Servers picks the server for each language #456

Closed

Description

@a-team-app

Context

Third slice of #63. After this merges, the user can pick a language server for Go, Rust, TypeScript, Python or any other highlighted language (or change C#'s) from Settings, without editing a file, and Go to definition and Find usages then work in those files too. See the pitch for the pane and dialog mockups.

Blocked by #454 (Go to definition), which brings the language server client. It doesn't depend on the Find usages task.

Acceptance criteria

  • Settings has a Language Servers pane listing every language TuiCode highlights, with its server (— for none, (default) for C#'s csharp-ls) and ✓/✗ for whether that server is on PATH.
  • Enter on a row opens a dialog titled <Language> language server with radio buttons: None, each known server for that language, and Custom.
  • Choosing a known server fills Command and Arguments (text fields); choosing Custom lets the user type them.
  • As the command is typed, the dialog shows whether it's on PATH; for a known server that isn't, it shows its install command (e.g. go install golang.org/x/tools/gopls@latest).
  • A server that isn't installed can still be saved, and its row shows ✗.
  • Ctrl+Enter saves and Esc cancels; Delete on a row resets it to its default.
  • After saving, that language's running server stops and the chosen one starts with the next file of that language. The status bar shows its state as it does for C#.
  • With gopls or rust-analyzer chosen and installed, Ctrl+G D (and Ctrl+G U, if merged) work in Go or Rust files.
  • A file whose grammar was changed with cg uses the server of the language the status bar shows.
  • The choice survives a restart.

Known servers: C# csharp-ls, roslyn-language-server; Go gopls; Rust rust-analyzer; TypeScript/JavaScript typescript-language-server; Python pyright, pylsp, each with its arguments and install command.

Tests

  • Reading and writing the setting, including a missing or partly invalid file.
  • The pane's rows: languages, server names, installed state.
  • The dialog's choice → command/arguments, the PATH check, reset to default.
  • A saved change restarts only that language's server.

Out of scope

  • Installing or updating servers for the user.
  • Per-folder server settings.
  • Server-specific options (initialization options, workspace settings) beyond command and arguments.

Activity

  1. a-team-app commented on Oct 7, 2026

    @a-team-app
    ContributorAuthor

    Blocked by #454: Choosing servers per language needs the language server client that #454 brings.

  2. a-team-app commented on Oct 9, 2026

    @a-team-app
    ContributorAuthor

    Draft PR #496 is up.

  3. added 3 commits that reference this issue on Oct 10, 2026
    283fbdb
    c4c0fb1
    2ebdc25
  4. jamescrosswell commented on Oct 10, 2026

    @jamescrosswell
    Contributor

    When chosing the ls for a grammar, it's usually radio buttons. Pressing the arrow keys currently focuses a new radio but doesn't automatically select it (I have to press space to select it). Selection should happen automatically.

  5. jamescrosswell commented on Oct 10, 2026

    @jamescrosswell
    Contributor

    I enabled rust-analyzer for Rust but the Goto Definition and Goto Usages commands don't seem to work properly for Rust:

    Image

    The LS is showing as loaded. This was on ~/code/rust-test/test.rs.

  6. added a commit that references this issue on Oct 10, 2026
    6d1820b
  7. a-team-app commented on Oct 10, 2026

    @a-team-app
    ContributorAuthor

    Done in #496 (6d1820b): the arrow keys now select the server they move to, with no Space needed. The dialog also opens focused on the current server, so the first arrow moves on from that one rather than from None.

  8. a-team-app commented on Oct 10, 2026

    @a-team-app
    ContributorAuthor

    This one is rust-analyzer, not TuiCode. test.rs sits at the root of rust-test, outside src/, and nothing mods it in, so it isn't part of the crate. rust-analyzer doesn't analyse files outside the crate. I asked it directly, with no TuiCode involved, for the definition of get_env_var in that file and it returned nothing, even 30s after indexing finished. It also returns nothing for a copy of the file in a folder with no Cargo.toml.

    In the same folder, with PR #496's build, Go to definition on App in src/main.rs jumps to pub struct App in src/app.rs. To try it on test.rs, move it to src/ and add mod test; to main.rs, or make it src/bin/test.rs.

    rust-analyzer can be told about a loose file: its linkedProjects setting takes a .rs file as well as a Cargo.toml. If you’d like TuiCode to use that for files outside the crate, or to say "not part of a Cargo project" rather than "No definition found", I can open that as a follow-up. I've left this PR as it is.

  9. added a commit that references this issue on Oct 11, 2026
    91ae088
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-team:devClaimed by the a-team Dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions