LogoPluginCraft.dev

Bad Code Completion

Notes

CLion can and does ignore some build flags. For example, it ignores the -Werror flag when it lints a file.

If you are testing whether the code completion is accurate or not, it's better to check the definitions and include paths.

Reload the workspace

If the build configuration changes, the workspace needs to be reloaded.

Normally, the IDE shows a notification to do so, but if this is not present, you can reload the workspace manually from the Jam Output Console.

Screenshot showing how to reload the workspace
Preview
Reload the workspace from the Jam Output Console or using the reload button in the notification when prompted.

Reloading doesn't help

You can check what the plugin sees: Use the action Find Jam Build Command For Current File from the Jam Output Console.

This action will invoke Jam and parse its output, specifically looking for the currently open source file.

Screenshot showing the action 'Find Jam Build Command For Current File' from the Jam Output Console
Preview
The build command of the currently active file can be found using the action 'Find Jam Build Command For Current File' from the Jam Output Console.

You can open the result in the command parser settings for further inspection.

Screenshot showing command-found dialog
Preview
If the build command finder is successful, the build command can be opened in the parser settings editor for further inspection.

Here you can see what build command was found by the plugin for the selected file and also see what CLion receives from it.

Screenshot of a successfully found build command in the command parser editor
Preview
The command parser settings editor has a 'Try It Out' section, where a build command can be entered by hand or imported for source files for testing.

The build command differs from what I expect

If you expect a different build command, the problem is most likely the Jam build command.

You can verify this in the Workspace tab in the Jam Output Console, along with the working directory.

You may also want to see Jam's output yourself: Add -a -n to the normal Jam invocation that you would use and analyze the output. These options will instruct Jam to simulate a full rebuild, printing all build commands, but without executing them.

The build command looks good, but the code completion is still bad

  1. Open the source file in question.
  2. Help -> Diagnostic Tools -> Show Compiler Info.

What you get is what CLion sees after processing the given build command.

If the contents of this file are good, I can no longer help.

Otherwise, if you think there is a problem with the plugin itself, feel free to report the issue here: Feedback