# CSS plugin not using 'resolveScopeEnlarger'

**URL:** <https://platform.jetbrains.com/t/css-plugin-not-using-resolvescopeenlarger/71>\
**Category:** IntelliJ Platform\
**Created:** [February 3, 2025, 7:17pm UTC](https://platform.jetbrains.com/t/css-plugin-not-using-resolvescopeenlarger/71 "2025-02-03T19:17:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![illuminatedcloud](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/illuminatedcloud/32/55_2.png) [@illuminatedcloud](https://platform.jetbrains.com/u/illuminatedcloud)\
**Post date:** [February 3, 2025, 7:17pm UTC](https://platform.jetbrains.com/t/css-plugin-not-using-resolvescopeenlarger/71/1 "2025-02-03T19:17:42Z")

</div>

_Posted both here and on Slack as we migrate from the latter to the former._

What is the best way to ensure that a CSS file bundled in a plugin is included in the resolve scope of a project CSS file?

I’ve tried implementing both `indexedRootsProvider` and `resolveScopeEnlarger` just as I have in the past for this same need in JavaScript, but my implementations of those EPs are not being called.

Digging in with the debugger, resolution is happening in `CssCustomPropertyReference#multiResolve()` which calls `CssUtil#getCompletionAndResolvingScopeForElement()` which in turn calls `CssUtil#getCompletionAndResolvingScopeForModule()` which _does not consult_ those standard EPs for extending the resolution scope.

It does, however, call `ScriptingLibraryMappings#getLibraryScopeForFile()`, so it looks like I _could_ implement that EP to make this work, but it just doesn’t seem right to implement a JavaScript plugin EP to extend the resolution scope for a CSS plugin element/file.

Anyone have any insights into the best way to make sure that bundled CSS files are included during resolution from project CSS files?

**UPDATE:** I’ve worked around this by adding completion and reference contributors for `CssCustomProperty` elements that use the bundled files. This, of course, still required registration of the custom `indexedRootsProvider` so that the referenced files are properly indexed, but I have it working. I can’t imagine that this is the correct/desired behavior, though. Shouldn’t `indexedRootsProvider` and `resolveScopeEnlarger` be used for resolution by the IDE’s own plugins?

---

<div class="post-metadata">

**Author:** ![illuminatedcloud](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/illuminatedcloud/32/55_2.png) [@illuminatedcloud](https://platform.jetbrains.com/u/illuminatedcloud)\
**Post date:** [February 11, 2025, 4:35pm UTC](https://platform.jetbrains.com/t/css-plugin-not-using-resolvescopeenlarger/71/4 "2025-02-11T16:35:47Z")

</div>

**UPDATE 2:** Given the lack of responses here, I’ve logged this in YouTrack as a bug:

> **[CSS plugin not using 'resolveScopeEnlarger' : WEB-71648](https://youtrack.jetbrains.com/issue/WEB-71648)**
>
> I originally posted this in the new JetBrains Platform Discourse group: \[https://platform.jetbrains.com/t/css-plugin-not-using-resolvescopeenlarger/71\](https://platform.jetbrains.com/t/css-plugin-not-using-resolvescopeenlarger/71?u=illuminatedcloud)...

Hopefully it will get some traction there.
