Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Scala 3 #170

Draft
wants to merge 45 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ce97702
Read the code and fiddle toward Scala 3 a bit
Mar 16, 2021
eef2bff
Begin to match `scala-mode-syntax` against the 3.0 BNF
Apr 2, 2021
7d190ef
Octal numerals are no longer supported in Scala
Apr 13, 2021
d22aed2
Continue to match `scala-mode-syntax` against the 3.0 BNF
Apr 13, 2021
18a27ce
Continue to match `scala-mode-syntax` against the 3.0 BNF (2)
May 5, 2021
265e69a
Beginning to see just how vastly daunting this change is
Jun 15, 2021
5e73968
Realized that whitespace syntax centers around block, not body
Jun 23, 2021
cfeef68
Still trying to figure out my way around
Jun 23, 2021
225081e
Some crude but meaningful progress on indentation
Jun 24, 2021
7dad271
Small and imprecise progress on indentation
Jun 25, 2021
cd11904
finish going through the lexical syntax, and some
Jul 22, 2021
1fa19e6
I am not going to make progress just by tweaking
Jul 22, 2021
1859e83
Really go nuclear on the existing indenting algorithms
Jul 22, 2021
c11cbbd
baby steps on a new approach
Oct 4, 2021
738b88e
primitive support for object blocks with whitespace
Oct 4, 2021
b00f933
support enum and more flexible object blocks
Oct 4, 2021
80d75fc
initial support for indentation-based match-case expressions
Oct 4, 2021
06494c3
fix misbehavior on whitespace around `case`
Oct 4, 2021
ac22bd6
support many more syntactic scenarios
Oct 4, 2021
8218464
initial support for for-comprehensions, which are problematic
Oct 4, 2021
8eb91cd
initial support for dot-chaining, which is problematic
Oct 4, 2021
0e77db6
get for-comps working tolerably, and a bit of work on dot chaining
Oct 4, 2021
0f3e7ea
get if-then-else working
Oct 5, 2021
c5b0f46
role back dedented; if-then-else edgecases; &c
Oct 5, 2021
11d5c11
hey, this is starting to work pretty well
Oct 5, 2021
f2a0fbd
Get dot-chaining much more stable; but other things unstable
Dec 23, 2021
b7ea24a
Run both indentation algorithms; choose result by simple heuristic
Dec 23, 2021
442203e
Still trying to get dot-chaining perfected
Dec 23, 2021
d26a1d2
Detect infinite loop and break
Dec 30, 2021
a6983a5
Seems to fix the infinite loop
Dec 30, 2021
c8a7bba
Extract function: `scala-indent:continue-lookback?`
Dec 30, 2021
1ef3ce5
Augh, try to fix a bunch of cases without breaking others
Jan 4, 2022
c18f2bb
WIP: Adding cycling indent
Jan 5, 2022
74eaa24
Cycles between current indent and 0 when cycle-indent is true
jackcviers May 16, 2022
35f265f
Merge pull request #1 from jackcviers/scala3-indent-cycle
Kazark May 18, 2022
9d77eec
Fixes incorrect argument order in call-interactively
jackcviers May 19, 2022
e22ef62
Merge pull request #2 from jackcviers/scala3-indent-cycle
Kazark May 19, 2022
ad122e4
fix typo in function name
maemre Apr 1, 2023
56d1f77
indent after declarations
maemre Apr 1, 2023
5323a09
do not push nil into the analysis stack
maemre Apr 1, 2023
9df2ba4
disable aggressive paren rule temporarily
maemre Apr 3, 2023
be4ef5c
preliminary indentation support for `extension`
maemre Jun 5, 2023
417dd61
add support for `do` as an align keyword like `then` and `else`.
maemre Jun 5, 2023
5eef13b
Preserve line numbers for blank lines.
maemre Jun 5, 2023
238d4ea
Merge pull request #7 from maemre/scala3
Kazark Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions scala-mode-fontlock.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
(require 'scala-mode-syntax)

(defcustom scala-font-lock:constant-list '()
"A list of strigs that should be fontified in constant
face. This customization property takes effect only after the
scala-mode has been reloaded."
"A list of strings that should be fontified in constant face.

This customization property takes effect only after the `scala-mode' has been
reloaded."
:type '(repeat string)
:group 'scala)

Expand All @@ -22,8 +23,6 @@ scala-mode has been reloaded."
(when (re-search-forward scala-syntax:reserved-symbol-underscore-re limit t)
(goto-char (match-end 2)))) ;; step back to the match (re matches futher)

;(defun scala-font-lock:extend-region-function ()

(defun scala-font-lock:limit-pattern2 (&optional start)
(save-excursion
(when start (goto-char start))
Expand Down Expand Up @@ -363,20 +362,9 @@ Does not continue past limit.
"\\)")
2 font-lock-type-face)

;; ;; extends, with, new
;; (,(concat "\\<\\(extends\\|with\\|new\\)[ \t]+\\([("
;; scala-syntax:id-first-char-group "]\\)")
;; (scala-font-lock:mark-simpleType (scala-font-lock:limit-simpleType
;; (goto-char (match-beginning 2)))
;; nil
;; (0 font-lock-type-face nil t)))

;; ;; ':'
;; (,scala-syntax:colon-re
;; (scala-font-lock:mark-simpleType (scala-font-lock:limit-simpleType
;; (goto-char (match-end 2)))
;; nil
;; (0 font-lock-type-face nil t)))
;; TODO extends, with, new

;; TODO ':'

;; def
(,(concat "\\<def[ \t]+\\(" scala-syntax:id-re "\\)") 1 font-lock-function-name-face)
Expand Down
Loading