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
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ serde_json = "1.0"
# Pure Rust, so the analysis library still builds for wasm32. The same
# release line `comline-codegen`'s `toml` 0.8 parses with.
toml_edit = { version = "0.22", default-features = false, features = ["parse"] }
comline-core = { git = "https://github.com/ComlineProject/core", rev = "868e8310e33df317e3cba4f76b81fbcd8639c1c2" }
comline-core = { git = "https://github.com/ComlineProject/core", rev = "14ce54658455206d639ddc4fbe6d609d20292587" }
# What each generator supports, feature by feature (`comline_codegen::features`)
# - for warning at a use a declared language can't generate. Only the
# generators' `SUPPORT` tables are read; nothing is generated. Pinned to the
# same commits as the CLI, so a build has one `comline-codegen`.
comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "922847b608764687b9d75020ff46a3f24d43b5bd" }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "ac7fd8b3deaa334d353485414264eb9336500bb9" }
comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "4db92c26b00211aabf90e4ef1b2f55977274d761" }
comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "dd1c29e6560a0ffd7893c59715b31d43b88c585f" }
comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "d377fbf07cf6c0f004e9d5dd4fbd6fa15ea9d0bc" }

# `server`-only.
tower-lsp = { version = "0.20.0", optional = true }
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A Language Server Protocol (LSP) implementation for [Comline](https://github.com

### ✅ Fully Implemented

- **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**
- **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**; a `use` that reaches one of the package's own schemas by a bare path (`use types::User` instead of `use package::types::User`) is an error with a **"Write `package::…`" 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 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'?`)
Expand Down Expand Up @@ -232,12 +232,20 @@ A `use` path completes one segment at a time, resolved the way
`comline check` resolves it:

```comline
use // → the package's namespaces, its dependencies, self / parent / package, std
use // → its dependencies, self / parent / package, std
use package:: // → the package's own schemas
use shared:: // → what's under the `shared` dependency
use api::common:: // → what `api::common` declares, then `*` and `{…}`
use api::common::{Error, // → what `api::common` declares that isn't listed yet
use package::api::common:: // → what `api::common` declares, then `*` and `{…}`
use package::api::common::{Error, // → what `api::common` declares that isn't listed yet
```

The package's own schemas are reached only as `package::…`, `parent::…` or
`self::…`, so they are offered under those and not at the top. A bare path to
one of them (`use types::User`) is the error `import::bare-own-schema-path`,
the same one `comline check` reports, and its quick fix writes `package::` in
front. The "Add `use …`" fix and a type's auto-import write `package::…` for the
package's own schemas, and a dependency's or `std`'s path as it is.

A dependency that isn't fetched yet is offered, marked as such, with nothing
under it until `comline check` fetches it.

Expand Down
Loading
Loading