Add unknown ranges and open object values
This commit is contained in:
@@ -7,7 +7,7 @@ use std::{
|
||||
|
||||
use decodal::{
|
||||
Diagnostic as DecodalDiagnostic, DiagnosticKind, HostEnvironment, ImportCandidate,
|
||||
ImportLoader, LoadedImport, LoadedSource, SourceId, Span,
|
||||
ImportLoader, LoadedImport, SourceId, Span,
|
||||
};
|
||||
use decodal_language_service::{
|
||||
CompletionKind as ServiceCompletionKind, CompletionResult, LanguageService, SemanticAnalysis,
|
||||
@@ -667,11 +667,11 @@ impl ImportLoader for FileSystemLoader {
|
||||
)
|
||||
})?
|
||||
};
|
||||
Ok(LoadedImport::Source(LoadedSource {
|
||||
Ok(LoadedImport::Source {
|
||||
key: key.clone(),
|
||||
name: key,
|
||||
source,
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
fn complete_import(
|
||||
@@ -743,7 +743,7 @@ mod tests {
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use decodal::{Engine, HostValue};
|
||||
use decodal::{Engine, Value};
|
||||
use lsp_server::RequestId;
|
||||
use serde_json::json;
|
||||
|
||||
@@ -772,12 +772,12 @@ mod tests {
|
||||
.is_some_and(|source| source == "draft: false");
|
||||
Ok(LoadedImport::value(
|
||||
"content/post.md",
|
||||
HostValue::object([(
|
||||
Value::object([(
|
||||
"draft",
|
||||
if draft {
|
||||
HostValue::bool(false)
|
||||
Value::bool(false)
|
||||
} else {
|
||||
HostValue::string("maybe")
|
||||
Value::string("maybe")
|
||||
},
|
||||
)]),
|
||||
))
|
||||
@@ -794,10 +794,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn configure_engine(&self, engine: &mut Engine<Self::Loader>) -> decodal::Result<()> {
|
||||
engine.bind_global(
|
||||
"Post",
|
||||
HostValue::object([("draft", HostValue::bool_type())]),
|
||||
)?;
|
||||
engine.bind_global("Post", Value::object([("draft", Value::bool_type())]))?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user