Project setup

已回答

I upgraded to 2023.3 and my project setup reverted, as though IntelliJ threw away the config I had before and reimported. I honestly don't remember exactly how I had it set up, but seems like a good time to ask for best practices given my requirements.

This is an AWS SAM project, so it is different from a typical one. It looks like this:

  • /root - this has source files like template.yaml, which is critical to a SAM app, plus things like .idea
    • /AppFunction - this has the main source code (mainly Kotlin) for the SAM application and is built with Gradle.
    • /client - this is my front end, a React app on Vite

This was built the standard way using the `sam` command line wizard. That puts template.yaml at the top and AppFunction inside.

I added the client directory since the front end is tied to the SAM app. I used “new module from existing source” to create a client module. I was hoping it'd recognize it as Vite, but said “no frameworks detected” on import. Not critical, I can run via command line.

Here's what I want:

  • Gradle tab recognizes code in AppFunction (this works now)
  • client code is recognized as source
  • top level code (/root) is recognized as code, no yellow highlighting (not working)

I can't figure out how to get the top level directory recognized as code. If I try to add a 3rd module using /root, it says it found source directories within /root/AppFunction/build and should it add them. Obviously not, that's build output! I unmark all, hit continue and it acts as if it's canceled since there are no source directories. 

P.S. The JetBrains AI assistant gave significantly wrong information, like yellow highlighting means not controlled by Git and even recommended I add my whole .idea directory to .gitignore and not track it, directly counter to JetBrains written best practices.

0

Hello whyphilip,

As AWS SAM functionality is provided by AWS Toolkit Plugin, you can address this question to Amazon Web Services support.

0

I realize my post was long, so I'll be briefer:

  • This isn't a problem with AWS SAM or any plugin, that's all working fine.
  • Upgrading to 2023.3 changed my IntelliJ project structure, which should never happen (clear IntelliJ bug, it also switched my scheme, so this version has problems)
  • I'm just asking how to get IntelliJ to recognize all my source if you have this setup.
    • It's a “Gradle project” but Gradle is just part of your code, in a subdirectory. The rest is source code, too.

The last bullet is something JetBrains should be able to answer easily.

0

whyphilip, can you please try the following workaround:

- Close the project window File | Close Project.
- Open your project in OS file explorer and remove all *.iml files and the .idea folder from your project.
- Re-import the project into IntelliJ from Existing sources.
If it doesn't help, please provide a sample project that reproduces the issue. You can upload it to https://uploads.jetbrains.com and share the upload ID.

0

请先登录再写评论。