Skip to content

DragonKnightOfBreeze/Paradox-Language-Support

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6,518 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paradox Language Support

-- The Paradox Chronicle Project

中文文档 English Documentation Reference Docs Discord
GitHub Release License Plugin Homepage Plugin Version Plugin Downloads Plugin Rating
Supported by JetBrains

Overview

Paradox Language Support is the IntelliJ IDEA plugin designed specifically for Paradox game mod developers, which provides an intelligent, efficient and feature-rich development experience to help you easily achieve creativity.

Core Features:

  • Multi-Language Support: Full support for the script language, localization language and CSV language used in mod development, as well as the CWT language for writing configs.
  • Rich Language Features: Provides code highlighting, code navigation, code completion, code inspection, code refactoring, quick documentation, inlay hints, live templates, code hierarchy, diff viewing, diagrams and many other features.
  • Image Processing: Supports previewing and rendering DDS and TGA images, and allows conversion between different image formats (PNG, DDS and TGA).
  • Enhanced Information Hints: Displays key information such as localisation text, images, scopes, and parameters intuitively through quick documentation and inlay hints.
  • Advanced Language Features Support: Compatible with various advanced features in script and localization languages, including parameters, scopes, complex expressions, inline scripts, definition injections, etc.
  • Extensible Config System: Supports customizing and importing config files to enhance features like code navigation, code completion and documentation hints.
  • Tool Integrations: Integrates practical tools like Image Magick, Translation Plugin and Tiger to boost development efficiency.
  • AI Assistance: Preliminary integration of AI technology for translating and polishing localisation text.
  • Directory Detection: Automatically detects game and mod directories.

The plugin implements its core language features based on its own config system. The CWT config files it uses follow basically the same syntax and format as CWTools, with certain improvements and extensions. The plugin comes with the latest built-in configs, ready to use out-of-the-box. It also supports to customize and import config files to meet personalized development needs.

Installation

Using the IDE built-in plugin system

Settings/Preferences > Plugins > Marketplace > Search for "Paradox Language Support" > Install

Using JetBrains Marketplace

Go to JetBrains Marketplace and install it by clicking the Install to ... button.

Manual Installation

Download the latest release and install it manually (No need to unzip): Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

Getting Started

Usage Steps:

  1. Open your mod's root directory in the IDE.
  2. Open the mod descriptor file (descriptor.mod, or .metadata/metadata.json for VIC3 and EU5).
  3. Click the mod settings button in the floating toolbar at the top right of the editor.
  4. Configure the mod's game type, game directory, and required mod dependencies.
  5. Confirm the configuration and wait for the IDE to finish indexing.
  6. Then enjoy your mod development voyage.

Practical Tips:

  • Global Search:
    • Use Ctrl + Shift + R or Ctrl + Shift + F to search within the current project, directory, or a specified scope.
    • Use Shift + Shift (Search Everywhere) to quickly find files, definitions, scripted variables, and other symbols.
  • Code Navigation:
    • Use Ctrl + Click to jump to the declaration or usage of a target.
    • Use Ctrl + Shift + Click to jump to the type declaration of a target.
    • Use Alt + Click to jump to the declaration of the relevant config for a target.
    • Use Shift + Alt + Click to jump to the declaration of the relevant localization for a target.
    • Use Ctrl + Shift + Alt + Click to jump to the declaration of the relevant image for a target.
    • Use the Navigate menu (or the Go To option in the editor's right-click menu) for quick navigation.
    • Use Navigate > Definition Hierarchy to open the type hierarchy window and view definitions of specific types.
    • Use Navigate > Call Hierarchy to open the call hierarchy window and view the call relationships of definitions, localizations, scripted variables, etc.
    • Select the Paradox Files view in the project panel to browse aggregated game and mod files.
    • Select the CWT Config Files view in the project panel to browse aggregated config files.
  • Code Inspection:
    • View issues in the current file within the Problems panel.
    • Use Code > Inspect Code… to perform a global code inspection and view the detailed report in the Problems panel upon completion.
  • Modifying Settings:
    • Access the plugin's global settings page via:
      • Settings > Languages & Frameworks > Paradox Language Support
    • Open the mod settings dialog via:
      • Clicking the blue gear icon in the editor's top-right floating toolbar.
      • Selecting Paradox Language Support > Open Mod Settings... from the editor's right-click menu.
      • Selecting Tools > Paradox Language Support > Open Mod Settings... from the main menu.
    • Modify preferred locale, default game type, default game directory and other functional details in the global settings.
    • Adjust game directory, mod dependencies and other configurations in the mod settings.
  • Troubleshooting:
    • Ensure both the IDE and the plugin are updated to the latest versions.
    • If the issue might be index-related, try to invalidate caches and restart the IDE.
    • If the issue might be config-related, try to write custom config files.
    • If the issue might be plugin configuration-related, try deleting the plugin's configuration file (paradox-language-support.xml, recommended to locate using Everything).
    • Feedback is welcome through GitHub, Discord and other channels.

Known Limitations:

  • The plugin's support for some complex language features of script files and localisation files is not yet complete, and is still being improved. Feedback is welcome.
  • The quality of config-driven features (such as code completion, code inspection and quick documentation) depends on the completeness and up-to-dateness of the CWT config files for each game. Currently, configs are actively maintained for Stellaris, Victoria 3 and Europa Universalis V. Configs for other games (such as Crusader Kings III and Hearts of Iron IV) may be outdated, which can result in false warnings or missing completions. Contributions to the config repositories are very welcome.
  • Some advanced or uncommon scripting patterns (e.g. definitions declared within inline scripts, complex localisation commands) are not yet fully supported, and are being improved progressively.

Technical Details

  • Built on the IntelliJ Platform SDK, developed with Kotlin, and utilizes PSI (rather than LSP) for deep language parsing and manipulation.
  • Uses BNF for grammar parsing and JFlex for lexical analysis.
  • Employs an extension point mechanism for dynamic functional expansion, facilitating customization and enhancement of plugin behavior by both the plugin itself and mod developers.
  • Includes a built-in custom code injectors for achieving IDE features that cannot be accomplished by conventional means.
  • Integrates image processing, translation and lint tools to optimize and extend plugin capabilities.
  • Preliminary integration of AI technology for translating and polishing localisation text.

Reference Links

Official Documentation:

Tools & Plugins:

Tutorials & Wikis:

Contribution & Support

All forms of contribution and support are welcomed, including but not limited to:

If you are interested in submitting a PR, but have any questions about plugin development or config writing, feel free to contact us via email or Discord.

Contributing to Config Files:

Given the plugin's config-driven architecture, contributing to the CWT config files is one of the most impactful ways to improve support for a specific game. Config files define the semantics (definitions, modifiers, scopes, effects, triggers, etc.) that power code completion, code inspection and documentation — keeping them up to date directly improves the experience for all users of that game.

See the config repositories for links, and the config documentation for guidance on the config format.

For a list of current maintainers and contributors, see CONTRIBUTORS.md.

Acknowledgments

Powered by

JetBrains logo.

About

The IntelliJ IDEA plugin designed specifically for Paradox game mod developers, which provides an intelligent, efficient and feature-rich development experience to help you easily achieve creativity.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors