Share project-level dictionary in Git

Answered

Hi everyone,

I came across an issue why the current implementation of sharing dictionaries is not working for our team.

My setup:

  • Idea project-level dictionary default path is ".idea/dictionaries/*.xml"
  • If I add this path to Git it works and everyone can set their dictionary to project-level and use or add new words.

The problem comes from the gitIgnore part of the .idea folder --> When somebody new clones the repository the .idea folder is created locally so it can store some settings. At this moment the .idea folder already exists (eventhough it only contains the dictionaries folder) and the result is that IDEA won't create the other necessary local files.

After such project is cloned IDEA won't show you all the files and folders and the project is unuasable.

The solution to this would be somehow changing the dictionaries folder path (so the whole .idea folder can stay ignored) but as far as I'm aware IDEA won't let you change the default path from which it uses the dictionaries.

Also we do have a settings repository but I think there is currently no option to share dictionaries this way.

0
9 comments

The problem comes from the gitIgnore part of the .idea folder 

Could you provide your .gitignore or create and share a small project sample? The files can be uploaded at https://uploads.jetbrains.com (do not forget to specify the UploadID)

Thank you!

0

Egor Klepikov Thank you.

Gitignore looks like this:

node_modules/*
dist/*
build/*
.vscode
.vscode/*
.classpath
docs/*

# Keep the dictionaries folder to share spellchecking
.idea/*
!.idea/dictionaries
!idea/dictionaries/*

So only the dictionaries folder from idea is persisted in git.

I'll try to make a mini project to share.

0

Upload ID: 2022_07_08_zwEJcLKufVjiRN7EJgDRtQ

What I did:

  • Took the repository and cleared all the code
  • Deleted everything in .idea folder except dictionaries folder (this is the state after git clone)

After opening the project it looks fine for couple of seconds:

and then the main folder disappears from the project window:

I noticed IDEA created 2 files after opening the project:

0

For my work environment it is reproduced in 2022.1.3 release only. Please check if it reproduces in the beta version from https://www.jetbrains.com/idea/nextversion .

Project sample https://github.com/egorklepikov/test-dictionaries

0

Egor Klepikov

I got the same result on 2021.3 and 2022.1.3

It works on the latest beta (just tried it).

So that means we have to wait for the next stable release and then force all developers to update? Our company currently distributes only 2021.3 and anything newer is a hassle.

0

Yes, it looks like you need to wait until 2022.2 is released (in the end of July) and rollout the build to other developers.

Sorry for the inconvenience.

0

Thanks. I suppose Webstorm will release the same fix around the same time? 

0

Since WebStorm is based on IntelliJ platform the fix will be applied automatically. You can verify it in the build from https://www.jetbrains.com/webstorm/nextversion .

0

Thanks. I´ve created a workaround that we can use untill everybody is on 2022.2 version.

In the repository README.md

If you can't see the root repository folder after cloning the repository do theese steps:
- Quit IDEA/Webstorm
- In windows explorer locate the ${repositories}/${repoName}/.idea folder and delete it.
- Re-open the project and update from git (Ctrl + T)
- Rollback commit (Ctrl + Alt + Z) and select all files.
- DONE
1

Please sign in to leave a comment.