-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Support lstinputlisting label #1698
Support lstinputlisting label #1698
Conversation
I am not quite happy with the implementation yet because of the need of the many case distinctions in different places. I think there is a potential for a more general framework, but until such a framework emerges this implementation should be better than nothing. |
src/nl/hannahsten/texifyidea/inspections/latex/LatexLabelConventionInspection.kt
Outdated
Show resolved
Hide resolved
If you mean the manual check for |
Yes, that's what I meant. Of course, the case destinction needs to happen somewhere, but it would be preferrable to have it in a central place. Currently the distinction is scattered over several different places. I think |
True, but even if you use the metadata, you still have the case distinction everywhere, except that then it checks the metadata instead of the information in Magic. The advantage of Magic is that everything is together, though I guess if you would use metadata then you still need to describe the possible 'properties' of a command somewhere in a central place, which would amount to a Magic kind of thing but then not yet specifying which commands have a certain property, as the commands do that themselves. PS one other thing I forgot until I got an exception: when changing parser/stub related things you need to update the stub version in LatexParserDefinition, I just did that. |
Find Usages functionality does not yet work. For that, the reference needs to resolve to the lowest level psi element: e.g. |
Neither am I, it is more of a vague feeling that there is potential for improvement. I will think about it.
Thanks! |
# Conflicts: # gen/nl/hannahsten/texifyidea/grammar/LatexLexer.java # src/nl/hannahsten/texifyidea/grammar/Latex.bnf # src/nl/hannahsten/texifyidea/psi/LatexLanguageInjector.kt # src/nl/hannahsten/texifyidea/settings/sdk/NativeTexliveSdk.kt
I think now it should cover everything. Sorry for the massive PR, I didn't expect the issue to be so complicated. |
Awesome! Will take a look soon. It's not too bad, there's only like 8 files with 30+ lines changed, rest is minor or generated stuff (which unfortunately we still need to commit to the repo: JetBrains/gradle-grammar-kit-plugin#3) |
@PHPirates I hope I understood your points correctly and this is roughly what you had in mind. If not, let me know and I will adapt it. |
Great, thanks for all the effort! It seems to work now, and also the psi tree is making a lot more sense now than it previously was. I will take a look in more detail tomorrow, but I think all the important parts are there correctly now. I hope you still enjoyed going the extra mile for this PR to improve the parser :) |
Great! I did indeed and I learned a lot about Latex and the parser. |
# Conflicts: # src/nl/hannahsten/texifyidea/LatexParserDefinition.kt
@fberlakovich There's two things I still found, not sure if you have time to fix them:
|
Sure, I will have a look! |
@fberlakovich we recently went through the project board (still have to update it) and we stumbled upon these issues as well:
|
Sure, the duplicate label detection shouldn't be a big thing. Regarding the UI, we already discussed possible implementations on Gitter. I definitely have it on my list, but I can't promise a time frame. I don't have experience with settings/UI stuff and I am not sure yet when I will be able to spare the time. That is, I won't be annoyed if somebody else implements it first ;). |
Fix #1694
Summary of additions and changes
lstinputlisting
How to test this pull request
See the included testcases
Wiki
I guess the existing documentation is already general enough to include this extension.