Language server-based context provisioning for code generation with large language models

By using a language server to identify and provide relevant context to LLMs through bidirectional encoders and generative models, the challenge of generating accurate and contextually rich code is addressed, enhancing the reliability and correctness of code generation.

JP2025123172APending Publication Date: 2025-08-22エスアーペーエスエー
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024201507
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-12
Filing Date
2024-11-19
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

Large language models (LLMs) face limitations in generating correct and contextually relevant compilable computer code due to constraints on the amount of context they can provide, which can lead to incorrect output, especially when dealing with proprietary or complex code types, and identifying relevant context is technically challenging.

Method used

A language server connected to an integrated development environment (IDE) identifies code artifacts and searches a repository for relevant declarations, definitions, and references, providing this context to the LLM to enhance code generation, using bidirectional encoders like BiLSTM or BERT models, and generative models like GAN or VAE to improve accuracy.

Benefits of technology

The approach generates more relevant and accurate computer code by leveraging contextual information from the repository, improving the reliability and correctness of code snippets, even in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025123172000001_ABST
    Figure 2025123172000001_ABST
Patent Text Reader

Abstract

To provide a language server-based context for code generation with large language models.SOLUTION: In an example embodiment, a language server connected to an integrated development environment (IDE) is used to identify, from a given input code, various code artifacts such as functions and variables, and then to search a repository of code files for declarations, definitions, and references related to those identified code artifacts. The declarations, definitions, and references can then be passed as context into an LLM.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This document relates generally to computer systems, and more particularly to the use of large-scale language models. [Background technology]

[0002] A large language model (LLM) refers to an artificial intelligence (AI) system that has been trained on large datasets to understand and generate human language. These models are designed to process and understand natural language in a way that allows the model to answer questions, converse, generate text, and perform a variety of language-related tasks. Summary of the Invention [Means for solving the problem]

[0003] The present disclosure is illustrated by way of example, and not limitation, in the figures of the accompanying drawings in which like reference numerals indicate similar elements and in which: [Brief explanation of the drawings]

[0004] [Figure 1] FIG. 1 is a block diagram illustrating a system for automatically generating computer code, according to an illustrative embodiment. [Figure 2] FIG. 1 is a flow diagram illustrating a method for automatically generating computer code, in accordance with an illustrative embodiment. [Figure 3] FIG. 1 is a block diagram illustrating a software architecture that may be installed on any one or more of the devices described above. [Figure 4] FIG. 1 is a schematic diagram of a machine in the form of a computer system, in which a set of instructions for causing the machine to perform any one or more of the methods discussed herein may be executed, according to an exemplary embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0005] In the following description, exemplary systems, methods, techniques, instruction sequences, and computing machine program products are discussed. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide an understanding of various exemplary embodiments of the present subject matter. However, it will be apparent to one skilled in the art that various exemplary embodiments of the present subject matter may be practiced without these specific details.

[0006] LLMs are highly capable of generating text and even computer code (which is compiled into executable software). However, they are limited because their existing knowledge is limited by their training data. As a result, their output is not always correct. While there are ways to mitigate the impact of this limitation—by creating appropriate system messages, adding external data through generated function calls, or fine-tuning the underlying model—these solutions are imperfect and continue to produce incorrect output. These limitations are amplified when LLMs are outputting compilable computer code, where it is important not only that the output be correct in content, but also that its syntax and formatting be correct.

[0007] In fact, certain types of compilable computer code may be even more difficult for an LLM to generate correctly due to several factors, including the type of compilable computer code being proprietary or at least partially proprietary (and therefore a format that is difficult to train an LLM against) and the type of compilable computer code being difficult to modify after it has been generated.

[0008] One of the biggest technical challenges involved in using LLM for code generation is providing the correct context. LLM works better when provided not only with the generation request itself (e.g., "generate me some code to do X"), but also with some context information, such as the code location where the newly generated code should be placed and associated files with important definitions. The more context LLM has for the request, the more reliable the code generation will be. If every code snippet in the entire application's code is provided to LLM, the resulting generated code will be very reliable.

[0009] The problem is that LLMs typically have limitations on the amount of context they can provide with a request (e.g., a maximum number of input tokens), and even if no such limitations exist or are not fully reached, adding additional context increases the inference cost (e.g., in terms of money or speed). Thus, it is important to provide the LLM with relevant context for a request, but it is also important not to provide irrelevant context. However, identifying relevant context can be technically challenging.

[0010] One solution is to identify all open files and then emit the snippet of all open files that is closest to the current surrounding code (using, for example, Jaccard distance), but this approach will fail if the relevant file is not open.

[0011] In one exemplary embodiment, a language server connected to an integrated development environment (IDE) is used to identify various code artifacts, such as functions, variables, etc., from a given input code, and then search a repository of code files for declarations, definitions, and references related to those identified code artifacts. Those declarations, definitions, and references can then be passed to the LLM as context.

[0012] LLMs used to generate information are commonly referred to as generative artificial intelligence (GAI) models. GAI models can be implemented as generative pre-trained transformer (GPT) models or bidirectional encoders. GPT models are a type of machine learning model that uses a transformer architecture, a type of deep neural network that excels at processing sequence data such as natural language.

[0013] A bidirectional encoder is a type of neural network architecture in which an input sequence is processed in two directions: forward and backward. In the forward direction, the encoder starts from the beginning of the sequence and processes the input one token at a time, while in the backward direction, the encoder starts from the end of the sequence and processes the input in reverse order.

[0014] By processing the input sequence in both directions, a bidirectional encoder can capture more contextual information and dependencies between words, resulting in better performance.

[0015] A bidirectional encoder can be implemented as a Bidirectional Long Short-Term Memory (BiLSTM) model or a Bidirectional Encoder Representations from Transformers (BERT) model.

[0016] Each direction has its own hidden state, and the final output is a combination of these two hidden states.

[0017] Long short-term memory (LSTM) is a type of recurrent neural network (RNN) designed to overcome the vanishing gradient problem in traditional RNNs, which can make it difficult to learn long-term dependencies in sequential data.

[0018] An LSTM contains a cell state, which acts as a memory that stores information over time. The cell state is controlled by three gates: an input gate, a forget gate, and an output gate. The input gate determines how much new information is added to the cell state, while the forget gate determines how much old information is discarded. The output gate determines how much of the cell state is used to calculate the output. Each gate is controlled by a sigmoid activation function, which outputs a value between 0 and 1 that determines how much information passes through the gate.

[0019] In BiLSTM, there are separate forward and backward LSTMs. At each time step, the forward and backward LSTM cells receive the current input token and the hidden state from the previous time step. The forward LSTM processes the input token from left to right, while the backward LSTM processes the input token from right to left.

[0020] The output of each LSTM cell at each time step is a combination of the input token and the previous hidden state, allowing the model to capture both short-term and long-term dependencies between the input tokens.

[0021] BERT applies bidirectional training of models known as transformers to language modeling, in contrast to prior art solutions that examine text sequences left-to-right or a combination of left-to-right and right-to-left. Bidirectionally trained language models have a deeper understanding of the context and flow of language than unidirectional language models.

[0022] More specifically, the transformer encoder reads the entire sequence of information and is therefore considered bidirectional (although it could actually be said to be non-directional). This feature allows the model to learn the context of a piece of information based on all of its surroundings.

[0023] In another exemplary embodiment, a generative adversarial network (GAN) embodiment can be used. A GAN is a supervised machine learning model with two sub-models: a generator model trained to generate new examples, and a discriminator model that attempts to classify examples as either real or artificial. The two models are trained together in an adversarial manner (using a game-theoretic zero-sum game) until the discriminator model is fooled approximately half the time, which means that the generator model is generating plausible examples.

[0024] A generator model takes a fixed-length random vector as input and generates samples in the domain of interest. This vector is drawn randomly from a Gaussian distribution and is used to seed the generation process. After training, points in this multidimensional vector space correspond to points in the problem domain, forming a compressed representation of the data distribution. This vector space is called a latent space, or a vector space of latent variables. Latent variables, or hidden variables, are variables that are important to a domain but cannot be directly observed.

[0025] The classifier model takes as input an example from this domain (real or artifact) and predicts a binary class label: real or fake (artificial).

[0026] While generative modeling is an unsupervised learning problem, a clever property of GAN architectures is that training a generative model is framed as a supervised learning problem.

[0027] Two models, a generator and a classifier, are trained together: the generator produces batches of examples, and these, along with real examples from the domain, are fed to the classifier, which classifies them as real or fake.

[0028] The classifier is then updated to become better at distinguishing between real and fake samples in the next round, and importantly, the generator is updated based on how well the generated samples fool the classifier.

[0029] In another exemplary embodiment, the GAI model is a variational autoencoder (VAE) model. A VAE comprises an encoder network that compresses input data into a lower-dimensional representation called a latent code, and a decoder network that generates new data from the latent code. In either case, the GAI model includes a generative classifier, which can be implemented, for example, as a naive Bayes classifier.

[0030] The solution works with any type of GAI model, but one implementation is described specifically for use with the GPT model.

[0031] 1 is a block diagram illustrating a system 100 for automatically generating software programming code, according to an exemplary embodiment. Here, an application development server 102 provides a server that enables one or more clients, such as application development client 104, to create and manage computer code. In some exemplary embodiments, the computer code is generated for use in a data model infrastructure such as Core Data Services (CDS) from SAP SE of Walldorf, Germany. CDS allows service definitions and data models to be declaratively captured in plain object notation. CDS models are typically written in the CDS language and then compiled.

[0032] The application development client 104 is typically used to control the application development server 102 to create applications using a first programming language, and the application development client 104 may be where a user creates a software application 106 (although in such cases, the software application 106 will typically also be stored on the application development server 102 as a backup and / or so that other users can edit it). However, this aspect is not limiting, and in some exemplary embodiments, the software application 106 is created solely on the application development server 102. A software application 106, which essentially takes the form of a programming language until it is compiled or interpreted, typically includes libraries 108 that contain programming-language-specific files. For example, if a user wishes to use the application development client 104 to create an application written in JavaScript, the programming-language-specific files are JavaScript libraries.

[0033] Code created for software application 106 may be stored in code repository 110. This may include, for example, code written by a software developer and / or code generated by LLM 116. When software application 106 is compiled, this essentially means that the files in code repository 110 and library 108 are compiled.

