fix: incorrect offset in build prompt when fim disabled (#6)

This commit is contained in:
Luc Georges 2023-08-27 10:16:27 +02:00 committed by GitHub
parent 073be09042
commit de459b3789
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "llm-ls"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -241,7 +241,7 @@ fn build_prompt(
let mut token_count = context_window;
let mut before = vec![];
let mut first = true;
for mut line in text.lines_at(pos.line as usize).reversed() {
for mut line in text.lines_at(pos.line as usize + 1).reversed() {
if first {
line = line.slice(0..pos.character as usize);
first = false;
@ -426,7 +426,7 @@ impl LanguageServer for Backend {
Ok(InitializeResult {
server_info: Some(ServerInfo {
name: "llm-ls".to_owned(),
version: Some("0.1.0".to_owned()),
version: Some("0.1.1".to_owned()),
}),
capabilities: ServerCapabilities {
text_document_sync: Some(TextDocumentSyncCapability::Kind(