Skip to content

Commit

Permalink
Include highlights files in distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Sep 21, 2023
1 parent 5cf449c commit 8902880
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ classifiers = [
]
include = [
"src/textual/py.typed",
"tree-sitter",
{ path = "docs/examples", format = "sdist" },
{ path = "tests", format = "sdist" },
# The reason for the slightly convoluted path specification here is that
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions src/textual/widgets/_text_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

_OPENING_BRACKETS = {"{": "}", "[": "]", "(": ")"}
_CLOSING_BRACKETS = {v: k for k, v in _OPENING_BRACKETS.items()}
_TREE_SITTER_PATH = Path(__file__) / "../../../../tree-sitter/"
_TREE_SITTER_PATH = Path(__file__).parent / "../tree-sitter/"
_HIGHLIGHTS_PATH = _TREE_SITTER_PATH / "highlights/"

StartColumn = int
Expand Down Expand Up @@ -325,7 +325,8 @@ def _get_builtin_highlight_query(language_name: str) -> str:
Path(_HIGHLIGHTS_PATH.resolve()) / f"{language_name}.scm"
)
highlight_query = highlight_query_path.read_text()
except OSError:
except OSError as e:
log.warning(f"Unable to load highlight query. {e}")
highlight_query = ""

return highlight_query
Expand Down

0 comments on commit 8902880

Please sign in to comment.