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 +>
+> ``` +> ![Syntax diagnostic](assets/features/diagnostic-syntax.png) +> ```@raw html +>
+>
+> ``` +> ![Syntax diagnostic](assets/features/diagnostic-syntax-dark.png) +> ```@raw html +>
+> ``` + +### [Lowering diagnostics](@id features/diagnostic/lowering) + +Static analysis issues produced during lowering by +[JuliaLowering.jl](https://github.com/JuliaLang/julia/tree/master/JuliaLowering) — +including undefined / unused bindings, unreachable code, scope +ambiguities, and import-related issues. + +> ```@raw html +>
+> ``` +> ![Lowering diagnostic](assets/features/diagnostic-lowering.png) +> ```@raw html +>
+>
+> ``` +> ![Lowering diagnostic](assets/features/diagnostic-lowering-dark.png) +> ```@raw html +>
+> ``` + +### [Inference diagnostics](@id features/diagnostic/inference) + +Type-level issues caught by [JET.jl](https://github.com/aviatesk/JET.jl) +during type inference, such as non-existent field access, out-of-bounds +indexing, method errors, and non-boolean conditions. + +> ```@raw html +>
+> ``` +> ![Inference diagnostic](assets/features/diagnostic-inference.png) +> ```@raw html +>
+>
+> ``` +> ![Inference diagnostic](assets/features/diagnostic-inference-dark.png) +> ```@raw html +>
+> ``` + +## [Completion](@id features/completion) + +JETLS provides type-aware code completion with multiple modes. + +### [Global and local completion](@id features/completion/global-local) + +Completion for global symbols (functions, types, modules, constants) and +local bindings. Global completion items include detailed kind information +resolved lazily when a candidate is selected. + +> ```@raw html +>
+> ``` +> ![Global and local completion](assets/features/completion-global-local.png) +> ```@raw html +>
+>
+> ``` +> ![Global and local completion](assets/features/completion-global-local-dark.png) +> ```@raw html +>
+> ``` + +### [Method signature completion](@id features/completion/method-signature) + +Triggered inside a function call (after `(`, `,`, or space). Compatible +method signatures are suggested based on already-provided arguments. +Selecting a candidate inserts remaining positional arguments as snippet +placeholders with type annotations. Inferred return type and documentation +are resolved lazily. + +See [`[completion.method_signature] prepend_inference_result`](@ref +config/completion-method_signature-prepend_inference_result) for the +configuration option that shows the inferred return type inline. + +> ```@raw html +>
+> ``` +> ![Method signature completion](assets/features/completion-method.png) +> ```@raw html +>
+>
+> ``` +> ![Method signature completion](assets/features/completion-method-dark.png) +> ```@raw html +>
+> ``` + +### [Keyword argument completion](@id features/completion/keyword-argument) + +Triggered inside a function call at the keyword argument position +(e.g. `func(; |)` or `func(k|)`). Available keyword arguments are suggested +with `=` appended. Already-specified keywords are excluded. + +> ```@raw html +>
+> ``` +> ![Keyword argument completion](assets/features/completion-keyword.png) +> ```@raw html +>
+>
+> ``` +> ![Keyword argument completion](assets/features/completion-keyword-dark.png) +> ```@raw html +>
+> ``` + +### [LaTeX and emoji completion](@id features/completion/latex-emoji) + +Type `\` to trigger LaTeX symbol completion (e.g. `\alpha` → `α`) or `\:` +to trigger emoji completion (e.g. `\:smile:` → `😄`), mirroring the Julia +REPL. + +```@raw html + + + + + + + + + + + + + + +
TriggerExample
LaTeX symbol (\) +
+``` +![LaTeX completion](assets/features/completion-latex.png) +```@raw html +
+
+``` +![LaTeX completion](assets/features/completion-latex-dark.png) +```@raw html +
+
Emoji (\:) +
+``` +![Emoji completion](assets/features/completion-emoji.png) +```@raw html +
+
+``` +![Emoji completion](assets/features/completion-emoji-dark.png) +```@raw html +
+
+``` + +## [Signature help](@id features/signature-help) + +Method signatures are displayed as you type function arguments. Methods are +filtered based on the inferred types of already-provided arguments — e.g., +typing `sin(1,` shows only methods compatible with an `Int` first argument. + +> ```@raw html +>
+> ``` +> ![Signature help](assets/features/signature-help.png) +> ```@raw html +>
+>
+> ``` +> ![Signature help](assets/features/signature-help-dark.png) +> ```@raw html +>
+> ``` + +## [Go to definition](@id features/go-to-definition) + +Jump to where a symbol is defined. JETLS resolves method and module +definitions, as well as local bindings. + +> ```@raw html +>
+> ``` +> ![Go to definition](assets/features/definition.png) +> ```@raw html +>
+>
+> ``` +> ![Go to definition](assets/features/definition-dark.png) +> ```@raw html +>
+> ``` + +JETLS also implements go to declaration (`textDocument/declaration`), +which jumps to declaration sites (e.g., `import`/`using`, `local x`, or +empty `function foo end`) when distinct from the definition, and falls +back to go to definition otherwise. + +## [Document link](@id features/document-link) + +Path strings inside `include("...")` and `include_dependency("...")` +calls become clickable links that open the referenced file. The path +must be a single non-interpolated string and resolve to an existing +file relative to the current document's directory. + +> ```@raw html +>
+> ``` +> ![Document link](assets/features/document-link.png) +> ```@raw html +>
+>
+> ``` +> ![Document link](assets/features/document-link-dark.png) +> ```@raw html +>
+> ``` + +## [Find references](@id features/find-references) + +Find all references to a symbol across files analyzed together (e.g., a +package and its `include`d files). Both local and global bindings are +supported. When the client requests `includeDeclaration=false`, method +definitions of the target are excluded. + +> ```@raw html +>
+> ``` +> ![Find references](assets/features/find-references.png) +> ```@raw html +>
+>
+> ``` +> ![Find references](assets/features/find-references-dark.png) +> ```@raw html +>
+> ``` + +## [Hover](@id features/hover) + +Hover over symbols to see documentation and source locations. + +```@raw html + + + + + + + + + + + + + + + + +
Binding kindDescriptionExample
Global bindingShows documentation from the binding's docstring along with its source location. +
+``` +![Hover on global binding](assets/features/hover-global-binding.png) +```@raw html +
+
+``` +![Hover on global binding](assets/features/hover-global-binding-dark.png) +```@raw html +
+
Local bindingShows the binding's definition location within the enclosing scope. +
+``` +![Hover on local binding](assets/features/hover-local-binding.png) +```@raw html +
+
+``` +![Hover on local binding](assets/features/hover-local-binding-dark.png) +```@raw html +
+
+``` + +## [Document highlight](@id features/document-highlight) + +Highlight all occurrences of the symbol at the cursor within the current +file, distinguishing between writes (definitions, assignments) and reads +(uses). + +> ```@raw html +>
+> ``` +> ![Document highlight](assets/features/document-highlight.png) +> ```@raw html +>
+>
+> ``` +> ![Document highlight](assets/features/document-highlight-dark.png) +> ```@raw html +>
+> ``` + +## [Document and workspace symbol](@id features/symbol) + +```@raw html + + + + + + + + + + + + + + + + +
Symbol scopeDescriptionExample
Document symbolAn outline view of the current file, listing modules, functions, methods, structs, constants, etc. +
+``` +![Document symbol](assets/features/document-symbol.png) +```@raw html +
+
+``` +![Document symbol](assets/features/document-symbol-dark.png) +```@raw html +
+
Workspace symbolFuzzy-search across symbols in the whole workspace. +
+``` +![Workspace symbol](assets/features/workspace-symbol.png) +```@raw html +
+
+``` +![Workspace symbol](assets/features/workspace-symbol-dark.png) +```@raw html +
+
+``` + +## [Code lens](@id features/code-lens) + +JETLS surfaces actionable information inline above relevant code via code +lenses. + +### [Reference count](@id features/code-lens/references) + +When [`code_lens.references`](@ref config/code_lens-references) is enabled, +a reference count is displayed above each top-level symbol (functions, +structs, constants, abstract/primitive types, modules). Clicking the lens +dispatches the `editor.action.showReferences` command (a VSCode +convention) carrying the pre-resolved reference locations. Clients that +follow this convention open the references panel out of the box; clients +that don't need a client-side handler — see the +[Neovim setup](@ref index/editor-setup/neovim) for an example. + +> ```@raw html +>
+> ``` +> ![Reference count code lens](assets/features/code-lens-references.png) +> ```@raw html +>
+>
+> ``` +> ![Reference count code lens](assets/features/code-lens-references-dark.png) +> ```@raw html +>
+> ``` + +### [TestRunner code lens](@id features/code-lens/testrunner) + +Run and re-run `@testset` blocks directly from the editor. See +[TestRunner code lens](@ref testrunner/features/code-lens) for details. + +> ```@raw html +>
+> ``` +> ![TestRunner code lens](assets/features/code-lens-testrunner.png) +> ```@raw html +>
+>
+> ``` +> ![TestRunner code lens](assets/features/code-lens-testrunner-dark.png) +> ```@raw html +>
+> ``` + +## [Inlay hint](@id features/inlay-hint) + +Show inline annotations in the editor without modifying the source. JETLS +currently supports block-end hints that label the construct a long `end` +keyword closes. See +[`[inlay_hint] block_end_min_lines`](@ref config/inlay_hint-block_end_min_lines) +for the threshold configuration. + +> ```@raw html +>
+> ``` +> ![Block-end inlay hint](assets/features/inlay-hint-block-end.png) +> ```@raw html +>
+>
+> ``` +> ![Block-end inlay hint](assets/features/inlay-hint-block-end-dark.png) +> ```@raw html +>
+> ``` + +## [Rename](@id features/rename) + +Rename local or global bindings across files analyzed together (e.g., a +package and its `include`d files). + +> ```@raw html +>
+> ``` +> ![Rename](assets/features/refactoring-rename.png) +> ```@raw html +>
+>
+> ``` +> ![Rename](assets/features/refactoring-rename-dark.png) +> ```@raw html +>
+> ``` + +When renaming a string literal that refers to a file path +(e.g. in `include("foo.jl")`), JETLS also renames the file on disk. + +> ```@raw html +>
+> ``` +> ![File rename](assets/features/refactoring-file-rename.png) +> ```@raw html +>
+>
+> ``` +> ![File rename](assets/features/refactoring-file-rename-dark.png) +> ```@raw html +>
+> ``` + +## [Code actions](@id features/code-actions) + +JETLS provides code actions for quick fixes and refactoring, including: + +- Prefix unused variables with `_` (or delete the assignment entirely) +- Remove unused imports +- Sort import names +- Delete unreachable code +- Insert `global` / `local` declarations for ambiguous soft scope variables +- Run a nearby `@testset` or `@test` case via + [TestRunner code actions](@ref testrunner/features/code-actions) + +A few representative examples: + +```@raw html + + + + + + + + + + + + + + + + + + + + + +
Code actionTriggered byExample
Prefix unused variable with _ +``` +[`lowering/unused-argument`](@ref diagnostic/reference/lowering/unused-argument) +```@raw html + +
+``` +![Prefix unused argument with underscore](assets/features/code-actions-unused-arg.png) +```@raw html +
+
+``` +![Prefix unused argument with underscore](assets/features/code-actions-unused-arg-dark.png) +```@raw html +
+
Insert global / local declaration +``` +[`lowering/ambiguous-soft-scope`](@ref diagnostic/reference/lowering/ambiguous-soft-scope) +```@raw html + +
+``` +![Insert global/local declaration](assets/features/code-actions-soft-scope.png) +```@raw html +
+
+``` +![Insert global/local declaration](assets/features/code-actions-soft-scope-dark.png) +```@raw html +
+
Sort import names +``` +[`lowering/unsorted-import-names`](@ref diagnostic/reference/lowering/unsorted-import-names) +```@raw html + +
+``` +![Sort import names](assets/features/code-actions-sort-imports.png) +```@raw html +
+
+``` +![Sort import names](assets/features/code-actions-sort-imports-dark.png) +```@raw html +
+
+``` + +## [Formatting](@id features/formatting) + +JETLS integrates with external formatters +([Runic.jl](https://github.com/fredrikekre/Runic.jl) by default, or +[JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl)) for both +document and range formatting. See [Formatter integration](@ref formatting) +for setup instructions. + +## [TestRunner integration](@id features/testrunner) + +Run individual `@testset` blocks and `@test` cases directly from the editor +via code lenses and code actions, with results surfaced as inline +diagnostics and logs. See [TestRunner integration](@ref testrunner) for +setup and supported patterns. + +> ```@raw html +>
+> ``` +> ![TestRunner integration](assets/features/testrunner-integration.png) +> ```@raw html +>
+>
+> ``` +> ![TestRunner integration](assets/features/testrunner-integration-dark.png) +> ```@raw html +>
+> ``` + +## [Notebook support](@id features/notebook) + +JETLS provides LSP features for Julia code cells in Jupyter notebooks. +Cells are analyzed together, so all LSP features including diagnostics, +go-to definition, find-references, etc., work across cells. +See [Notebook support](@ref notebook) for details. + +> ```@raw html +>
+> ``` +> ![Notebook support](assets/features/notebook-support.png) +> ```@raw html +>
+>
+> ``` +> ![Notebook support](assets/features/notebook-support-dark.png) +> ```@raw html +>
+> ``` diff --git a/docs/src/index.md b/docs/src/index.md index 11e71a8a6..e991cf4d5 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -16,6 +16,9 @@ diagnostic, macro-aware go-to definition and such. Not production-ready; APIs and behavior may change. Stability and performance are limited. Expect bugs and rough edges. +See the [Features](@ref features) page for a visual overview of the LSP +features JETLS provides. + ## [Server installation](@id index/server-installation) Editor clients for JETLS generally do not bundle the JETLS server itself.