Skip to content

Commit

Permalink
feat: superficial migration to builtin treesit (#14) (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artawower authored Dec 8, 2024
1 parent 41eb97b commit eaf3838
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
emacs_version: ["25.1", "26.1", "27.1", "28.1", "29.1"]
emacs_version: ["snapshot"]

steps:
- name: Set up Emacs
Expand Down
8 changes: 5 additions & 3 deletions Eldev
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
; -*- mode: emacs-lisp; lexical-binding: t -*-
; -*- mode: emacs-lisp; lexical-binding: t -*-

;; Autodetermined by `eldev init'.
(eldev-use-package-archive 'melpa)
(eldev-add-extra-dependencies 'test 'typescript-mode)
(eldev-add-extra-dependencies 'test 'tree-sitter-langs)

(eldev-add-extra-dependencies 'test 'tree-sitter-langs
'typescript-mode
'treesit-auto)
31 changes: 29 additions & 2 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
[[https://github.com/Artawower/turbo-log/actions][https://github.com/artawower/turbo-log/actions/workflows/lint.yml/badge.svg]] [[https://wakatime.com/badge/github/Artawower/turbo-log.svg]]
:PROPERTIES:
:ID: turbo-log-readme
:END:

#+html: <div align='center'>
#+html: <img src="./images/image.png" width="16%">
#+html: </div>
#+html: <div align='center'>
#+html: <span class='badge-buymeacoffee'>
#+html: <a href='https://www.paypal.me/darkawower' title='Paypal' target='_blank'><img src='https://img.shields.io/badge/paypal-donate-blue.svg' alt='Buy Me A Coffee donate button' /></a>
#+html: </span>
#+html: <span class='badge-patreon'>
#+html: <a href='https://patreon.com/artawower' target='_blank' title='Donate to this project using Patreon'><img src='https://img.shields.io/badge/patreon-donate-orange.svg' alt='Patreon donate button' /></a>
#+html: </span>
#+html: <a href="https://wakatime.com/badge/github/Artawower/turbo-log"><img src="https://wakatime.com/badge/github/Artawower/turbo-log.svg" alt="wakatime"></a>
#+html: <a href="https://github.com/artawower/turbo-log/actions/workflows/lint.yml/badge.svg" target="_blank"><img src="https://github.com/artawower/turbo-log/actions/workflows/lint.yml/badge.svg" alt="CI"></a>
#+html: </div>

* Turbo log - fast logging selected line or region
This project inspired by a similar package for [[https://marketplace.visualstudio.com/items?itemName=ChakrounAnas.turbo-console-log][vs-code - turbo-console-log]], and provides functionality for fast log message inserting under current line.
Expand Down Expand Up @@ -75,7 +91,13 @@ Then put this in your init to load the package
(setq turbo-log-allow-insert-without-tree-sitter-p t))
#+END_SRC


*** For emacs version < 29
emacs versions below 29 are no longer supported, but you can still use an older version:
#+BEGIN_SRC emacs-lisp :results silent
(use-package turbo-log
:defer t
:ensure (turbo-log :type git :host github :repo "Artawower/turbo-log.el" :branch "tree-sitter"))
#+END_SRC
** Customization
*** Common configs
=turbo-log-msg-format-template= - template for entire part inside logger
Expand Down Expand Up @@ -136,3 +158,8 @@ Where:
** Contributing
Any contribution is greatly appreciated!
Run =eldev test=, =checkdoc= and =package-lint-current-buffer= (from [[https://github.com/purcell/package-lint][package-lint]] ) before creating the pull request

#+BEGIN_SRC bash
eldev prepare && eldev -p -dtT -C test
#+END_SRC

Binary file added images/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions test.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
;;; test.el --- Testing for turbo log -*- lexical-binding:t -*-

(require 'turbo-log)
(require 'treesit-auto)

(setq treesit-auto-install t)
(setq treesit-auto-langs '(python rust go typescript tsx))
(treesit-auto-install-all)
(treesit-auto-add-to-auto-mode-alist 'all)


;;; Code:

Expand Down Expand Up @@ -106,8 +113,7 @@ function myFuncWithEmptyBody(qwwe) {}")
"Function for navigation to LINE-NUMBER and testing TEST-FUNC in new buffer."
`(save-window-excursion
(switch-to-buffer-other-window "*buffer-for-test*")
(typescript-mode)
(tree-sitter-mode)
(typescript-ts-mode)
(transient-mark-mode)
(setq-default typescript-indent-level 2)
(insert ,code)
Expand Down
Loading

0 comments on commit eaf3838

Please sign in to comment.