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

chore: adjust syntax to python type hints #246

Merged
merged 3 commits into from
Jun 26, 2023
Merged

chore: adjust syntax to python type hints #246

merged 3 commits into from
Jun 26, 2023

Conversation

deathaxe
Copy link
Contributor

This PR provides required adjustments for pyright's syntax to work with sublimehq/Packages#3736.

Unfortunately some of mensioned PRs changes break current syntax and I found no sane way around it.

@deathaxe
Copy link
Contributor Author

sublimehq/Packages#3736 has been merged and might be released with one of then next ST dev builds.

@jfcherng
Copy link
Collaborator

jfcherng commented Jun 25, 2023

What will happen for current stable build users if we merge and release this?

@deathaxe
Copy link
Contributor Author

deathaxe commented Jun 25, 2023

This being merged requires another 415x- version prefix to be defined to restrict them to those ST builds shipping new python syntax including PR 3736. The resulting changes to pyright's syntax are not forward or backward compatible. This PR won't work with ST4150 but without this PR pyright's syntax will fail with any upcomming ST415x build. I know that's unfortune, but I didn't found a way to work around it.

I haven't investigated impact of implementing sublimehq/Packages#3793 so far.

@jfcherng
Copy link
Collaborator

jfcherng commented Jun 25, 2023

In that case, I would choose to vendor (like https://github.com/sublimelsp/LSP-pyright/blob/st3/syntaxes/Python.sublime-syntax) Python syntax file with PR #3736 until there is a new stable release. Because LSP-pyright already branches ST 3 release and ST 4 release, I wouldn't like to create yet another one.

And if we vendor it, this can be kind of being merged right now.

@jfcherng jfcherng added the syntax definition Wrong code highlighting in the popup label Jun 25, 2023
@deathaxe
Copy link
Contributor Author

Sounds like a plan to make transition smoother.

jfcherng added a commit that referenced this pull request Jun 26, 2023
For smoother transition, see #246

Signed-off-by: Jun-Fei Cherng <[email protected]>
@jfcherng
Copy link
Collaborator

Let's change

extends: Packages/Python/Python.sublime-syntax

to

extends: Packages/LSP-pyright/syntaxes/Python.sublime-syntax

@jfcherng jfcherng changed the title Adjust syntax to python type hints chore: adjust syntax to python type hints Jun 26, 2023
@jfcherng jfcherng merged commit 41affef into sublimelsp:master Jun 26, 2023
@deathaxe deathaxe deleted the fix/adjust-typing-syntax branch June 27, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syntax definition Wrong code highlighting in the popup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants