diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ce9d1120..56d022410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added +- Added a [Features](https://aviatesk.github.io/JETLS.jl/dev/features/) overview page to the documentation, providing a visual showcase of every LSP feature JETLS provides. + - Added `textDocument/declaration` ("go to declaration"). It jumps to the import site on an imported name (e.g. `using Base: sin`) and to the `local` line on a `local` declaration. When the symbol has no dedicated declaration site, the request falls back to the same logic as `textDocument/definition`. - Added `textDocument/documentLink` support for `include("path")` and `include_dependency("path")` calls. The path string becomes a clickable link that opens the referenced file. Only non-interpolated string arguments whose path resolves to an existing file (relative to the current file's directory) are surfaced. diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 6457722fe..091c153d8 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -29,7 +29,7 @@ without restarting the server. In JETLS, since we need to use packages that aren’t yet registered (e.g., [JuliaLowering.jl](https://github.com/JuliaLang/julia/tree/master/JuliaLowering)) or -specific branches of [JET.jl](https://github.com/c42f/JuliaLowering.jl) and +specific branches of [JET.jl](https://github.com/aviatesk/JET.jl) and [JuliaSyntax.jl](https://github.com/JuliaLang/julia/tree/master/JuliaSyntax), the [Project.toml](./Project.toml) includes [`[sources]` section](https://pkgdocs.julialang.org/v1/toml-files/#The-[sources]-section). diff --git a/README.md b/README.md index e752c03e5..11fdd72ba 100644 --- a/README.md +++ b/README.md @@ -34,108 +34,6 @@ a sample VSCode extension that serves as a language client for testing JETLS. For end-user documentation including installation instructions, configuration options, and feature guides, please visit the **[user guide documentation](https://aviatesk.github.io/JETLS.jl/)**. -This README focuses on development-related information such as the project -roadmap, implementation status, and developer resources. - -## Roadmap - -This is a summary of currently implemented features and features that will -likely be implemented in the near future, for those who want to test this server. -Please note that not only the progress of the list, but also the structure of -the list itself is subject to change. - -- Analysis - - [x] Document synchronization - - [ ] (WIP) Incremental analysis - - [ ] JuliaLowering integration - - [ ] Recursive analysis for dependencies - - [ ] Cross-server-process cache system - - [ ] Support package extensions -- Diagnostic - - [x] Syntax errors - - [x] Lowering errors - - [x] Macro expansion error - - [x] Unused bindings (with code action) - - [x] Captured boxed variables - - [x] Unsorted import statements (with code action) - - [x] Unused imported names (with code action) - - [ ] Undefined imported names - - [ ] Undefined exported names - - [x] Method overwrite - - [x] Abstract struct field - - [x] Undefined bindings - - [x] Non-existent struct fields - - [x] Out-of-bounds field access by index - - [x] `MethodError` - - [x] Configuration support - - [x] [CLI interface](https://aviatesk.github.io/JETLS.jl/release/cli-check) -- Completion - - [x] Global symbol completion - - [x] Local binding completion - - [x] LaTeX/Emoji completion - - [x] Method signature completion - - [ ] (WIP) Argument type based matched method filtering - - [x] [Juno](https://junolab.org/)-like return type annotation for method completions - - [x] Keyword argument name completion - - [ ] Property completion -- Signature help - - [x] Basic implementation - - [x] Macro support - - [ ] (WIP) Argument type based matched method filtering -- Definition - - [x] Method defintion - - [x] Global binding definition - - [x] Local binding definition - - [ ] Type-aware method definition -- Hover - - [x] Method documentation - - [x] Global binding documentation - - [x] Local binding location - - [ ] Type of local binding - - [ ] Type-aware method documentation -- Inlay hint - - [ ] Method parameter name - - [ ] Type of binding -- Formatting - - [x] [Runic](https://github.com/fredrikekre/Runic.jl) integration - - [x] [JuliaFormatter](https://github.com/domluna/JuliaFormatter.jl) integration - - [x] Make formatting backend configurable -- Document highlight - - [x] Local binding - - [x] Global binding - - [ ] Field name / Dot-accessed bindings -- Find references / Rename - - [x] Local binding - - Global reference - - [x] Minimum support - - [ ] Cross-analysis-unit reference detection - - [ ] Aliased reference support - - [ ] Field name - - [x] File rename support (Julia-side rename) - - [ ] File rename support (external rename) -- [x] Document symbol -- [x] Workspace symbol -- TestRunner.jl integration - - [x] Code lens for running individual `@testset`s - - [x] Code actions for running individual `@testset`s - - [x] Code actions for running individual `@test` cases - - [x] Inline test result diagnostics -- Configuration system - - [x] Type stable config object implementation - - [x] Support LSP configurations - - [x] Documentation - - [x] Schema support -- [x] Parallel/concurrent message handling -- [x] Work done progress support -- [x] Message cancellation support -- [x] Notebook support -- Release - - [x] Publish a standalone VSCode language client extension - - [x] Make installable as Pkg executable app - - [x] Environment isolution - - [ ] Automatic server installation/update for `jetls-client` - - [ ] Integration into [julia-vscode](https://github.com/julia-vscode/julia-vscode) - ## Development notes The following documents contain specific items that should be referenced when diff --git a/docs/make.jl b/docs/make.jl index feb2348df..d9d4e20a5 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -61,6 +61,7 @@ end const pages = Any[ "Index" => "index.md", + "Features" => "features.md", "Diagnostic" => "diagnostic.md", "Formatter integration" => "formatting.md", "TestRunner integration" => "testrunner.md", diff --git a/docs/src/assets/features/code-actions-soft-scope-dark.png b/docs/src/assets/features/code-actions-soft-scope-dark.png new file mode 100644 index 000000000..77f85960a Binary files /dev/null and b/docs/src/assets/features/code-actions-soft-scope-dark.png differ diff --git a/docs/src/assets/features/code-actions-soft-scope.png b/docs/src/assets/features/code-actions-soft-scope.png new file mode 100644 index 000000000..4eb8b5f9b Binary files /dev/null and b/docs/src/assets/features/code-actions-soft-scope.png differ diff --git a/docs/src/assets/features/code-actions-sort-imports-dark.png b/docs/src/assets/features/code-actions-sort-imports-dark.png new file mode 100644 index 000000000..44e04f7ec Binary files /dev/null and b/docs/src/assets/features/code-actions-sort-imports-dark.png differ diff --git a/docs/src/assets/features/code-actions-sort-imports.png b/docs/src/assets/features/code-actions-sort-imports.png new file mode 100644 index 000000000..7e1607dd3 Binary files /dev/null and b/docs/src/assets/features/code-actions-sort-imports.png differ diff --git a/docs/src/assets/features/code-actions-unused-arg-dark.png b/docs/src/assets/features/code-actions-unused-arg-dark.png new file mode 100644 index 000000000..0c1fe7ca1 Binary files /dev/null and b/docs/src/assets/features/code-actions-unused-arg-dark.png differ diff --git a/docs/src/assets/features/code-actions-unused-arg.png b/docs/src/assets/features/code-actions-unused-arg.png new file mode 100644 index 000000000..abbc3e645 Binary files /dev/null and b/docs/src/assets/features/code-actions-unused-arg.png differ diff --git a/docs/src/assets/features/code-lens-references-dark.png b/docs/src/assets/features/code-lens-references-dark.png new file mode 100644 index 000000000..3b0e72d12 Binary files /dev/null and b/docs/src/assets/features/code-lens-references-dark.png differ diff --git a/docs/src/assets/features/code-lens-references.png b/docs/src/assets/features/code-lens-references.png new file mode 100644 index 000000000..17e0f80ad Binary files /dev/null and b/docs/src/assets/features/code-lens-references.png differ diff --git a/docs/src/assets/features/code-lens-testrunner-dark.png b/docs/src/assets/features/code-lens-testrunner-dark.png new file mode 100644 index 000000000..875f0a0c7 Binary files /dev/null and b/docs/src/assets/features/code-lens-testrunner-dark.png differ diff --git a/docs/src/assets/features/code-lens-testrunner.png b/docs/src/assets/features/code-lens-testrunner.png new file mode 100644 index 000000000..3bb86f42e Binary files /dev/null and b/docs/src/assets/features/code-lens-testrunner.png differ diff --git a/docs/src/assets/features/completion-emoji-dark.png b/docs/src/assets/features/completion-emoji-dark.png new file mode 100644 index 000000000..f814af580 Binary files /dev/null and b/docs/src/assets/features/completion-emoji-dark.png differ diff --git a/docs/src/assets/features/completion-emoji.png b/docs/src/assets/features/completion-emoji.png new file mode 100644 index 000000000..222aab1f3 Binary files /dev/null and b/docs/src/assets/features/completion-emoji.png differ diff --git a/docs/src/assets/features/completion-global-local-dark.png b/docs/src/assets/features/completion-global-local-dark.png new file mode 100644 index 000000000..ba47f3963 Binary files /dev/null and b/docs/src/assets/features/completion-global-local-dark.png differ diff --git a/docs/src/assets/features/completion-global-local.png b/docs/src/assets/features/completion-global-local.png new file mode 100644 index 000000000..9f1b35576 Binary files /dev/null and b/docs/src/assets/features/completion-global-local.png differ diff --git a/docs/src/assets/features/completion-keyword-dark.png b/docs/src/assets/features/completion-keyword-dark.png new file mode 100644 index 000000000..fc12b4c58 Binary files /dev/null and b/docs/src/assets/features/completion-keyword-dark.png differ diff --git a/docs/src/assets/features/completion-keyword.png b/docs/src/assets/features/completion-keyword.png new file mode 100644 index 000000000..411cdc637 Binary files /dev/null and b/docs/src/assets/features/completion-keyword.png differ diff --git a/docs/src/assets/features/completion-latex-dark.png b/docs/src/assets/features/completion-latex-dark.png new file mode 100644 index 000000000..65239305e Binary files /dev/null and b/docs/src/assets/features/completion-latex-dark.png differ diff --git a/docs/src/assets/features/completion-latex.png b/docs/src/assets/features/completion-latex.png new file mode 100644 index 000000000..ee653daf6 Binary files /dev/null and b/docs/src/assets/features/completion-latex.png differ diff --git a/docs/src/assets/features/completion-method-dark.png b/docs/src/assets/features/completion-method-dark.png new file mode 100644 index 000000000..2584380ac Binary files /dev/null and b/docs/src/assets/features/completion-method-dark.png differ diff --git a/docs/src/assets/features/completion-method.png b/docs/src/assets/features/completion-method.png new file mode 100644 index 000000000..4d7f4ffeb Binary files /dev/null and b/docs/src/assets/features/completion-method.png differ diff --git a/docs/src/assets/features/definition-dark.png b/docs/src/assets/features/definition-dark.png new file mode 100644 index 000000000..fa819d35f Binary files /dev/null and b/docs/src/assets/features/definition-dark.png differ diff --git a/docs/src/assets/features/definition.png b/docs/src/assets/features/definition.png new file mode 100644 index 000000000..905f0a371 Binary files /dev/null and b/docs/src/assets/features/definition.png differ diff --git a/docs/src/assets/features/diagnostic-inference-dark.png b/docs/src/assets/features/diagnostic-inference-dark.png new file mode 100644 index 000000000..9035004f6 Binary files /dev/null and b/docs/src/assets/features/diagnostic-inference-dark.png differ diff --git a/docs/src/assets/features/diagnostic-inference.png b/docs/src/assets/features/diagnostic-inference.png new file mode 100644 index 000000000..233b60ee0 Binary files /dev/null and b/docs/src/assets/features/diagnostic-inference.png differ diff --git a/docs/src/assets/features/diagnostic-lowering-dark.png b/docs/src/assets/features/diagnostic-lowering-dark.png new file mode 100644 index 000000000..778602a9c Binary files /dev/null and b/docs/src/assets/features/diagnostic-lowering-dark.png differ diff --git a/docs/src/assets/features/diagnostic-lowering.png b/docs/src/assets/features/diagnostic-lowering.png new file mode 100644 index 000000000..d14c0c245 Binary files /dev/null and b/docs/src/assets/features/diagnostic-lowering.png differ diff --git a/docs/src/assets/features/diagnostic-syntax-dark.png b/docs/src/assets/features/diagnostic-syntax-dark.png new file mode 100644 index 000000000..eb24f8dde Binary files /dev/null and b/docs/src/assets/features/diagnostic-syntax-dark.png differ diff --git a/docs/src/assets/features/diagnostic-syntax.png b/docs/src/assets/features/diagnostic-syntax.png new file mode 100644 index 000000000..1bbac7213 Binary files /dev/null and b/docs/src/assets/features/diagnostic-syntax.png differ diff --git a/docs/src/assets/features/document-highlight-dark.png b/docs/src/assets/features/document-highlight-dark.png new file mode 100644 index 000000000..89fc74f1a Binary files /dev/null and b/docs/src/assets/features/document-highlight-dark.png differ diff --git a/docs/src/assets/features/document-highlight.png b/docs/src/assets/features/document-highlight.png new file mode 100644 index 000000000..846e28a3c Binary files /dev/null and b/docs/src/assets/features/document-highlight.png differ diff --git a/docs/src/assets/features/document-link-dark.png b/docs/src/assets/features/document-link-dark.png new file mode 100644 index 000000000..63e91ba1d Binary files /dev/null and b/docs/src/assets/features/document-link-dark.png differ diff --git a/docs/src/assets/features/document-link.png b/docs/src/assets/features/document-link.png new file mode 100644 index 000000000..0ca511d32 Binary files /dev/null and b/docs/src/assets/features/document-link.png differ diff --git a/docs/src/assets/features/document-symbol-dark.png b/docs/src/assets/features/document-symbol-dark.png new file mode 100644 index 000000000..fd9a729d8 Binary files /dev/null and b/docs/src/assets/features/document-symbol-dark.png differ diff --git a/docs/src/assets/features/document-symbol.png b/docs/src/assets/features/document-symbol.png new file mode 100644 index 000000000..05371a204 Binary files /dev/null and b/docs/src/assets/features/document-symbol.png differ diff --git a/docs/src/assets/features/find-references-dark.png b/docs/src/assets/features/find-references-dark.png new file mode 100644 index 000000000..8f79c0ecf Binary files /dev/null and b/docs/src/assets/features/find-references-dark.png differ diff --git a/docs/src/assets/features/find-references.png b/docs/src/assets/features/find-references.png new file mode 100644 index 000000000..63938fbc6 Binary files /dev/null and b/docs/src/assets/features/find-references.png differ diff --git a/docs/src/assets/features/hover-global-binding-dark.png b/docs/src/assets/features/hover-global-binding-dark.png new file mode 100644 index 000000000..6dfb02222 Binary files /dev/null and b/docs/src/assets/features/hover-global-binding-dark.png differ diff --git a/docs/src/assets/features/hover-global-binding.png b/docs/src/assets/features/hover-global-binding.png new file mode 100644 index 000000000..749954b29 Binary files /dev/null and b/docs/src/assets/features/hover-global-binding.png differ diff --git a/docs/src/assets/features/hover-local-binding-dark.png b/docs/src/assets/features/hover-local-binding-dark.png new file mode 100644 index 000000000..cb174415f Binary files /dev/null and b/docs/src/assets/features/hover-local-binding-dark.png differ diff --git a/docs/src/assets/features/hover-local-binding.png b/docs/src/assets/features/hover-local-binding.png new file mode 100644 index 000000000..ada584973 Binary files /dev/null and b/docs/src/assets/features/hover-local-binding.png differ diff --git a/docs/src/assets/features/inlay-hint-block-end-dark.png b/docs/src/assets/features/inlay-hint-block-end-dark.png new file mode 100644 index 000000000..53fa1fb9a Binary files /dev/null and b/docs/src/assets/features/inlay-hint-block-end-dark.png differ diff --git a/docs/src/assets/features/inlay-hint-block-end.png b/docs/src/assets/features/inlay-hint-block-end.png new file mode 100644 index 000000000..4c4eb82c3 Binary files /dev/null and b/docs/src/assets/features/inlay-hint-block-end.png differ diff --git a/docs/src/assets/features/notebook-support-dark.png b/docs/src/assets/features/notebook-support-dark.png new file mode 100644 index 000000000..0296df639 Binary files /dev/null and b/docs/src/assets/features/notebook-support-dark.png differ diff --git a/docs/src/assets/features/notebook-support.png b/docs/src/assets/features/notebook-support.png new file mode 100644 index 000000000..d0f3396e7 Binary files /dev/null and b/docs/src/assets/features/notebook-support.png differ diff --git a/docs/src/assets/features/refactoring-file-rename-dark.png b/docs/src/assets/features/refactoring-file-rename-dark.png new file mode 100644 index 000000000..615b5928d Binary files /dev/null and b/docs/src/assets/features/refactoring-file-rename-dark.png differ diff --git a/docs/src/assets/features/refactoring-file-rename.png b/docs/src/assets/features/refactoring-file-rename.png new file mode 100644 index 000000000..0c314d00a Binary files /dev/null and b/docs/src/assets/features/refactoring-file-rename.png differ diff --git a/docs/src/assets/features/refactoring-rename-dark.png b/docs/src/assets/features/refactoring-rename-dark.png new file mode 100644 index 000000000..c6e8c1137 Binary files /dev/null and b/docs/src/assets/features/refactoring-rename-dark.png differ diff --git a/docs/src/assets/features/refactoring-rename.png b/docs/src/assets/features/refactoring-rename.png new file mode 100644 index 000000000..f702fd1d7 Binary files /dev/null and b/docs/src/assets/features/refactoring-rename.png differ diff --git a/docs/src/assets/features/signature-help-dark.png b/docs/src/assets/features/signature-help-dark.png new file mode 100644 index 000000000..908814255 Binary files /dev/null and b/docs/src/assets/features/signature-help-dark.png differ diff --git a/docs/src/assets/features/signature-help.png b/docs/src/assets/features/signature-help.png new file mode 100644 index 000000000..43b85ce04 Binary files /dev/null and b/docs/src/assets/features/signature-help.png differ diff --git a/docs/src/assets/features/testrunner-integration-dark.png b/docs/src/assets/features/testrunner-integration-dark.png new file mode 100644 index 000000000..9c49290e1 Binary files /dev/null and b/docs/src/assets/features/testrunner-integration-dark.png differ diff --git a/docs/src/assets/features/testrunner-integration.png b/docs/src/assets/features/testrunner-integration.png new file mode 100644 index 000000000..82c4e911f Binary files /dev/null and b/docs/src/assets/features/testrunner-integration.png differ diff --git a/docs/src/assets/features/workspace-symbol-dark.png b/docs/src/assets/features/workspace-symbol-dark.png new file mode 100644 index 000000000..b8b1649ad Binary files /dev/null and b/docs/src/assets/features/workspace-symbol-dark.png differ diff --git a/docs/src/assets/features/workspace-symbol.png b/docs/src/assets/features/workspace-symbol.png new file mode 100644 index 000000000..025e7f1c5 Binary files /dev/null and b/docs/src/assets/features/workspace-symbol.png differ diff --git a/docs/src/configuration.md b/docs/src/configuration.md index 8b36153e7..a34eb022e 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -446,16 +446,10 @@ Configure code lens behavior. - **Type**: boolean - **Default**: `false` -Show reference counts for top-level symbols (functions, structs, constants, -abstract types, primitive types, modules). When enabled, JETLS displays a code -lens above each symbol showing how many times it is referenced in the codebase. - -Clicking the code lens dispatches the `editor.action.showReferences` command -(a VSCode convention) carrying the pre-resolved reference locations. Clients -that follow this convention (VSCode, Zed, etc.) open the references panel out -of the box; clients that don't (e.g. Neovim) need to register a client-side -handler for `editor.action.showReferences` — see the -[Neovim setup](@ref index/editor-setup/neovim) for an example. +Enable or disable the [reference-count code lens](@ref features/code-lens/references). +When enabled, JETLS displays a code lens above each top-level symbol +(functions, structs, constants, abstract/primitive types, modules) showing +how many times it is referenced in the codebase. ```toml [code_lens] diff --git a/docs/src/features.md b/docs/src/features.md new file mode 100644 index 000000000..5475e2afb --- /dev/null +++ b/docs/src/features.md @@ -0,0 +1,634 @@ +# [Features](@id features) + +This page provides an overview of the language server features that JETLS +offers. + +Screenshots on this page use VSCode (via the +[`jetls-client`](@ref index/editor-setup/vscode) extension), as its LSP UI +is the de facto reference. The same features work in any +[supported editor](@ref index/editor-setup), though the presentation may +differ.[^error_lens] + +[^error_lens]: + Some screenshots show diagnostic messages rendered inline next to + the affected line. This presentation is provided by the + [Error Lens](https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens) + VSCode extension, not by JETLS itself — JETLS reports the diagnostic + information through standard LSP channels, and the inline rendering + is up to the client. + +!!! note + JETLS is under active development. This page is not exhaustive and is + updated as features mature. For the current status of planned features, + see the [roadmap](https://publish.obsidian.md/jetls/work/JETLS/JETLS+roadmap). + +#### [Overview](@id features/overview) + +```@contents +Pages = ["features.md"] +Depth = 2:3 +``` + +## [Diagnostic](@id features/diagnostic) + +JETLS reports diagnostics from three analysis stages — syntax parsing, +lowering, and type inference — covering everything from malformed input +to deep type-level issues. Some diagnostics come with quick-fix +[code actions](@ref features/code-actions). See the +[Diagnostic](@ref diagnostic) reference for the full list of diagnostic +codes and examples. + +### [Syntax diagnostics](@id features/diagnostic/syntax) + +Parse errors detected by +[JuliaSyntax.jl](https://github.com/JuliaLang/JuliaSyntax.jl). + +> ```@raw html +>
| Trigger | Example |
|---|---|
LaTeX symbol (\) |
+
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+
Emoji (\:) |
+
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+
| Binding kind | Description | Example |
|---|---|---|
| Global binding | +Shows documentation from the binding's docstring along with its source location. | +
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+
| Local binding | +Shows the binding's definition location within the enclosing scope. | +
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+
| Symbol scope | Description | Example |
|---|---|---|
| Document symbol | +An outline view of the current file, listing modules, functions, methods, structs, constants, etc. | +
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+
| Workspace symbol | +Fuzzy-search across symbols in the whole workspace. | +
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+
| Code action | Triggered by | Example |
|---|---|---|
Prefix unused variable with _ |
++``` +[`lowering/unused-argument`](@ref diagnostic/reference/lowering/unused-argument) +```@raw html + | +
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+
Insert global / local declaration |
++``` +[`lowering/ambiguous-soft-scope`](@ref diagnostic/reference/lowering/ambiguous-soft-scope) +```@raw html + | +
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+
| Sort import names | ++``` +[`lowering/unsorted-import-names`](@ref diagnostic/reference/lowering/unsorted-import-names) +```@raw html + | +
+
+```
+
+```@raw html
+
+
+```
+
+```@raw html
+
+ |
+