[0034] The code generation component 112 manages the generation of code by the LLM 116. More specifically, when the code generation component 112 is prompted to generate code (e.g., by a request sent from the graphical user interface 114), it identifies the file currently being edited by the user (and optionally contextual information about the edit). For example, the user may be editing "file1.js" and the user's cursor may be at a particular location within the code of file1.js. The code generation component 112 may receive this information from the GUI 114. This information may then be passed to the language server 118, which then parses the file the user is currently editing to identify artifacts. In this disclosure, an artifact is a clearly bounded snippet of code. This may include, for example, functions, routines, subroutines, variables, constants, etc.

[0035] In some exemplary embodiments, the language server 118 identifies all artifacts in the entire file that the user is currently editing. In other exemplary embodiments, the language server 118 can utilize contextual information, such as the location of the user's cursor, to identify only those artifacts that are relevant to the portion of the file that the user is currently editing.

[0036] The language server 118 returns the list of relevant artifacts to the code generation component 112. The code generation component 112 then requests the language server 118 to identify code snippets in the code repository 110 that are relevant to the artifacts in the list of relevant artifacts. The language server 118 then searches the code repository 110 to find such relevant code snippets, such as by identifying the files and locations with the files where each artifact is declared, defined, or referenced. This includes searching for closed files (files that are not currently open by the user).

[0037] The identified files and locations are then returned to the code generation component 112, which generates a code generation request to the LLM 116, including the contents of the identified files and locations, as well as metadata (e.g., locations) as context for the code generation request. The LLM 116 then uses this context to generate code, which is returned to the code generation component 112 and ultimately stored in the code repository 110.

[0038] As a result, the LLM 116 generates more relevant computer code because relevant context is present with the code generation request.

[0039] In some exemplary embodiments, this process can be repeated iteratively. Specifically, whenever a relevant code snippet is found for a particular artifact, the relevant code may have its own artifacts that would benefit from context. Thus, for example, a function “foo” may be referenced in a file “file1.js” being edited by a user. A first iteration may retrieve all code snippets from other files where “foo” was declared, defined, or referenced, while, for example, “file2.js” may contain a definition of foo that references a variable “var1” that is not defined in either file1.js or file2.js. Thus, in subsequent iterations, the language server may identify code snippets relevant to “var1” (as well as other undefined artifacts found in previous iterations). This iterative process can be repeated until some condition is met. In some exemplary embodiments, to prevent the LLM from dealing with an overwhelming amount of context information, this iterative process may stop after some predefined maximum number of iterations (e.g., 10 iterations).

[0040] In an exemplary embodiment, the identified files and locations may be stored in cache 120. This improves the overall performance of system 100 because it allows code generation component 112 to retrieve the identified files and locations from cache 120 on subsequent code requests for the same file being edited without having to search the entire code repository 110 using language server 118.

[0041] In an exemplary embodiment, language server 118 may utilize parser generator tool 122 to parse computer code (e.g., the current file or snippet being edited by a user) in which language server 118 is attempting to identify artifacts. Parser generator tool 122 may represent the computer code as an abstract syntax tree, which represents the artifacts in the source code in a more structured manner than plain text.

[0042] FIG. 2 is a flow diagram illustrating a method 200 for generating computer code, according to an exemplary embodiment. At operation 202, a request to generate computer code on behalf of a user is received. The request may be received from a graphical user interface operated by the user, such as a graphical user interface that is part of an application development environment and that is used by the user to write and edit computer code. In some exemplary embodiments, the request may be generated based on some explicit action by the user (e.g., the user specifying that the user wants computer code to be automatically generated). In other exemplary embodiments, the request may be generated without such an explicit action, such as by inferring that the user wants code to be automatically generated. At operation 204, in response to the receipt, a first file currently being edited by the user is identified. In some exemplary embodiments, this identifying operation additionally includes identifying contextual information about the editing of the first file, such as the location of a cursor within the first file, displayed within the graphical user interface.

