Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A Language Server Protocol (LSP) implementation for [Comline](https://github.com

- **Diagnostics** - Real-time syntax errors plus `comline-core`'s validation pass (undefined types, duplicate declarations, ...) — the same checks `comline build` runs. A type from another file of the package used without a `use` gets a specific error with an **"Add `use ...`" quick fix**
- **Whole-package analysis** - every `.ids` file in a package's `src/` takes part, open or not, kept current through file watching; each package only sees its own files
- **Dependency packages** - the dependencies `config.idp` declares are indexed (path dependencies, and git pins `comline check` has fetched; the editor never fetches), so imports, hover, go-to-definition and completion work into them under the dependency's name. Unresolved imports are errors, worded like `comline check`'s, with a "did you mean" quick fix; imports of a dependency that isn't fetched yet are marked as not checked, and its `config.idp` entry says why. A dependency whose `@unverified` protocols aren't accepted is an error on its entry, with a quick fix that writes the `accept_unverified` line `comline accept` would
- **Dependency packages** - the dependencies `config.idp` declares are indexed (path dependencies, and git pins `comline check` has fetched; the editor never fetches), so imports, hover, go-to-definition and completion work into them under the dependency's name. Unresolved imports are errors, worded like `comline check`'s, with a "did you mean" quick fix; imports of a dependency that isn't fetched yet are marked as not checked, and its `config.idp` entry says why. A dependency whose `@unverified` protocols aren't accepted is an error on its entry, with a quick fix that writes the `accept_unverified` line `comline deps accept` would
- **Standard library** - `use std::…` resolves against the std embedded in `comline-core`, like a read-only dependency: hover, go-to-definition (into virtual `comline-std:` documents, whose text clients fetch with the `comline/stdSource` request), completion, and unresolved-import errors worded like `comline check`'s (`std has no schema matching 'std::htp::Request' - did you mean 'std::http'?`)
- **Module docs** - a schema documents itself with `//!` lines at its top, a package with the same at the top of its `config.idp`. Hover any segment of a path (`std`, `validators` in `use std::validators::StringBounds`, or in a qualified type name) for that module's docs, the modules below it and the types it declares; `use` completion shows the same docs beside each module and declaration. `std` and each of its modules are documented this way
- **Document Symbols** - Hierarchical outline view of structs, enums, protocols, and constants
Expand Down
4 changes: 2 additions & 2 deletions src/acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! `comline check` refuses a dependency whose `@unverified` protocols the
//! consumer hasn't accepted, for exactly the guarantees they give up. The
//! editor says so on the dependency's entry, and offers a quick fix that
//! writes the `accept_unverified` line `comline accept` would.
//! writes the `accept_unverified` line `comline deps accept` would.
//!
//! What a protocol gives up is worked out by core, so the dependency is
//! compiled as its own package (its own settings and default handshake),
Expand Down Expand Up @@ -242,7 +242,7 @@ fn render(accepted: &BTreeMap<String, Vec<Guarantee>>) -> String {
}

/// `manifest` with `name`'s entry carrying `accept_unverified = accepted`,
/// replacing one already there - the edit `comline accept` makes. Every
/// replacing one already there - the edit `comline deps accept` makes. Every
/// other byte is left as written.
fn with_acceptance(
manifest: &str,
Expand Down
12 changes: 6 additions & 6 deletions src/analysis/comline_toml.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! `comline.toml`: the consumer's code-generation config, checked the way
//! `comline generate` reads it.
//! `comline generation` reads it.
//!
//! The file's shape comes from `comline_codegen::config` - its types, and the
//! JSON Schema derived from them - so every key, type and enum value here is
Expand Down Expand Up @@ -42,7 +42,7 @@ pub const WRONG_TYPE: &str = "comline-toml::wrong-type";
pub const BAD_VALUE: &str = "comline-toml::bad-value";
/// A key that moved out of `comline.toml`.
pub const MOVED_KEY: &str = "comline-toml::moved-key";
/// Anything else `comline generate` refuses in the file's shape.
/// Anything else `comline generation` refuses in the file's shape.
pub const INVALID: &str = "comline-toml::invalid";
/// A language `config.idp` doesn't declare.
pub const UNDECLARED_LANGUAGE: &str = "comline-toml::undeclared-language";
Expand Down Expand Up @@ -180,7 +180,7 @@ impl Context {
}
if complete {
// As core's compiler freezes them, and each framing judged by
// its declaration's frozen facts, as `comline generate` does.
// its declaration's frozen facts, as `comline generation` does.
let mut units: Vec<&mut [comline_core::schema::ir::frozen::unit::FrozenUnit]> = schemas
.iter_mut()
.map(|(_, units)| units.as_mut_slice())
Expand Down Expand Up @@ -1118,7 +1118,7 @@ fn semantic(analysis: &mut Analysis, context: &Context) {
.filter(|e| e.path == ["generate", "only"])
.filter_map(|e| e.text.clone())
.collect();
// (language, block) for every target `comline generate` would build.
// (language, block) for every target `comline generation` would build.
let mut targets: Vec<(String, Option<usize>)> = Vec::new();
let block_language = |i: usize| {
analysis
Expand Down Expand Up @@ -1540,7 +1540,7 @@ mod tests {
use crate::analysis::source::SourceFile;
// A dependency declares `com.acme.lines@1`, its profile beside its
// config.idp: whether it writes JSON is that profile's `payload`,
// frozen on the declaration, as `comline generate` reads it.
// frozen on the declaration, as `comline generation` reads it.
let used = |payload: Option<&str>| {
let root = std::env::temp_dir().join(format!(
"comline-lsp-framing-facts-{}-{}",
Expand Down Expand Up @@ -1599,7 +1599,7 @@ encodings = {
assert!(!opaque.contains("json@1"), "{opaque:?}");
// A profile the editor can't read states nothing.
assert!(!used(None).contains("json@1"));
// The same set `comline generate` resolves through generation.
// The same set `comline generation` resolves through generation.
let mut schemas = vec![(
"app".to_string(),
IncrementalInterpreter::from_declarations(
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn feature_diagnostics(
DiagnosticSeverity::WARNING,
UNSUPPORTED_FEATURE,
format!(
"{} can't be generated for `{target}`{} - `comline generate` refuses this schema for it",
"{} can't be generated for `{target}`{} - `comline generation` refuses this schema for it",
u.feature.title(),
detail(&declared.language, &s)
),
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub struct DeclaredLanguage {
}

/// Every language `config.idp`'s text declares, read with core's own
/// interpreter, as `comline generate` reads them. Empty when the manifest
/// interpreter, as `comline generation` reads them. Empty when the manifest
/// doesn't parse (mid-edit) or doesn't interpret.
/// The edition `config.idp` names (core#102), as core reads it: the newest
/// when the manifest names none it knows or doesn't parse - `config.idp`'s
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/comline_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@ pub fn code_actions(
}

/// "Check generator" on `generator = "<written>"`: would run its `Describe`,
/// sandboxed as `comline generate` runs a `.wasm`. The language server
/// sandboxed as `comline generation` runs a `.wasm`. The language server
/// doesn't embed that sandbox (wasmtime), and never runs a native
/// generator, so the action is offered disabled, saying why.
pub fn check_generator(written: &str) -> CodeAction {
let reason = if written.ends_with(".wasm") {
"not available in the editor yet: the language server doesn't embed the wasm sandbox. Run \
`comline generate`, which describes it sandboxed"
`comline generation`, which describes it sandboxed"
.to_string()
} else {
"only a `.wasm` generator can be checked, sandboxed - the editor never runs a native generator".to_string()
Expand Down
Loading