Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Linter-Clang 'Fix' Recommendations Applying Faulty Corrections #240

Open
@HipplerJ

Description

@HipplerJ

Description

First, I apologize if I've submitted this bug report to the wrong issue queue. I'm not entirely sure if the issue resides with Atom of the Linter/Linter-clang package.

I've noticed in some instances when linter recognizes a compilation error or warning and offers a Fix/Resolution, it will often append the correction to the wrong location in the document, sometimes on an entirely different line than where the error exists. In addition, when this error happens, I’d also lose the ability to navigate through the document using the arrow keys until I clicked somewhere on the screen with the mouse and reset the cursor.

In the image below, I declared a function that receives an integer pointer, but intentionally neglected to pass it the integer variable 'accepted' by reference. Linter recognized the error, noted its location and details, and recommended a solution. When I select the option 'Fix' to implement linter's solution, it added the required ampersand (&) in the line above at an incorrect index.

This does not happen every time the linter fix option is implemented (issue is intermittent), but it does happen pretty frequently.

screen shot 2018-06-06 at 2 04 01 pm

Steps to Reproduce

  1. Download Linter/Linter-clang packages
  2. Create a C/C++ compilation error/warning like a missing semicolon or passing a variable by reference without the necessary ampersand.
  3. Use Linter's 'Fix Solution'
  4. See if solution was implemented to the correct or incorrect location

Expected behavior: In my instance in the image above, linter should have added the ampersand before the 'accepted' variable being passed to the introduction function

Actual behavior: Linter adds the ampersand to the line above (almost randomly) right in the middle of my socket variable "establishedConnectionFD"

Reproduces how often: 15% -20% Occurrence. Relatively intermittent but it does happen enough (and on different systems) to likely be a problem.

Versions

Operating System:
macOS High Sierra
Version 10.13.4

$ atom --version
Atom : 1.27.2
Electron: 1.7.15
Chrome : 58.0.3029.110
Node : 7.9.0

$ apm --version
apm 1.19.0
npm 3.10.10
node 6.9.5 x64
atom 1.27.2
python 2.7.10
git 2.10.1

$ apm list --installed --bare
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions