Index of every page on this site: llms.txt
All skills
github avatar

/lsp-setup

@f10fdb8 official
by githubgithub/awesome-copilot41k stars
5,399
Run it yourself

Enable code intelligence (go-to-definition, find-references, hover, type info) for any programming language by installing and configuring an LSP server for Copilot CLI. Detects the OS, installs the right server, and generates the JSON configuration (user-level or repo-level). Use when you need deeper code understanding and no LSP server is configured, or when the user asks to set up, install, or configure an LSP server.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/lsp-setup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesjava-jdtls.md

≈931 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Java code intelligence with jdtls

Details for the Java entry in lsp-servers.md. LSP is optional for Java: builds, tests and runtime diagnostics work without it.

JDKs: two different things

  • jdtls runtime JDK: jdtls needs a recent JDK (21+ for current releases) found via JAVA_HOME or PATH.
  • Project JDK: the version your code targets (maven.compiler.release, java.toolchain). Install a matching JDK too; if jdtls cannot find one, it falls back to its own runtime and may report false errors for newer language features.

Project import

  • Maven: jdtls reads pom.xml (multi-module supported). Run ./mvnw -q compile once so dependencies are in ~/.m2.
  • Gradle: jdtls uses the Gradle wrapper (gradlew) if present. Run ./gradlew classes once.
  • Open Copilot CLI at the repository root (or the module root) so the build file is found.
  • After large pom.xml / build.gradle edits, restart the session (/exit, relaunch) so the project is re-imported.

Workspace (data) directory

-data .jdtls-workspace keeps the index per project, avoiding cross-project classpath contamination. Delete it to reset a stale index; git-ignore it. Never share one data dir between two running jdtls instances.

Performance

  • Heap: --jvm-arg=-Xmx2G is enough for most projects; raise to 4G for very large multi-module builds.
  • The first start indexes and may take 30-60s or more; workspaceSymbol can be empty meanwhile. Fall back to grep briefly.
  • Keep one Java server configured at a time.

Lombok and annotation processors

jdtls does not see Lombok-generated members (@Getter, builders) unless the Lombok agent is passed to the JVM, e.g. --jvm-arg=-javaagent:<path-to>/lombok.jar (this path is machine-specific; set it in user-level config, not in a committed repo file). MapStruct, Immutables and other processors need annotation processing enabled and generated sources produced by a prior build. Treat "cannot resolve method" errors on generated code as possible false positives and confirm with ./mvnw compile or ./gradlew classes.

What lsp operations give for Java

Operation Use
goToDefinition / goToImplementation jump to a type, or to implementations of an interface
findReferences all usages, resolving overloads and imports
incomingCalls / outgoingCalls call hierarchy
hover type info and Javadoc
documentSymbol / workspaceSymbol outline of a file, or search types by name
rename semantic rename across files

Parameters are 1-based line and character, except documentSymbol (file only) and workspaceSymbol (query). Prefer lsp first for symbol questions; use grep for non-symbol text (properties, log messages).

Troubleshooting

Symptom Fix
/lsp shows no Java server check which jdtls and config location; restart the session
Unresolved imports everywhere run the Maven/Gradle build once; delete .jdtls-workspace
Server exits immediately check the JDK version used by jdtls (java -version); confirm wrapper flags with jdtls --help
Out-of-memory or slow raise -Xmx; close other Java servers
Wrong language-level errors install the project's JDK and make sure the build file declares it

Provenance

Adapted from jdubois/dr-jskill (references/JDTLS.md, assets/lsp.json), read at commit 29e71996048e4086bfa389268a3c6c2e49ea3f25. Contributed here by its original author (Julien Dubois, sole copyright holder of dr-jskill) under this repository's MIT license; it remains available upstream under Apache-2.0. Reworked and condensed; no host-specific paths.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning27d4 checks · Risk SAFE
  • Gen Agent Trust Hub27d

    This skill automates the installation and configuration of Language Server Protocol (LSP) servers to provide advanced code intelligence features. It uses standard package managers and official download sites to fetch well-known development tools from reputable sources.

  • Socket27d

    No alerts

  • Snyk27d

    Risk: MEDIUM · 1 issue

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
  • TypeScript
  • Python
  • lsp
  • language-server
  • copilot-cli
  • code-intelligence
  • setup
  • configuration
  • go-to-definition
  • java

README badge

README badge for github/awesome-copilot/lsp-setup

Installs and configures Language Server Protocol servers for Copilot CLI, enabling go-to-definition, find-references, and hover information. Detects the OS, installs the appropriate LSP binary, and writes the configuration (user-level or repo-level) in the format Copilot CLI expects.

Generated from the current SKILL.md.

Does this configure LSP for my editor or IDE?
No. This skill configures LSP servers specifically for Copilot CLI, not for VS Code, Neovim, or other editors. Use it when you need code intelligence features (go-to-definition, find-references, hover) within the Copilot CLI workflow.
What happens if my language isn't in the reference file?
The skill searches the web for a suitable LSP server for that language and guides you through manual configuration with the JSON format.
Can I have multiple language servers configured at once?
Yes. The JSON structure supports multiple servers in the same `lspServers` object, and the skill merges new entries without overwriting existing ones.
Do I need to restart Copilot CLI after setup?
Yes. You must type `/exit` to quit Copilot CLI so the new LSP configuration is loaded on the next launch.
Can I use both user-level and repo-level LSP config?
Yes. Repo-level config takes precedence over user-level, so you can set defaults at user-level and override them per repository.

Generated from the current SKILL.md. These answers refresh after source changes.