Skip to content

Commit

Permalink
Merge pull request #53 from pappasam/jedi18
Browse files Browse the repository at this point in the history
Jedi18
  • Loading branch information
pappasam authored Jan 13, 2021
2 parents 3d1ef45 + 04fae28 commit 9d9eef4
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 132 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.22.0

### Changed

- Support only jedi `0.18.0`. Stopped using `from_fs_path` from pygls, using `as_uri` method on the returned pathlib.Path objects instead. Note: older versions of Jedi are not supported by this version.

## 0.21.0

### Added
Expand Down
3 changes: 1 addition & 2 deletions jedi_language_server/jedi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
SymbolInformation,
SymbolKind,
)
from pygls.uris import from_fs_path
from pygls.workspace import Document

from .initialize_params_parser import InitializeParamsParser
Expand Down Expand Up @@ -70,7 +69,7 @@ def lsp_range(name: Name) -> Range:

def lsp_location(name: Name) -> Location:
"""Get LSP location from Jedi definition."""
return Location(uri=from_fs_path(name.module_path), range=lsp_range(name))
return Location(uri=name.module_path.as_uri(), range=lsp_range(name))


def lsp_symbol_information(name: Name) -> SymbolInformation:
Expand Down
7 changes: 3 additions & 4 deletions jedi_language_server/text_edit_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
TextEdit,
VersionedTextDocumentIdentifier,
)
from pygls.uris import from_fs_path


class RenameFile: # pylint: disable=too-few-public-methods
Expand Down Expand Up @@ -57,8 +56,8 @@ def lsp_renames(self) -> Iterator[RenameFile]:
"""Get all File rename operations."""
for old_name, new_name in self.refactoring.get_renames():
yield RenameFile(
old_uri=from_fs_path(old_name),
new_uri=from_fs_path(new_name),
old_uri=old_name.as_uri(),
new_uri=new_name.as_uri(),
options=RenameFileOptions(
ignore_if_exists=True, overwrite=True
),
Expand All @@ -68,7 +67,7 @@ def lsp_text_document_edits(self) -> Iterator[TextDocumentEdit]:
"""Get all text document edits."""
changed_files = self.refactoring.get_changed_files()
for path, changed_file in changed_files.items():
uri = from_fs_path(path)
uri = path.as_uri()
text_edits = lsp_text_edits(changed_file)
yield TextDocumentEdit(
text_document=VersionedTextDocumentIdentifier(
Expand Down
Loading

0 comments on commit 9d9eef4

Please sign in to comment.