-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Inline input #2741
Inline input #2741
Conversation
Now it will scan ahead to the next terminating command instead of only looking one ahead. This had the issue of *any* command being able to get in the way and force the rest of the file to be gobbled up, now it should work as intended on Hannah-Sten#2724
Now it will only consider commands that appear *after* the current command. It will now only consider commands ahead of the one passed, but right now requires that a chapter or section is passed.
No dialog, no error messages, just core functionality. This took me the better part of a few hours so I would hope someone with more experience can take it from here.
All tests via gradle passed locally on ubuntu, not sure what is going on there. |
If you click through on the red cross, you can see it's the linter that's failed. You can easily fix this by running the |
Created Files#getUniqueFileName(String, String?). Should have no impact on existing code, but allows creating the smallest unique file.
It took a lot of hoop-jumping, but now MoveSectionToFile can be undone which will properly undo file creation. It will also use the first availible filename.
Oh those are code-style related. I dont see the project having its own formatting rules, or at least the default one makes that gradle task scream red at me. I fixed the issues by hand this time and I would much appreciate not having to do that every time so i can use the shortcut |
Fixes the issue of extraction when the last end command is not also EOF
Fix bugs for unit tests and improved stability
It does, see the |
I have "Enable editorconfig support" ticked, but it still doesnt want to get the indentations right |
Create a function that can be reused to create a file without java.io
Allow for variable file extensions, and non LatexFile creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, it works great for me! Thanks so much for adding all the tests :)
Just a few minor things and then it should be good to go.
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileProcessor.kt
Outdated
Show resolved
Hide resolved
So I think that scope selection is silly, and will only implement it on request, search in comments is silly, and will do so only on request, and I am satisfied with the state of it pending @PHPirates 's review |
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileHandler.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one exception which I couldn't reproduce myself: (I think intellij was still in progress with resolving files or something?)
java.lang.IllegalStateException: Inline this requested with no original reference (2)
at nl.hannahsten.texifyidea.refactoring.inlinefile.LatexInlineFileProcessor.performRefactoring(LatexInlineFileProcessor.kt:52)
at com.intellij.refactoring.BaseRefactoringProcessor.lambda$doRefactoring$10(BaseRefactoringProcessor.java:520)
at com.intellij.refactoring.BaseRefactoringProcessor.callPerformRefactoring(BaseRefactoringProcessor.java:574)
at com.intellij.refactoring.BaseRefactoringProcessor.lambda$doRefactoring$11(BaseRefactoringProcessor.java:519)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runEdtProgressWriteAction$6(ApplicationImpl.java:919)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:190)
...
How did you do that? Was it seemingly random and fixed itself? |
I think I clicked "Inline this and keep file" but not sure |
Woah I duplicated it |
src/nl/hannahsten/texifyidea/refactoring/inlinefile/LatexInlineFileProcessor.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Do you want to write the documentation for the wiki as well?
Oh, right. theres a wiki. Do you have something in mind? Maybe I could after I make a solution for #2751 to complete the inline concept to the extent that the IDEA space has for other languages? |
Sure, that's fine |
Actually I will make the page. I had thought there was code and commits to deal with but that isnt the case so I will write a page to get it started |
Thanks! It's actually still code and commits though, just a different repo. You can also clone the wiki locally to edit it :) |
Fixes #2740
Summary of additions and changes
\include
calls and remove the definition file.TODO
Allow Scope selectionHow to test this pull request
Create two files, one containing an include of the other.
other.tex