-
Notifications
You must be signed in to change notification settings - Fork 22
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
Rename symbol (F2) #169
Comments
We are planning on updating the semantics and features in the next major update (after syntax is complete). This update should make it a lot more easy to link symbols, and linked symbols would allow rename with F2. Unfortunately it might take a while for us to start working on this feature as we all don't have much spare time atm. I'll update this ticket as soon as more information is available |
Yeah, it seems like a long and repetitive job to update the semantics, looking at the file in syntaxes folder. If you want I can help with that. |
The plan is to update most of the existing features to use the tokenizer that has already been pushed to the syntax branch. The next goal is to create a token parser that would build the symbol database and the code graph. I already started some work on this. Any help would be very much appreciated, I'd say give me a month to finish the above mentioned part and after that it should be easy to use these features to update the rest. If you'd like to help with something right now, the tokenizer needs a copy of the syntax patterns in typescript. Some of them are already in there, but I didn't update it in a while. I'd love it if you could help me with updating that 😄 (From this file to this file) |
OK I can make a few. I didn't find a TokenPattern type, but taking a simple one, just turn the json into an object. ex: "renpy-statements": {
"patterns": [
{
"include": "#label"
},
{ "include": "#menu" },
{ "include": "#image" },
{ "include": "#audio" },
{ "include": "#transform" },
{ "include": "#scene" },
{ "include": "#camera" },
{ "include": "#show" },
{ "include": "#with" },
{ "include": "#style-old" },
{ "include": "#use-old" },
{ "include": "#screen-old" },
{ "include": "#return-statements" },
{ "include": "#jump" },
{ "include": "#call" }
]
}, const renpyStatements: TokenPattern = {
patterns: [
{ include: "#label" },
{ include: "#menu" },
{ include: "#image" },
{ include: "#audio" },
{ include: "#transform" },
{ include: "#scene" },
{ include: "#camera" },
{ include: "#show" },
{ include: "#with" },
{ include: "#style-old" },
{ include: "#use-old" },
{ include: "#screen-old" },
{ include: "#return-statements" },
{ include: "#jump" },
{ include: "#call" },
]
} |
Yes, that's about the gist of it. You can use the patterns in the comments of that file to convert them a bit more easily. Those patterns also apply some changes that are required, eg include pattern in not needed and name is converted to token |
TokenPattern is a type. You can find it here |
here are some conversions, you notice them because they are the ones with the errors, lol |
Yeah, the instructions weren't very clear, they where meant for me. Sorry about that. I'll try to explain. So, what you do is;
Hope that makes it more clear, I could send a visual example if it's still not :) |
But thanks a lot for the work you did so far! Any bit is already super helpful 🙂 |
https://code.visualstudio.com/docs/editor/refactoring#_rename-symbol
Enabling the renaming of a variable with f2, is a really convenient and safe thing to do (normal replace is very dangerous). but I don't know how complicated it is to implement.
The text was updated successfully, but these errors were encountered: