All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Completion of dictionary keys now handles single and double quotes consistently
- Jedi
Completion.path
completion items are filtered out. Resolves: #325
lsprotocol
's dependency specification in this project ended up pulling in an alpha version of the project. This release fixes that issue: #302
- Support
textDocument/declaration
. Resolves #284
- Issue where
lsp_python_diagnostic
may use invalidlsprotocol.types.Position.character
: #272
- Direct
cattrs
dependency for parsing InitializationOptions. Note: this doesn't really add a dependency becausecattrs
was already required by the existinglsprotocol
dependency.
pydantic
dependency; it made distributingjedi-language-server
harder than it needed to be.
- Removed support for Python 3.7
jedi
upgraded to0.19
, adding support for Python 3.11pydantic
upgraded to2.x
from1.x
; Pydantic 2 contains a compiled Rust core making it faster but requiring platform specific builds
- Fixes #262
- Diagnostic support using Python's builtin
compile
function.
pygls
1.0!- Diagnostics (for syntax errors) are once-again enabled by default.
- Properties are now children of classes, not the methods where they are defined. Resolves #240
jedi-language-server
-powered diagnostics are disabled by default. See: #187
- Support for Python 3.11
- Support
workspace.environmentPath
initialization option. Enables configuration of Jedi's Project environment path.
pygls
version constraint updated to^0.12.4
- Support
textDocument/typeDefinition
. Resolves #221
- Dependency updates, most relevant being pydantic to 1.9.1.
- Drop support for Python 3.6
- Class properties now hover as simple properties. Resolves #200
jedi
version constraint has been relaxed to^0.18.0
. Resolves #190.
- Default log level has been changed to
WARN
, suppresses verboseINFO
messages provided by pygls.
- Completions are now sorted public, private, then dunder.
- The order of completion items returned by Jedi is now preserved across clients through explicit sort order.
- Fix edge case where LSP methods that relied on
jedi_utils.lsp_range
(like Highlight) would break ifjedi.api.classes.Name
returned an empty line/column. Now, module builtins like__name__
and__file__
will Highlight / Hover correctly.
CompletionItem.detail
no longer provides redundant information that is already provided inCompletionItem.kind
.- Explicit calls to
get_type_hint
are removed for performance reasons. - classes and functions with no arguments sometimes return no jedi signatures. In these cases, we manually provide
()
at the end of said classes and functions to ensure a consisten detail experience for end users.
- Completion detail now has full signature.
- Descriptive text is now more standardized across Completion, Hover, and Signature Items. Main difference comes down to inclusion of full name (Hover) and inclusion of multiple signatures (Signature).
- Fixed bug where classes nested inside functions cause exceptions in textDocument/documentSymbol. This release avoids the crash and includes info about classes and functions nested inside functions. See this issue
- InitializationOption
completion.ignorePatterns
, an option for users to conditionally ignore certain completion patterns. A generalized solution to this issue.
- Completion at beginning of line now works.
- Per comment here, may resolve issues associated with Windows line endings.
jedi_line_column
now returns a tuple instead of a dict. Since this function is often used, it makes sense to choose a more-performant data type.
- InitializationOption
jediSettings.debug
now writes to stderr, not stdout. stdout broke the language server.
- InitializationOption
jediSettings.debug
that lets user configure jedi's debugging messages to print to stdout.
- Jedi Names may have no
module_path
, solsp_location
now returns anOptional[Location]
. Thanks @dimbleby !
- Empty docstrings no longer result in unnecessary newlines for signatureHelp (and potentially other requests). Resolves #158.
- From Jedi's perspective, operations at the beginning of a line now assume they are at position 1. This ensures that hover operations work correctly at the beginning of the line.
- Diagnostics are now cleared on document close.
- Support for serving content over web sockets.
- Now support all Python 3.6 versions; we don't need to constrain our runtime requirements to anything less than 3.6 because only our development dependencies require Python > 3.6.0.
- Updated pygls to latest version.
- Initialization options to granularly disable names and full names for hover operations based on their Jedi type. This is useful because some text editors will automatically send hover requests when a user pauses their cursor over text and the large amount of information can get annoying for some users. Resolves: #147. Jedi types are currently:
module
,class
,instance
,function
,param
,path
,keyword
,property
, andstatement
. - Initialization option to disable hover entirely. If
enable
is set to false, the hover language feature will not be registered. May consider adding something similar to most language server features if this proves useful.
- In Hover,
Path
has been renamed toFull name
, which is more accurate and is directly tied to the hover disabling options. - Restrict Python version support to >= 3.6.2. Upgraded development dependencies. Latest black doesn't support Python < 3.6.2, so to keep things simple here we're now not supporting Python versions below that version either.
- Docstring now presents same information as before, but organized more-tersely, (arguably) more clearly, and with much better markdown syntax support. For example, the name / signature has been pulled out from the main docstring and wrapped in python triple back ticks while the docstring is conditionally replaced with the description where relevant.
get_type_hint
is now wrapped in general Exception. It's more broken than thought, so we'll prevent this from bubbling up to users.- Conditionally show markdown. If users / editors want to prefer plaintext, we won't return markdown-formatted titles for the hover text
- Markdown text that is not recognized by
docstring-to-markdown
is no longer automatically wrapped in a code block. I found that, more often than not, this resulted in annoying formatting for me. - Hover text now displays a lot more information, taking advantage of Jedi's Name methods and properties. Information now includes the module path to the name, the description, and an inferred type hint in addition to the docstring. This is all formatted with markdown so it looks pretty.
RenameFile now works correctly: kind
now correctly passed to RenameFile due to recently-released pygls updates. Minimum pygls version now 0.10.3.
Require importlib-metadata for Python 3.6 and 3.7. It is technically required and some clients might check jls version. See: pappasam/coc-jedi#32
- null initializationOption is now accepted as valid input, without warning. Resolves #104
- New initialization options to configure extracted variable and extracted function codeAction: nameExtractVariable and nameExtractFunction.
- Configurable codeAction extraction names. Names are no longer randomly-generated. Instead, they are configurable in initializationOptions, defaulting to a name that's specific to jedi-language-server.
- The following CLI options:
--tcp
: use TCP server instead of stdio--host
: host for TCP server (default 127.0.0.1)--port
: port for TCP server (default 2087)--log-file
: redirect logs to the given file instead of writing to stderr-v
/--verbose
: increase verbosity of log output
- Logging. To stderr by default, but optionally a file on the file system.
- Updated cli to use
argparse
instead ofclick
. - Required pygls version updated to
0.10.2
to accommodate recent bugfixes / prevent users from filing issues based on old version.
- Removed
click
from dependencies.
- Within TextEdit utils, simplify mapping from file offset to Position. This is clearer, handles edge cases better, and is more algorithmically efficient.
General TextEdit fixes for code refactoring:
- Update fix from 0.28.5 so that it doesn't pad at the start; no opcode will refer to old[-1:n].
- Revert opcode.old_end -> opcode.old_end - 1. This becomes unnecessary with prior update, and indeed could be a bad idea when in the middle of a file (if you're unlucky, you could end up finding the line before the one you wanted).
- Use pygls.document to get the old code, rather than the private jedi method.
- Handle TextEdit edge case where opcode is checked for 1 past last character. Resolves #96
- No longer return textEdit actions from Jedi that aren't valid Python. Prevents all sorts of wonkiness.
- Handle null rootUri's by not creating a Jedi project, fixes #95
- Tolerate invalid InitializationOptions by using default values on error
- completionItem/resolve now works again (broke with 0.28.0's migration to pygls 0.10.0)
- signatureHelp now also returns documentation, if available.
Same functions as 0.28, but different tag.
- pygls
0.10.0
. This version explicitly usespydantic
and better supports initialization options. This enables use to remove thecached-property
dependency for Python versions 3.6 and 3.7. - pydantic is now used for initialization options parsing. Simplified so much that we were able to remove initializationOption-specific tests.
- Explicitly add method for
did_open
, for some weird reason the latest pygls bugs out if you don't explicitly set this function to at least an empty function.
- Support for Python 3.6.0. We now only support Python 3.6.1+.
- Monkey patch for
null
versusmissing
attributes.pydantic
/pygls>=0.10.0
handles this.
- Provide correct version information on
TextDocumentEdit
.
- Monkey patched pygls to remove null types from response. This is a temporary fix to more-fully support nvim-lsp et al, necessary until pygls releases its next version.
- Initialization option
workspace.symbols.ignoreFolders
to set names of folders that are ignored during the workspace symbols action. For performance reasons; things slow down a LOT when symbols come from 3rd party library locations.
- (Breaking from 0.26.0) Initialization option
workspace.maxSymbols
changed toworkspace.symbols.maxSymbols
.
- Initialization option
workspace.maxSymbols
to set the max workspace symbols returned by Jedi. Set to 0 or fewer to disable the setting of max and to return as many symbols as are found.
- Stop putting keyword-only arguments in snippets. That turned out to be more annoying than helpful.
- Fixes renaming edge case where lines at end get KeyError.
- Fix renaming a variable that appears at the start of a line
- Fix handling of
completionItem/resolve
when not all fields are present on theCompletionItem
. - Fix handling of eager resolution of completions.
- SymbolKind and CompletionItemKind now support
Property
. Support is still a bit finicky, and I'm not sure whether it's Jedi's issue or an issue with jedi-language-server at this time. jedi_utils.line_column
now ensures that line length never falls below 0. Resolves #74
- Relax version constraints for
docstring-to-markdown
to be compatible with all versions below1.0
. Author confirms there won't be breaking changes until at least then: #68 (comment)
- Markdown-formatted text that cannot be converted is now surrounded by fences
- An edge case where markup_kind variable is a string, and not MarkupKind, is properly handled
- Bug where client-supported markupkind wasn't being properly converted to
MarkupKind
, which caused problems when relying on client-provided defaults.
- When
MarkupKind
is"markdown"
, convert docstrings from rst to markdown. Currently uses https://github.com/krassowski/docstring-to-markdown, thanks @krassowski for the awesome library! Special attention has been paid to error handling here to give @krassowski leeway to develop the library further.
caseInsensitiveCompletion
initialization option added. The user can now tell Jedi to only return case sensitive completions by setting this value to false.
- Handle jedi 0.18.0's change from
str
topathlib.Path
for workspace symbols.
- workspace/didChangeConfiguration option is now defined. It currently does nothing, but this resolves some feedback errors on some language clients. See #58.
- Implemented
completionItem/resolve
; the Jedi completion data are held until the nexttextDocument/completion
arrives - Added
completion.resolveEagerly
option to allow users to opt out of the change (in anticipation for their editor to supportcompletionItem/resolve
if it does not already)
- Support only jedi
0.18.0
. Stopped usingfrom_fs_path
from pygls, usingas_uri
method on the returned pathlib.Path objects instead. Note: older versions of Jedi are not supported by this version.
- The ability to add extra paths for your workspace's code completion (
"workspace.extraPaths"
). Thanks to Karl and his PR which inspired this feature.
- Only 1 Jedi project is created / managed by jls. In the past, a new project was created on a per-call basis. This may have positive performance implications.
- documentSymbol now classifies methods/properties somewhat correctly
- Replace unnecessary private attribute access within jedi with self-managed constant
- Update documentSymbol query
- Uses native Jedi position finders (faster)
- Removes noisy symbols from hierarchical output. Makes document outliners prettier / more visually useful
- Large character position values are now translated correctly for Jedi. See #42
- Jedi version is now pinned to protect ourselves from changes to private interfaces that we currently rely on.
pygls
updated to^0.9.1
WorkspaceSymbols
query now performs efficiently / is somewhat useable.
pygls
dependency version was locked at the wrong version. Now constrained to^0.9.0
ParameterInformation
,SignatureInformation
, andSignatureHelp
caused problems withnvim-lsp
. Resolves #38
jedi>=0.17.2
jedi>=0.17.1
- Hover now works more-generally correctly (thanks to Jedi's new handling of in-module references)
- Syntax message now uses Jedi's new
get_message
method on the returned error object (syntax errors now contain more human-readable messages) - Remove now-unnecessary
.venv
hack that was introduced in0.10.1
- Refactoring code actions now properly support multi-line range where possible
- Support for CodeActions:
inline
,extract_function
, andextract_variable
- Rename now uses Jedi's rename capabilities, relying on some clever code using difflib and a range lookup mechanism
- Features now all return Optional values, preferring
null
to[]
.
- Clean up snippet edge cases
- Only classes and functions return snippets
- "No parameters returned" places cursor outside of function signature
- Snippet generation error now does not return a snippet
- cc19816 2020-05-29 | Completion opto: add jedi option to auto import modules [Sam Roeca]
- 4c670fa 2020-05-29 | Simplify snippet contents (types were too much) (HEAD -> master, origin/master, origin/HEAD) [Sam Roeca]
- All properties in initializer are cached using "cached_property". 3rd party library used for Python 3.6 and 3.7.
- Snippet support for
CompletionItem
- Configuration option to disable
CompletionItem
snippets (preserving existing behavior)
- Reflecting the recent version of Jedi, the type map between Jedi and
pygls
has been reduced to reflect only the public types available in Jedi. - Cache now no longer explicitly referenced.
- Some code cleanup.
- f44ef53 2020-05-24 | Completion: explicit insert_text_format=PlainText [Sam Roeca]
- 0d63b25 2020-05-23 | Replace symbol position functions with public ones [Sam Roeca]
- fdc0b99 2020-05-23 | Completion sorting now sorts sections, not labels [Sam Roeca]
- 1d5a11e 2020-05-19 | Set MarkupKind based on client configuration [Sam Roeca]
- 3c41272 2020-05-19 | Save initializeParams in storage container [Sam Roeca]
- 5e2bc3b 2020-05-17 | Completion item documentation is in PlainText (HEAD -> hover-improve) [Sam Roeca
- 44292b9 2020-05-17 | Hover now returns MarkupContent + Range [Sam Roeca]
- 0871c6d 2020-05-17 | Ensure that preferred parameters end in "=" [Sam Roeca]
- d66c402 2020-05-17 | current_word_range function added to pygls_utils [Sam Roeca]
- Document symbol range selection made more accurate. Thanks to davidhalter/jedi#1576 (comment)!
- Attribute access on InitializeParams now exclusively uses
rgetattr
in case Language Client omits optional fields in request.
- Configuration takes place using initializationOptions instead of asynchronous reads of the current user config. Improves startup time and supports more LanguageClients.
- Dynamic registration. All registration is now static since static registration is widely supported.
- Removed initialization message directly from the server. This should be handled and configured by LanguageClient plugins.
- jedi completion
param
sorts first in COMPLETION. Resolves #19
- Removed
)
from signatureHelp triggerCharacters (now just(
and,
). Thanks to rwols in #15 (comment)!
- Most registrations moved to
static
registrations - Configuration options for
triggerCharacters
and other server-managed feature options were removed. See #15 - Elegant solution overriding
bf_*
thanks to harismandal and muffinmad
- hierarchicalDocumentSymbolSupport (eg, you get a nice outline when making a documentSymbol request). Conditionally provides this functionality based on whether your language client supports this.
- Highlight function is now slightly less accurate but much faster. Since highlight is called repeatedly (like complete), its speed is much more important to its accuracy.
- Jedi now ignores ".venv" for searches. The implementation is kind of a hack, but it solves my personal problem at the moment.
- Support
textDocument.documentHighlight
- Support
textDocument.signatureHelp
- A bunch of
try/except Exception
blocks around Jedi calls. Hopefully those aren't still necessary onjedi>=0.17
...
- Support Jedi-powered diagnostics
- Server does not initialize non-initialization features if
"jedi.enabled": false
lookup_feature_id
initialized in__init__
; no longer a class variable- although tests are still mostly missing,
test_cli
now importscli
; helps determine if there are any runtime errors on import
- Support user-configuration rooted at
jedi
. Only 1 option for now:jedi.completion.triggerCharacters
. Same defaults as version0.6.1
. - Message flashes after initialization.
pygls
types now checked. Version0.9.0
provides type-hint checking support.
- Trigger characters are now: ", ', and . to account for dictionary completions
- Trigger characters finally work (use underscore in pygls decorator, not camel case...)
- Completion insert items now remove leading " and ' if preceding character is ' or "
- Re-added
workspace/symbol
support using Jedi'sProject
object. This is much simpler and faster than the previous implementation.
- Implementation details involving
Projects
andScripts
were re-organized in preparation for the next minor release.
- Fixed
DOCUMENT_SYMBOL
. Line and row numbers were incorrectly passed to this argument before which silently broke this function. These incorrect arguments were removed.
- Hover uses Jedi's
help
method, instead ofinfer
. Provides better help message information.
- Support for Jedi
0.17
- Major internal updates to helper functions. Jedi
0.17
has a different public API.
- Remove support for Workspace symbols. I never used this feature and I figure we can do this better with Jedi's new project constructs.
- Remove support for any version of Jedi before
0.17
. If you must use an older Jedi, stick to0.4.2
.
- Reformat this changelog with
prettier
.
- Jedi
0.17
introduces major public API breaking changes. Temporarily version constrain Jedi to>=0.15.1,<0.17.0
to keep language server usable until we can address all public API changes in upstream Jedi. Version0.5.0
will require Jedi>=0.17.0
.
- docstring for
lsp_rename
README
now provides clearer overview of supported features and usage.
- Support for
workspace/symbol
- NOTE: currently ignores the query. Maybe something worth considering the query in future.
- Document symbols are now properly mapped to jedi symbols. Before, I was incorrectly using the completion item mapping. I need to use the separate symbol mapping.
- Rename Jedi functionality is wrapped in
try/except
, increasing language server's resilience.
- This
CHANGELOG.md
- Support for
textDocument/documentSymbol
locations_from_definitions
toget_location_from_definition
. More generally useful.
mypy
,pylint
,black
,toml-sort
, andisort
all pass.