Skip to content

Modernize repo and make sure it works with ST4#9

Merged
michaelblyons merged 204 commits intoSublimeText:masterfrom
Frizlab:develop
Mar 20, 2026
Merged

Modernize repo and make sure it works with ST4#9
michaelblyons merged 204 commits intoSublimeText:masterfrom
Frizlab:develop

Conversation

@Frizlab
Copy link
Copy Markdown
Contributor

@Frizlab Frizlab commented Jan 23, 2026

That being said:

  • I have no idea if it works before ST4 now It does not work before ST4;
  • I have not succeeded in running the tests (UnitTesting shows a panel at the bottom, but it is desperately empty; I suspect a syntax error, or something of that nature, but I don’t know for sure and am not sure how to debug…) -> Fixed;
  • I have removed the support for vim modelines. There is a dedicated plugin for that if needed; let’s not mix everything up! -> I actually enhanced the support for it, as well as added Emacs modelines;
  • I migrated the EoL from dos to unix;
  • I removed things that I thought were useless; I hope they actually were!

@Frizlab Frizlab mentioned this pull request Jan 23, 2026
@Frizlab
Copy link
Copy Markdown
Contributor Author

Frizlab commented Jan 23, 2026

Okay. The tests run now (I spent quite a lot of time discovering I had Modelines installed twice, somehow…). I have fixed the obvious syntax errors. Now the tests do not pass, but at least I have a working environment to fix the issues.

@Frizlab Frizlab marked this pull request as draft January 23, 2026 12:53
@Frizlab
Copy link
Copy Markdown
Contributor Author

Frizlab commented Jan 23, 2026

I also intend on completely changing the algorithm for detecting a modeline.
Currently we’re using the comment char that we request from the view, but I intend on using a static token-based recognition.

The rationale for that is we allow changing the syntax of the file, which means the comment char will probably incorrect if the syntax of the file is incorrect…

I think we could probably have the tokens like so (full-line regex):

.+~~\s*(st|sublime):.*~~[^~]*

(We assume here no comment will need to end with a ~ character.)

That would make any of these modelines recognized:

#~~st: x_syntax swift~~

# ~~st:x_syntax swift~~

// ~~sublime: x_syntax swift~~

↓ Syntax is `swift`, no trailing space. Keys and values are always trimmed. (Same for `value`, obviously.)
// ~~sublime: x_syntax swift ; key value ~~

↓ Preferred syntax.
/*~~ sublime: x_syntax swift ~~*/

And those would not be recognized:

↓ No `~~` at the end.
# ~~st:x_syntax swift ~

↓ Missing `~` before `st`.
# ~st: x_syntax swift ~~

↓ Space after `st`.
# ~~st : x_syntax swift ~~

What do you think?

EDIT: Syntax changes.

@michaelblyons
Copy link
Copy Markdown
Contributor

michaelblyons commented Jan 23, 2026

You don't think \p{P}{1,4}\s*(st|sublime): is good enough?

@Frizlab
Copy link
Copy Markdown
Contributor Author

Frizlab commented Jan 23, 2026

It’s very edge-casy, but there is dnl.

@michaelblyons
Copy link
Copy Markdown
Contributor

If you want to check ST3 compat, UnitTesting has a GH Action that can do it for you. There's probably not any divergence between platforms, so ST3, ST4 on Ubuntu is probably enough.

If you have CI minutes to burn. 😅

@Frizlab Frizlab changed the title Modernize repo and make sure it work with ST4 Modernize repo and make sure it works with ST4 Jan 24, 2026
@Frizlab
Copy link
Copy Markdown
Contributor Author

Frizlab commented Jan 24, 2026

Yes I noticed the UnitTesting repo has a GitHub Actions for testing in the CI and thought about setting that up.

Thanks for the review! I have not finalized everything yet, the PR is still a draft for now (I have to implement the format change, cleanup the tests even more, etc.) I will do the changes you proposed/requested before marking the PR ready.

@michaelblyons michaelblyons linked an issue Jan 24, 2026 that may be closed by this pull request
@Frizlab
Copy link
Copy Markdown
Contributor Author

Frizlab commented Mar 2, 2026

I may be over-engineering things and have 0 time, but I’m still on it! \o/

@michaelblyons
Copy link
Copy Markdown
Contributor

I'm still loosely watching your progress. (Great work, btw!)

If you hadn't noticed, some time in the last two days, the CI started failing without test output.

@Frizlab
Copy link
Copy Markdown
Contributor Author

Frizlab commented Mar 6, 2026

Thanks!

Yes, I know, I intend to fix that before marking the PR ready.

I'm missing the parser for the VIM and classic modelines, as well as fixing and adding some tests and then I'll be good!

@Frizlab
Copy link
Copy Markdown
Contributor Author

Frizlab commented Mar 9, 2026

The core is done.
Now on to fixing and adding a few tests, and we should be good!

@Frizlab Frizlab force-pushed the develop branch 2 times, most recently from c15208d to c3b822d Compare March 10, 2026 11:12
@Frizlab
Copy link
Copy Markdown
Contributor Author

Frizlab commented Mar 10, 2026

Hi @michaelblyons!
I’m apparently hitting a road-block now.

Locally the few tests I have restored work. Using UnitTesting/sbin/run_tests.py, the tests also work!
However, using the GitHub Actions, I get no output at all.

I’m not sure how to debug that. Do you have some insight on how I could proceed?
I’ll continue working on the tests locally in the meantime.

Thanks

@michaelblyons
Copy link
Copy Markdown
Contributor

Does it help you to debug if you set capture_console to true? Either with the CI yaml or with unittesting.json?

Then you should be able to see any print statements (or logging?) and see how far your program executed.

@Frizlab Frizlab force-pushed the develop branch 9 times, most recently from e03a884 to 8c3cbaa Compare March 10, 2026 19:32
Frizlab added 27 commits March 20, 2026 21:27
They are now properly ordered by reverse date of contribution.
Inform this setting needs a full plugin reload to take effect.
@michaelblyons michaelblyons merged commit 7bd1747 into SublimeText:master Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add to Package Control

4 participants