Override binding of attached projects doesn't work in WebStorm

Hi @Marco_Comi, I have updated to use the latest version of the plugin (6.1.0.38326), in the hopes that this might solve our issue, but alas, not. So, I’m not sure if it’s the same thing.

My scenario is that I am running webstorm and due to it’s limitation, I’m attaching multiple projects to my initial one (not using different modules). I then hook sonarlint up to the first project and connect the other projects using the new override bindings section, see below.
image

However, the overridden projects’ sonar issues are not being highlighted (they are, if I run both projects in separate webstorm instances). Am I just not setting things up correctly? Or does this fix not cover this scenario?

Thanks (much appreciate the updates:))

Hello @nita-au,

Sorry to hear that it doesn’t work for you. Could you send us a more details:

  • you should find some logs in the Log tab in the SonarLint tool window. Please activate verbose and analysis logs as described here. I am interested to check logs when you attach the project and when you open it separately, to see if there is any difference.
  • what language are you trying to analyze ?
  • what is the issue you expect to see ?

Thanks
Damien

Also another questions:

Could you share with us your project structure: what is the base directory (where the .idea/ folder is located) ?
Where are the original project and the attached project located on your disk ?

Hi @Damien_Urruty,

Sorry for taking a few days to get back to you.

  1. Logs are attached (both the separate and attached versions) note, for the attached versions, I opened app-1 in a new window first, grabbed the log, then attached app-2, setup sonar bindings and then grabbed the log
    app-1-log-attached.txt (3.7 KB)
    app-1-log-separate.txt (2.7 KB)
    app-2-log-attached.txt (12.0 KB)
    app-2-log-separate.txt (2.4 KB)
  2. Trying to analyse Typescript (there are other languages in other folders of app-1 and app-2, but they are not being analysed)
  3. There are a number of sonar issues in both projects, but I’ve been looking at a single file in each project. App-1 has 16 issues in the file and App-2 has 2 issues in the file. Note, when app-2 is “attached” to the app-1 project, I can still see all the sonar lint issues (in the current file tab)
    for app-1, just none for app-2.
  4. Project structure is that both apps are at the same level in the file system, with the .idea folder inside each, ie
    image

Also, for reference I’m on a Windows 10, running WebStorm 2021.2.3 build #WS-212.5457.55

Let me know if there is anything else that you need.

Thanks :slight_smile:

Hello @nita-au,

It’s not a problem with the module binding but more with the base directory, that is used to locate tsconfig.json files.

From app-2-log-separate.txt:

baseDir: C:\development\projects-playpen\sonarlint-test\app-2
Found 1 tsconfig.json file(s): [C:\development\projects-playpen\sonarlint-test\app-2\tsconfig.json]
C:/development/projects-playpen/sonarlint-test/app-2/src/app/acc-sub/test/test.component.ts matched C:\development\projects-playpen\sonarlint-test\app-2\tsconfig.json

From app-2-log-attached.txt:

baseDir: C:\development\projects-playpen\sonarlint-test\app-1
Found 1 tsconfig.json file(s): [C:\development\projects-playpen\sonarlint-test\app-1\tsconfig.json]
C:/development/projects-playpen/sonarlint-test/app-2/src/app/acc-sub/test/test.component.ts matched NO_CONFIG

As the base directory we use the folder of the first project opened. This causes the wrong tsconfig file to be detected and the file to analyze is ignored.

I created a ticket to fix this on our side, we need a bit more discussion to pick the right solution, so I don’t know when this will be fixed.

In the meantime I can think of one workaround: if you know that you will be working more on one of the 2 projects, you can open it first and then attach the second. Far from ideal of course

Thanks for helping us spotting the problem

1 Like