Skip to content

Conversation

@kutu
Copy link
Contributor

@kutu kutu commented Apr 10, 2025

before
image
after
image

@deathaxe
Copy link
Member

How about...

  class = 2

  class.class: 3

Maybe add some tests to tests/sublime_test_scope.coffee like


init: ->
  class: 1
# ^^^^^ variable.other.readwrite.coffee - keyword

  class = 2
# ^^^^^ variable.other.readwrite.coffee - keyword

  class.class: 3
# ^^^^^^^^^^^ meta.path.coffee
# ^^^^^ variable.other.object.coffee
#      ^ punctuation.accessor.dot.coffee
#       ^^^^^ variable.other.member.coffee

@kutu
Copy link
Contributor Author

kutu commented Apr 11, 2025

Apologies for being a noob in all this.

I was looking into other keywords "match" definitions, and they all work fine with just - match: keyword\b declaration, so why class was not working the same way was strange to me
I decided to just reorder classes with functions includes, and that worked

Also with my first commit, if I do undo in my code, and undo reaches code like class: 1 sublime just crashes. I guess that lookahead regexp is the issue.

Now with reordering, there is no issues, at least for me.

In your test example

class = 2

this is incorrect syntax

[stdin]:1:1: error: keyword 'try' can't be assigned

If all this makes no sense, you can safely delete my pull request, I will just use local Package version for myself.

Anyway, thank you for handling this.

@deathaxe
Copy link
Member

deathaxe commented Apr 11, 2025

Also with my first commit, if I do undo in my code, and undo reaches code like class: 1 sublime just crashes. I guess that lookahead regexp is the issue.

If you are reliably able to reproduce a crash with a couple of steps, an issue at https://github.com/sublimehq/sublime_text/issues woult be very appriciated, helping devs to reproduce and narrow down root cause. Maybe provide a branch with your previous state for them to use for debugging.

If all this makes no sense, you can safely delete my pull request,

It does make sense and contribution is very appriciated. I just asked to make sure not to miss anything, speaking as a CoffeeScript noop.

@deathaxe deathaxe merged commit c382839 into SublimeText:master Apr 11, 2025
5 checks passed
@kutu
Copy link
Contributor Author

kutu commented Apr 11, 2025

Crash happens without my commits.
https://github.com/user-attachments/assets/9234f357-4ec6-43c6-896a-aa3310a13c1d
Can you reproduce this?
If so, can you please report an issue by yourself, if you know better what info sublime's devs need.
Thank you.

@deathaxe
Copy link
Member

Well, I neither know anything about your setup (OS, architecture, ST version, ...) nor steps needed to cause a crash.

@kutu
Copy link
Contributor Author

kutu commented Apr 11, 2025

I downloaded portable sublime for Windows
Launched it with --safe-mode
Installed package control
Installed coffeescript plugin (this repository)
and then you can see it in video I posted

@deathaxe
Copy link
Member

This issue seems to be fixed already. I can reproduce in ST 4192, but no longer in 4196.

@kutu
Copy link
Contributor Author

kutu commented Apr 11, 2025

Good to know. Thank you for your time.

@kutu kutu deleted the patch-1 branch April 13, 2025 14:41
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.

2 participants