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

[Python] Fix completions in f-string replacement #4185

Merged

Conversation

deathaxe
Copy link
Collaborator

@deathaxe deathaxe commented Mar 4, 2025

fixes #4184

This commit removes source.python.embedded scope from f-string replacements as this causes ST to treat it as external syntax, which prevents word-completions of e.g. variables from being suggested.

deathaxe added 2 commits March 4, 2025 19:24
fixes sublimehq#4184

This commit removes `source.python.embedded` scope from f-string replacements
as this causes ST to treat it as external syntax, which
prevents word-completions of e.g. variables from being suggested.
@deathaxe deathaxe force-pushed the pr/python/fix-fstring-completions branch from 78e4139 to 8d02f32 Compare March 4, 2025 18:46
@deathaxe deathaxe merged commit a28c7c2 into sublimehq:master Mar 5, 2025
1 check passed
@FichteFoll
Copy link
Collaborator

Any suggesttions for my color scheme rule to highlight the background of embedded and interpolated sources that does not include the punctuation? Previously, I was able to simply use source source and catch Python f-strings. Now I assume I will have to use meta.interpolation - punctuation.section.interpolation, which is fine by me but just checking if we have this use case on the radar and agree that this is the proper way forward.

@deathaxe
Copy link
Collaborator Author

deathaxe commented Mar 5, 2025

As only few (none I am aware of) syntaxes add separate source..embedded for interpolation with their own syntax, meta.interpolation - punctuation is probably the most widely working approach.

You may however handle nested f-strings somehow to apply background without interruptions.

@deathaxe deathaxe deleted the pr/python/fix-fstring-completions branch March 5, 2025 11:30
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.

[Python] Missing autocompletions in format strings
4 participants