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

Option for detecting f strings. #7265

Open
1 task done
Trashminimu opened this issue Jun 7, 2018 · 8 comments
Open
1 task done

Option for detecting f strings. #7265

Trashminimu opened this issue Jun 7, 2018 · 8 comments

Comments

@Trashminimu
Copy link

Issue Report Checklist

Enhancement proposal

Hello,

It would be nice to have an option in Spyder which, when turned on, detect when '{' or '}' are written in string. It would then add a 'f' in front of the string in order to set up a formatted string.

Hope to see this feature in Spyder one day.

Thanks for your amazing work !

@ccordoba12
Copy link
Member

Thanks for reporting. We'll take a look at this in a future release.

@CAM-Gerlach
Copy link
Member

@ccordoba12 Isn't adding new substantive enhancements now frozen after 3.3.0? Or has that changed?

@ccordoba12
Copy link
Member

@dalthviz, please work on this one.

@ArnoVel
Copy link

ArnoVel commented Mar 8, 2021

Hi,
I'm currently using Spyder version 4.2.1 and I noticed f-strings are not supported.
More specifically, there is not syntax highlighting in the editor, see screen capture below:

Screenshot from 2021-03-08 13-54-33
Compared to atom:
Screenshot from 2021-03-08 13-55-45

Is this feature coming to future versions ?

@ccordoba12 ccordoba12 modified the milestones: not sorted, 4.x (missing) Mar 16, 2021
@arnisjuraga
Copy link

I am using Spyder 5.2.1 and f-strings are still not highlighted in editor.

For example code:

classname = "title"
html1 = f'''<h1 class="{classname}">Hello, world!</h1>'''
classname = ["title","title-default"]
html2 = f'''<h1 class="{" ".join(classname)}">Hello, world!</h1>'''

could look something like:

image

Instead it's all green as mentioned in previous comments.
Example code is valid python3.6:

>>> html1
'<h1 class="title">Hello, world!</h1>'
>>> html2
'<h1 class="title title-default">Hello, world!</h1>'

@ccordoba12
Copy link
Member

This functionality will come in Spyder 6 because it requires that we integrate with a new syntax highlighting library.

@ccordoba12 ccordoba12 modified the milestones: 4.x, v6.2.0 Nov 16, 2023
@Knarf224
Copy link

Knarf224 commented Feb 7, 2025

Im on Spyder 6 and it looks like it still isnt working. Is this feature expected?

@dalthviz
Copy link
Member

dalthviz commented Feb 7, 2025

Hi @Knarf224 this is indeed over the backlog/list of features to be implemented for Spyder 6. To be more specific, for the moment, the idea is to have this available for Spyder 6.2.0 (current latest release for Spyder 6 is 6.0.4). Also, although this prioritization can change in the future, if the issue is still open definetly is something we will try to check in a future release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants