Skip to content

Treat main run configuration file as root #1198

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

Conversation

sizmailov
Copy link
Contributor

@sizmailov sizmailov commented Jan 22, 2020

This PR uses main files from run configurations as primary definition of "root documents". This has advantages over current scheme:

  • can be easily controlled by user
  • better following of latex logic on complicated cases
  • generally speaking a number of "root document contexts" comes in play. It becomes important when a file is included in multiple root document with different definitions, etc.

The current scheme is not bad, but it's collection of guessing after all. I think it should be used as fallback strategy (e.g. when there is no run configurations)

This PR is only first step in this direction. Actions/Intentions should be adjusted, "root document contexts" should be introduced.

Fixes #753

Additions

Changes

Changed PsiFile.isRoot check to be true for all main files in run configurations

Backwards incompatible changes

Probably they exist, but I'm not aware of any

even if it doesn't have \documentclass or \begin{document}
even if they doesn't have \documentclass or \begin{document}
@sizmailov
Copy link
Contributor Author

I've tested failing test manually, I have not I idea what went wrong.

@PHPirates PHPirates added this to the b0.6.9 milestone Jan 22, 2020
@PHPirates
Copy link
Collaborator

@sizmailov It appeared to have something to do with that the tests don't set up the index correctly. But I'm not going to fix that just for this, it sounds too complicated :)

@PHPirates PHPirates merged commit 454b441 into Hannah-Sten:master Jan 23, 2020
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.

Use document environment to determine root file
2 participants