FileIncludeProvider -- what it's for?

Answered

I've implemented FileIncludeProvider, but I've got no idea what it's actually for (first I thought it would be providing a reference to other files, but obviously it doesn't -- I guess I need a separate ReferenceProvider for that).

Also, there is no information on FileIncludeInfo, especially on the "offset" and the flag "runtimeOnly".

Any info would be quite helpful.

Cheers

Chris

3 comments
Comment actions Permalink

FileIncludeProvider is used, i.e., to handle a reference to the file when you import a file in CSS with @import "path/to/file". See https://plugins.jetbrains.com/intellij-platform-explorer?extensions=com.intellij.include.provider for some implementation examples.

 

 

0
Comment actions Permalink

Dear Jakub,

thank you for your answer. However, I have to admit that there was no gain in knowledge for me. I would suggest that the API and it's purpose should be clearly documented.

0
Comment actions Permalink

It is used by com.intellij.psi.impl.include.FileIncludeManager to build list of including/included files.

'offset' can be used to locate the actual include element in com.intellij.psi.impl.include.FileIncludeManager#processIncludingFiles "Processor"

'runtimeOnly'/'compileTimeOnly' can be used to distinguish different scopes (e.g. project vs libraries)

0

Please sign in to leave a comment.