arXiv:2609.03086cs.SESep 2026

Manuscript Offprint

arXiv:2609.03086

Large Language Models and Language Server Protocol: a match made in context

Alessandro Schena, Ilgiz Mustafin, Julia Kotovich

Alessandro Schena¹[0009-0005-1793-9107], Ilgiz

Mustafin¹[0009-0007-0476-5966], and Julia Kotovich¹,²[0000-0003-3739-6304]

¹ Constructor Institute of Technology, Schaffhausen, Switzerland {Alessandro.Schena, Ilgiz.Mustafin, Julia.Kotovich}@constructor.org ² Constructor University, Bremen, Germany

Abstract. This article introduces Eiffel-tools, a language server protocol (LSP) implementation for the Eiffel programming language that uses Large Language Models (LLMs) to aid the development of statically verified software. The tool provides various interactive and non-interactive commands to produce code and specifications. It uses language and project specific knowledge to precisely direct the LLM and verifies the output using a static verifier. It crafts rich programmatic prompts for the input and corrects or rejects the output. Furthermore, it handles the retries until the program passes verification.

The tool's bug fixing capability is evaluated on 2 public datasets using 3 models. The tool can fix 76% to 95% of bugs by combining LLMs and a formal verifier depending on the model and prompts used. The results show the trade-off between the number of fixing attempts and the success rate.

Keywords: LLM · LSP · Software verification · Design by Contract · Eiffel · AutoProof

1 Introduction

Specification-driven development (SDD) is getting more attention with the growing use of Large Language Models (LLMs) for development [1]. In this approach, the development is done in a natural language by writing specifications while the program code is then generated automatically from the specifications.

Expressing specifications using a formal language, even partially [2], opens the door for various analysis tools. For example, using Design by Contract [3] in Eiffel, the program's state is checked against specifications during execution. This allows test runs of the program to show the presence of implementation errors.

A more advanced analysis such as formal verification allows finding inconsistencies between specifications and implementation statically, without running the code. This allows finding errors earlier and mathematically proving arbitrary functional properties. Still, errors in specifications can lead to invalid but correct programs.

Modern SDD relies heavily on LLMs. While LLMs code generation might work well for programming languages that are well-represented in the training datasets, their ecosystem might not have formal verification tools available. These are called high-resource languages [4].

Eiffel is a low-resource language; it has a first-class support for specifications and a static verifier AutoProof, but the low amount of public code makes LLM code generation more challenging. Adapter tools could mitigate this issue. Any such tool must structure and contextualize the code for the model and must keep the user in the loop whenever a reasonable output is produced. To mitigate this issue, special tools can be implemented which take the role of an adapter: on the one hand, the tool must structure and contextualize the code for the model, on the other hand, the tool must present model's outputs to allow the user to benefit more from the LLM.

This paper introduces Eiffel-tools [5], as the aforementioned adapter. Eiffel-tools implements the Language Server Protocol (LSP) to integrate conveniently in the majority of code editors.

In this paper we highlight the tool's "fix feature body" command. The command tries to change the body of the procedure such that it will satisfy its specifications. The tool presents the relevant parts of the code, while omitting irrelevant parts of the project, to the LLM and sets up the interaction loop between the LLM and the verifier.

We present the evaluation of this command using two datasets of buggy programs with correct specifications and compare the performance of three LLMs. One model is a small generalist model, second is a small coding model and another is a bigger coding model.

The remainder of this paper is structured as follows. Section 2 provides the necessary background, introducing the core concepts related to the Eiffel programming language, large language models, and LSP-based tooling in greater detail. Section 3 reviews related work in automated program repair, LLM-assisted development, and contract-driven methodologies. Section 4 presents the design and implementation of our experimental setup, describing how contract-guided repair is operationalized using LLMs. Section 5 outlines the evaluation methodology, followed by Section 6, which reports the experiment results and discusses them. Section 7 addresses threats to validity and limitations of the study. Finally, Section 8 outlines directions for future work.

References (32)