[0043] At operation 206, identification information of the first file is sent to the language server to cause parsing of the first file to identify one or more artifacts in the first file. At operation 208, a list of the identified one or more artifacts is received from the language server. At operation 210, a command is sent to the language server to identify one or more code snippets stored in a code repository that are associated with the identified one or more artifacts. In some exemplary embodiments, this operation may also include sending contextual information about the edit of the first file. At operation 212, identification information of one or more code snippets associated with the identified one or more artifacts is received from the language server. In embodiments in which contextual information about the edit of the first file is sent to the language server, then these identification information may include only identification information of one or more code snippets associated with the one or more artifacts identified based on the contextual information (e.g., code snippets associated only with artifacts proximate to the user's cursor, as opposed to all artifacts in the first file).

[0044] At operation 214, a prompt is generated for a large language model (LLM). The prompt includes instructions to generate code based on using the identified artifact or artifacts as context. At operation 216, the prompt is sent to the LLM. At operation 218, the generated compilable code is received from the LLM.

[0045] In view of the above disclosure, various examples are described below. It should be noted that one or more features of the examples taken separately or in combination should be considered within the disclosure of the present application.

[0046] Example 1 is a system comprising at least one hardware processor and a non-tangible computer-readable medium storing instructions that, when executed by the at least one hardware processor, cause the at least one hardware processor to perform operations including receiving a request to generate computer code on behalf of a user; in response to the receipt, identifying a first file currently being edited by the user; sending the identification of the first file to a language server along with a command to parse the first file to identify one or more artifacts in the first file; receiving a list of the identified one or more artifacts from the language server; sending a command to the language server to identify one or more code snippets stored in a code repository that are related to the identified one or more artifacts; receiving from the language server identifications of the one or more code snippets related to the identified one or more artifacts; generating a prompt for a large language model (LLM), the prompt including instructions to generate code based on using the identified one or more artifacts as context; sending the prompt to the LLM; and receiving the generated compilable code from the LLM.

[0047] In Example 2, the subject matter of Example 1 includes receiving the request includes receiving a command from a graphical user interface with which the user is currently interacting, the command being generated based on an explicit request from the user.

[0048] In Example 3, the subject matter of Examples 1-2 includes receiving the request includes receiving a command from a graphical user interface with which the user is currently interacting, where the command is generated without an explicit request from the user.

[0049] In Example 4, the subject matter of Examples 1-3 includes the operations further including, in response to receiving the request, identifying context information about the edits of the first file, and sending the identification information to the language server further includes sending the context information about the edits of the first file to the language server.

[0050] In Example 5, the subject matter of Example 4 includes wherein the context information includes a location of a cursor within a first file displayed within a graphical user interface being manipulated by the user.

[0051] In Example 6, the subject matter of Examples 4-5 includes limiting the identification of one or more code snippets associated with the identified one or more artifacts to only the identification of the relevant code snippets based on the context information.

[0052] In Example 7, the subject matter of Examples 1-6 includes that at least one of the one or more code snippets is contained within a currently closed file.

[0053] Example 8 is a method including receiving a request to generate computer code on behalf of a user; and in response to the receipt, identifying a first file currently being edited by the user; sending the identification of the first file to a language server along with a command to parse the first file to identify one or more artifacts in the first file; receiving a list of the identified one or more artifacts from the language server; sending a command to the language server to identify one or more code snippets stored in a code repository that are related to the identified one or more artifacts; receiving from the language server identifications of the one or more code snippets related to the identified one or more artifacts; generating a prompt for a large language model (LLM), the prompt including instructions to generate code based on using the identified one or more artifacts as context; sending the prompt to the LLM; and receiving the generated code from the LLM.

[0054] In Example 9, the subject matter of Example 8 includes receiving the request includes receiving a command from a graphical user interface with which the user is currently interacting, the command being generated based on an explicit request from the user.

[0055] In Example 10, the subject matter of Examples 8-9 includes receiving a request includes receiving a command from a graphical user interface with which the user is currently interacting, where the command is generated without an explicit request from the user.

[0056] In Example 11, the subject matter of Examples 8-10 includes, in response to receiving the request, identifying context information about the edits of the first file, and wherein sending the identification information to the language server further includes sending the context information about the edits of the first file to the language server.

[0057] In Example 12, the subject matter of Example 11 includes wherein the context information includes a location of a cursor within a first file displayed within a graphical user interface being manipulated by the user.

[0058] In Example 13, the subject matter of Example 12 includes limiting the identification of one or more code snippets associated with the identified one or more artifacts to only the identification of the relevant code snippets based on the context information.

[0059] In Example 14, the subject matter of Examples 8-13 includes that at least one of the one or more code snippets is contained within a currently closed file.

[0060] Example 15 is a non-transitory machine-readable medium storing instructions that, when executed by one or more processors, cause the one or more processors to perform operations including receiving a request to generate computer code on behalf of a user; in response to the receipt, identifying a first file currently being edited by the user; sending the identification of the first file to a language server along with a command to parse the first file to identify one or more artifacts in the first file; receiving a list of the identified one or more artifacts from the language server; sending a command to the language server to identify one or more code snippets stored in a code repository that are related to the identified one or more artifacts; receiving from the language server identifications of the one or more code snippets related to the identified one or more artifacts; generating a prompt for a large language model (LLM), the prompt including instructions to generate code based on using the identified one or more artifacts as context; sending the prompt to the LLM; and receiving the generated compilable code from the LLM.

[0061] In Example 16, the subject matter of Example 15 includes receiving the request includes receiving a command from a graphical user interface with which the user is currently interacting, the command being generated based on an explicit request from the user.

[0062] In Example 17, the subject matter of Examples 15-16 includes receiving a request includes receiving a command from a graphical user interface with which the user is currently interacting, where the command is generated without an explicit request from the user.

[0063] In Example 18, the subject matter of Examples 15-17 includes the operations further including, in response to receiving the request, identifying context information about the edits of the first file, and sending the identification information to the language server further includes sending the context information about the edits of the first file to the language server.

[0064] In Example 19, the subject matter of Example 18 includes wherein the context information includes a location of a cursor within a first file displayed within a graphical user interface being manipulated by the user.

[0065] In Example 20, the subject matter of Example 19 includes limiting the identification of one or more code snippets associated with the identified one or more artifacts to only the identification of the relevant code snippets based on the context information.

[0066] Example 21 is at least one machine-readable medium containing instructions that, when executed by a processing circuit, cause the processing circuit to perform operations to implement any of Examples 1-20.

[0067] Example 22 is an apparatus comprising means for implementing any of Examples 1-20.

[0068] Example 23 is a system for implementing any of Examples 1 to 20.

[0069] Example 24 is a method for implementing any of Examples 1-20.

[0070] FIG. 3 is a block diagram 300 illustrating a software architecture 302 that may be installed on any one or more of the devices described above. It will be appreciated that FIG. 3 is merely a non-limiting example of a software architecture, and that many other architectures may be implemented to enable the functionality described herein to be performed. In various embodiments, software architecture 302 is implemented by hardware, such as machine 400 of FIG. 4, which includes processor 410, memory 430, and input / output (I / O) components 450. In this exemplary architecture, software architecture 302 may be conceptualized as a stack of layers, with each layer capable of providing a particular function. For example, software architecture 302 includes layers such as operating system 304, libraries 306, framework 308, and application 310. In operation, application 310 invokes API calls 312 through this software stack and receives messages 314 in response to API calls 312, consistent with certain embodiments.

[0071] In various implementations, the operating system 304 manages hardware resources and provides common services. The operating system 304 includes, for example, a kernel 320, services 322, and drivers 324. Consistent with some embodiments, the kernel 320 serves as an abstraction layer between the hardware and other software layers. For example, the kernel 320 performs memory management, processor management (e.g., scheduling), component management, networking, and security configuration, among other functions. The services 322 may provide other common services for the other software layers. The drivers 324 are responsible for controlling or interfacing with the underlying hardware according to some embodiments. By way of example, the drivers 324 may include a display driver, a camera driver, a BLUETOOTH® or BLUETOOTH® Low-Energy driver, a flash memory driver, a serial communications driver (e.g., a Universal Serial Bus (USB) driver), a Wi-Fi® driver, an audio driver, a power management driver, etc.

[0072] In some embodiments, libraries 306 provide low-level common infrastructure utilized by applications 310. Libraries 306 may include system libraries 330 (e.g., the C standard library), which may provide functions such as memory allocation functions, string manipulation functions, and mathematical functions. Additionally, libraries 306 may include API libraries 332, such as a media library (e.g., a library for supporting the presentation and manipulation of various media formats, such as Moving Picture Experts Group-4 (MPEG4), Advanced Video Coding (H.264 or AVC), Moving Picture Experts Group Layer-3 (MP3), Advanced Audio Coding (AAC), Adaptive Multi-Rate (AMR) audio codec, Joint Photographic Experts Group (JPEG or JPG), or Portable Network Graphics (PNG)), a graphics library (e.g., an OpenGL framework used for rendering on a display in two dimensions (2D) and three dimensions (3D) in a graphical context), a database library (e.g., SQLite for providing various relational database functions), and a web library (e.g., WebKit for providing web browsing capabilities). The library 306 may also include a wide variety of other libraries 334 for providing many other APIs to the application 310 .

[0073] The framework 308, according to some embodiments, provides a high-level common infrastructure that can be utilized by the applications 310. For example, the framework 308 provides various GUI functions, high-level resource management, high-level location services, etc. The framework 308 may provide a wide range of other APIs that can be utilized by the applications 310, some of which may be specific to a particular operating system 304 or platform.

[0074] In one exemplary embodiment, applications 310 include a wide variety of other applications, such as a home application 350, a contacts application 352, a browser application 354, a book reader application 356, a location application 358, a media application 360, a messaging application 362, a game application 364, and third-party applications 366. According to some embodiments, applications 310 are programs that perform functions defined within the program. One or more of applications 310 may be structured in a variety of ways and may be written using a variety of programming languages, such as object-oriented programming languages ​​(e.g., Objective-C, Java, or C++) or procedural programming languages ​​(e.g., C or assembly language). In one specific example, third-party applications 366 (e.g., applications developed using the ANDROID™ or IOS™ Software Development Kit (SDK) by an entity other than the vendor of a particular platform) may be mobile software that runs on a mobile operating system, such as IOS™, ANDROID™, WINDOWS™ Phone, or another mobile operating system. In this example, the third party application 366 can invoke API calls 312 provided by the operating system 304 to enable the functionality described herein to be implemented.

[0075] 4 illustrates a schematic diagram of a machine 400 in the form of a computer system, according to an exemplary embodiment, within which a set of instructions may be executed to cause the machine 400 to perform any one or more of the methodologies discussed herein. Specifically, FIG. 4 illustrates a schematic diagram of a machine 400 in the exemplary form of a computer system, within which instructions 416 (e.g., software, programs, applications, applets, apps, or other executable code) may be executed to cause the machine 400 to perform any one or more of the methodologies discussed herein. For example, the instructions 416 may cause the machine 400 to perform method 200 of FIG. 2. Additionally or alternatively, the instructions 416 may implement FIGS. 1-2, etc. The instructions 416 transform a general, unprogrammed machine 400 into a specific machine 400 programmed to perform the functions described and illustrated in the described manner. In alternative embodiments, machine 400 operates as a stand-alone device, or machine 400 may be coupled (e.g., networked) to other machines. In a networked deployment, machine 400 may operate in the capacity of a server or a client machine in a server-client network environment, or as a peer machine in a peer-to-peer (or distributed) network environment.The machine 400 may comprise, without limitation, a server computer, a client computer, a personal computer (PC), a tablet computer, a laptop computer, a netbook, a set-top box (STB), a personal digital assistant (PDA), an entertainment media system, a cellular phone, a smartphone, a mobile device, a wearable device (e.g., a smart watch), a smart home device (e.g., a smart appliance), other smart devices, a web appliance, a network router, a network switch, a network bridge, or any machine capable of sequentially or otherwise executing instructions 416 that specify actions to be taken by the machine 400. Furthermore, although only a single machine 400 is illustrated, the term "machine" shall be taken to include a collection of machines 400 that individually or jointly execute instructions 416 to perform any one or more of the methodologies discussed herein.

[0076] Machine 400 may include processor 410, memory 430, and I / O components 450, which may be configured to communicate with each other, such as via bus 402. In an exemplary embodiment, processor 410 (e.g., a central processing unit (CPU), a reduced instruction set computing (RISC) processor, a complex instruction set computing (CISC) processor, a graphics processing unit (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a radio frequency integrated circuit (RFIC), another processor, or any suitable combination thereof) may include, for example, processor 412 and processor 414, which may execute instructions 416. The term "processor" is intended to include multi-core processors, which may include two or more independent processors (sometimes referred to as "cores") that can simultaneously execute instructions 416. Although FIG. 4 shows multiple processors 410, machine 400 may include a single processor 412 with a single core, a single processor 412 with multiple cores (e.g., a multi-core processor 412), multiple processors 412, 414 with a single core, multiple processors 412, 414 with multiple cores, or any combination thereof.

[0077] Memory 430 may include a main memory 432, a static memory 434, and a storage unit 436, each accessible to processor 410, such as via bus 402. Main memory 432, static memory 434, and storage unit 436 store instructions 416 that embody any one or more of the methods or functions described herein. Instructions 416 may reside, in whole or in part, within main memory 432, within static memory 434, within storage unit 436, within at least one of processors 410 (e.g., within a processor's cache memory), or any suitable combination thereof, during their execution by machine 400.

[0078] I / O components 450 may include a wide variety of components for receiving input, providing output, generating output, transmitting information, exchanging information, capturing measurements, etc. The specific I / O components 450 included within a particular machine will vary depending on the type of machine. For example, a portable machine such as a mobile phone may include a touch input device or other such input mechanism, while a headless server machine may not include such a touch input device. It will be understood that I / O components 450 may include many other components not shown in FIG. 4 . I / O components 450 are grouped according to function solely to simplify the following discussion, and such grouping is in no way limiting. In various exemplary embodiments, I / O components 450 may include an output component 452 and an input component 454. Output components 452 can include visual components (e.g., a display such as a plasma display panel (PDP), a light-emitting diode (LED) display, a liquid crystal display (LCD), a projector, or a cathode ray tube (CRT)), acoustic components (e.g., speakers), haptic components (e.g., vibration motors, resistive mechanisms), other signal generators, etc. Input components 454 can include alphanumeric input components (e.g., a keyboard, a touchscreen configured to receive alphanumeric input, a photo-optical keyboard, or other alphanumeric input component), point-based input components (e.g., a mouse, touchpad, trackball, joystick, motion sensor, or another pointing device), tactile input components (e.g., physical buttons, a touchscreen that indicates the location and / or force of a touch or touch gesture, or other tactile input component), audio input components (e.g., a microphone), etc.

[0079] In a further exemplary embodiment, I / O component 450 may include a biometric component 456, a motion component 458, an environmental component 460, or a position component 462, among many other components. For example, biometric component 456 may include components for detecting expressions (e.g., hand expressions, facial expressions, vocal expressions, body gestures, or eye tracking), measuring biosignals (e.g., blood pressure, heart rate, body temperature, sweat, or brain waves), identifying a person (e.g., voice identification, retinal identification, facial identification, fingerprint identification, or electroencephalogram-based identification), etc. Motion component 458 may include an acceleration sensor component (e.g., an accelerometer), a gravity sensor component, a rotation sensor component (e.g., a gyroscope), etc. The environmental components 460 may include, for example, an illuminance sensor component (e.g., a photometer), a temperature sensor component (e.g., one or more thermometers that detect ambient temperature), a humidity sensor component, a pressure sensor component (e.g., a barometer), an acoustic sensor component (e.g., one or more microphones that detect background noise), a proximity sensor component (e.g., an infrared sensor that detects nearby objects), a gas sensor (e.g., a gas detection sensor for detecting concentrations of harmful gases for safety purposes or for measuring pollutants in the air), or other components that can provide indications, measurements, or signals corresponding to the surrounding physical environment. The position component 462 may include a location sensor component (e.g., a global positioning system (GPS) receiver component), an altitude sensor component (e.g., an altimeter or a barometer that detects air pressure from which altitude can be derived), an orientation sensor component (e.g., a magnetometer), etc.

[0080] Communication can be implemented using a wide variety of technologies. I / O component 450 can include a communication component 464 operable to couple machine 400 to network 480 or device 470 via coupling 482 and coupling 472, respectively. For example, communication component 464 can include a network interface component or another device suitable for interfacing with network 480. In further examples, communication component 464 can include a wired communication component, a wireless communication component, a cellular communication component, a near field communication (NFC) component, a Bluetooth® component (e.g., Bluetooth Low Energy), a Wi-Fi® component, and other communication components for communicating via other modalities. Device 470 can be another machine or any of a wide variety of peripheral devices (e.g., coupled via USB).

[0081] Further, communication component 464 may detect an identifier or may include a component operable to detect an identifier. For example, communication component 464 may include a radio frequency identification (RFID) tag reader component, an NFC smart tag detection component, an optical reader component (e.g., an optical sensor for detecting one-dimensional barcodes such as Universal Product Code (UPC) barcodes, multidimensional barcodes such as QR Code™, Aztec Code, Data Matrix, Dataglyph, MaxiCode, PDF417, Ultra Code, UCC RSS-2D barcodes, and other optical codes), or an acoustic detection component (e.g., a microphone for identifying tagged audio signals). Additionally, a variety of information may be obtained via communication component 464, such as location via Internet Protocol (IP) geolocation, location via triangulation with Wi-Fi® signals, and location via detection of NFC beacon signals that can indicate a specific location.

[0082] Various memories (e.g., 430, 432, 434, and / or memory of processor 410) and / or storage unit 436 may store one or more sets of instructions 416 and data structures (e.g., software) that embody or are utilized by any one or more of the methods or functions described herein. These instructions (e.g., instructions 416), when executed by processor 410, cause various operations to be performed to implement the disclosed embodiments.

[0083] As used herein, the terms “machine storage medium,” “device storage medium,” and “computer storage medium” mean the same thing and are sometimes used interchangeably. These terms refer to a single or multiple storage devices and / or media (e.g., a centralized or distributed database, and / or associated caches and servers) that store executable instructions and / or data. Accordingly, these terms should be interpreted to include, but are not limited to, solid-state memory and optical and magnetic media, including memory internal or external to a processor. Specific examples of machine storage medium, computer storage medium, and / or device storage medium include, by way of example, semiconductor memory devices, non-volatile memory including, for example, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), field programmable gate arrays (FPGA), and flash memory devices; magnetic disks, such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The terms "machine storage medium," "computer storage medium," and "device storage medium" expressly exclude carrier waves, modulated data signals, and other such media, at least some of which are covered by the term "signal media" discussed below.

[0084] In various exemplary embodiments, one or more portions of network 480 may be an ad-hoc network, an intranet, an extranet, a virtual private network (VPN), a local area network (LAN), a wireless LAN (WLAN), a wide area network (WAN), a wireless WAN (WWAN), a metropolitan area network (MAN), the Internet, a portion of the Internet, a portion of the public switched telephone network (PSTN), a plain old telephone service (POTS) network, a cellular telephone network, a wireless network, a Wi-Fi network, another type of network, or a combination of two or more such networks. For example, network 480 or a portion of network 480 may include a wireless or cellular network, and coupling 482 may be a code division multiple access (CDMA) connection, a global system for mobile communications (GSM) connection, or another type of cellular or wireless coupling. In this example, coupling 482 may implement any of a variety of types of data transfer technologies, such as single-carrier radio transmission technology (1xRTT), Evolution-Data Optimized (EVDO) technology, General Packet Radio Service (GPRS) technology, Enhanced Data Rates for GSM Evolution (EDGE) technology, 3G networks, 3rd Generation Partnership Project (3GPP)™ including Fourth Generation Wireless (4G) networks, Universal Mobile Telecommunications System (UMTS), High Speed ​​Packet Access (HSPA), Worldwide Interoperability for Microwave Access (WiMAX), Long Term Evolution (LTE) standards, others defined by various standards bodies, other long-range protocols, or other data transfer technologies.

[0085] The instructions 416 may be transmitted or received over the network 480 using a transmission medium via a network interface device (e.g., a network interface component included in the communications component 464) and utilizing any one of several well-known transfer protocols (e.g., HTTP). Similarly, the instructions 416 may be transmitted or received using a transmission medium to the device 470 via a connection 472 (e.g., a peer-to-peer connection). The terms “transmission medium” and “signal medium” mean the same thing and may be used interchangeably in this disclosure. The terms “transmission medium” and “signal medium” shall be interpreted to include any intangible medium capable of storing, encoding, or carrying the instructions 416 so that they may be executed by the machine 400, as well as digital or analog communications signals or other intangible media for facilitating the communication of such software. Accordingly, the terms “transmission medium” and “signal medium” shall be interpreted to include any form of modulated data signal, carrier wave, etc. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information within the signal.

[0086] The terms "machine-readable medium," "computer-readable medium," and "device-readable medium" mean the same thing and may be used interchangeably in this disclosure. These terms are defined to include both machine storage media and transmission media. Thus, these terms include both storage devices / storage media and carrier wave / modulated data signals. [Explanation of symbols]

[0087] 100 systems 102 Application Development Server 104 Application Development Client 106 Software Applications 108 Library 110 Code Repositories 112 Code Generation Components 114 Graphical User Interface, GUI 116 LLM 118 Language Server 120 Cash 122 Parser Generator Tools 200 ways 300 Block Diagram 302 Software Architecture 304 Operating System 306 Library 308 Framework 310 Applications 312 API Call 314 Messages 320 Kernel 322 Service 324 Driver 330 System Library 332 API Library 334 Other Libraries 350 Home Applications 352 Contact Application 354 Browser Applications 356 Book Reader Application 358 Location Applications 360 Media Applications 362 messaging application 364 Game Application 366 Third-Party Applications 400 machines 402 Bus 410 processor 412 processors, multi-core processors 414 processor 416 Command 430 memory 432 main memory 434 Static Memory 436 Memory Unit 450 Input / Output (I / O) Components 452 Output Component 454 Input Component 456 Biometric Components 458 Movement Components 460 Environmental Components 462 Position Component 464 Communication Components 470 devices 472 Combine 480 Network 482 Combine

Claims

1. 1. A system comprising: at least one hardware processor; and a non-tangible computer-readable medium storing instructions that, when executed by the at least one hardware processor, cause the at least one hardware processor to: receiving a request to generate computer code on behalf of a user; In response to said receiving, identifying a first file currently being edited by said user; sending an identification of the first file to a language server along with a command to parse the first file to identify one or more artifacts in the first file; receiving a list of one or more identified artifacts from the language server; sending a command to the language server to identify one or more code snippets stored in a code repository that are associated with the identified one or more artifacts; receiving, from the language server, identification of the one or more code snippets associated with the identified one or more artifacts; generating a prompt for a large language model (LLM), the prompt including an instruction to generate a code based on using the identified one or more artifacts as a context; sending the prompt to the LLM; and receiving generated compilable code from the LLM; A system that performs an operation including:

2. 2. The system of claim 1, wherein receiving the request includes receiving a command from a graphical user interface with which the user is currently interacting, the command being generated based on an explicit request from the user.

3. 2. The system of claim 1, wherein receiving the request includes receiving a command from a graphical user interface with which the user is currently interacting, the command being generated without an explicit request from the user.

4. The operation, in response to receiving the request, identifying context information about the edit of the first file; further comprising and transmitting the identification information to the language server further comprises transmitting the context information about the edit of the first file to the language server. The system of claim 1.

5. The system of claim 4 , wherein the context information includes a location of a cursor within the first file displayed within a graphical user interface being manipulated by the user.

6. 5. The system of claim 4, wherein the identification of the one or more code snippets associated with the identified one or more artifacts is limited to only identification of code snippets that are associated based on the context information.

7. The system of claim 1 , wherein at least one of the one or more code snippets is contained within a file that is currently closed.

8. 1. A method comprising: receiving a request to generate computer code on behalf of a user; In response to said receiving step, identifying a first file currently being edited by said user; sending an identification of the first file to a language server along with a command to parse the first file to identify one or more artifacts in the first file; receiving a list of one or more identified artifacts from the language server; sending a command to the language server to identify one or more code snippets stored in a code repository that are associated with the identified one or more artifacts; receiving, from the language server, identification of the one or more code snippets associated with the identified one or more artifacts; generating a prompt for a large language model (LLM), the prompt including an instruction to generate a code based on using the identified one or more artifacts as a context; sending the prompt to the LLM; receiving generated compilable code from the LLM; A method comprising:

9. 9. The method of claim 8, wherein receiving the request comprises receiving a command from a graphical user interface with which the user is currently interacting, the command being generated based on an explicit request from the user.

10. 9. The method of claim 8, wherein receiving the request comprises receiving a command from a graphical user interface with which the user is currently interacting, the command being generated without an explicit request from the user.

11. In response to receiving the request, identifying context information about the edit of the first file; further comprising the step of transmitting identification information to the language server further comprises transmitting the context information about the edit of the first file to the language server. The method of claim 8.

12. The method of claim 11 , wherein the context information includes a location of a cursor within the first file displayed within a graphical user interface being manipulated by the user.

13. 13. The method of claim 12, wherein the identification of the one or more code snippets that are relevant to the identified one or more artifacts is limited to only identification of code snippets that are relevant based on the context information.

14. The method of claim 8 , wherein at least one of the one or more code snippets is contained within a currently closed file.

15. A non-transitory machine-readable medium storing instructions that, when executed by one or more processors, cause the one or more processors to: receiving a request to generate computer code on behalf of a user; In response to said receiving, identifying a first file currently being edited by said user; sending an identification of the first file to a language server along with a command to parse the first file to identify one or more artifacts in the first file; receiving a list of one or more identified artifacts from the language server; sending a command to the language server to identify one or more code snippets stored in a code repository that are associated with the identified one or more artifacts; receiving, from the language server, identification of the one or more code snippets associated with the identified one or more artifacts; generating a prompt for a large language model (LLM), the prompt including an instruction to generate a code based on using the identified one or more artifacts as a context; sending the prompt to the LLM; receiving generated compilable code from the LLM; A non-transitory machine-readable medium for performing operations including:

16. 16. The non-transitory machine-readable medium of claim 15, wherein receiving the request comprises receiving a command from a graphical user interface with which the user is currently interacting, the command being generated based on an explicit request from the user.

17. 16. The non-transitory machine-readable medium of claim 15, wherein receiving the request comprises receiving a command from a graphical user interface with which the user is currently interacting, the command being generated without an explicit request from the user.

18. The operation, in response to receiving the request, identifying context information about the edit of the first file; further comprising and transmitting the identification information to the language server further comprises transmitting the context information about the edit of the first file to the language server.

16. The non-transitory machine-readable medium of claim 15.

19. 20. The non-transitory machine-readable medium of claim 18, wherein the context information includes a location of a cursor within the first file displayed within a graphical user interface being manipulated by the user.

20. 20. The non-transitory machine-readable medium of claim 19, wherein the identification of the one or more code snippets associated with the identified one or more artifacts is limited to only identification of code snippets that are associated based on the context information.

Citation Information

Patent Citations

  • Systems and methods for software analysis

    JP2017520842A

  • Code completion

    US20200097261A1

  • Systems and methods for a conversational framework of program synthesis

    WO2023172817A1