Skip to content

IDE Freeze During SQL Formatting #393

@xterao

Description

@xterao

Describe the bug
Running the SQL formatter on certain SQL statements causes IntelliJ IDEA to freeze.

This issue occurs specifically when a literal value (number, string, boolean, etc.) is passed as a parameter in a method call.

  • Problem case: Literals used as method call parameters
  • Not affected: Cases where DAO method parameters are used, or when literals are used outside of method parameters.

To Reproduce
Example that triggers the freeze:

SELECT * 
  FROM employee 
 WHERE id = /* employee.getParam(1) */0

The formatter now handles this case without causing IDEA to hang.

Expected behavior
The SQL formatter should handle this case and reformat the SQL normally without freezing.

Desktop :

  • IDEA Version: 2024.3.6 Community Edition
  • Doma Tools Version : 2.1.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions