module.md: add "Storing a reference to a Module"

This commit is contained in:
Yann Cébron 2023-10-30 14:53:15 +01:00
parent ae34f49081
commit 0290575c07
2 changed files with 11 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# Content Updates
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Content Updates
<link-summary>Notable updates and additions to this documentation.</link-summary>
This page lists notable additions and updates to the SDK documentation and [](code_samples.md).
@ -18,6 +18,10 @@ See [GitHub Changelog](https://github.com/JetBrains/intellij-sdk-docs/commits/ma
Kotlin Persisting State Component
: Add an [example](persisting_state_of_components.md#implementing-the-persistentstatecomponent-interface) of a persistent state component implemented in Kotlin.
Minor Changes and Additions
:
- Add section [](module.md#storing-a-reference-to-a-module).
### September
{#september-23}

View File

@ -113,6 +113,11 @@ String moduleName = module == null ? "Module not found" : module.getName();
* To get the project module to which the specified [PSI element](psi_elements.md) belongs, use the `ModuleUtil.findModuleForPsiElement()` method.
### Storing a reference to a Module
Use [`ModulePointer`](%gh-ic%/platform/projectModel-api/src/com/intellij/openapi/module/ModulePointer.java) to store a reference to a `Module` by its instance or name.
A removal or rename of the `Module` will be tracked automatically.
### Accessing Module Roots
Information about module roots can be accessed via [`ModuleRootManager`](%gh-ic%/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleRootManager.java).