Project specific tab length setting in ~/.atom/projects.cson


#1

Most of the projects I work on use 3 spaces for tab length, but one project uses 4 spaces. My attempt to set the tab length to 4 for that one project changes the tab length for the other projects.

I added the settings key to my existing projects.cson file as follows:

Atom -> Preferences… -> Open Config Folder -> projects.cson

...
  {
    title: "Bad for You"
    paths: [
      "/Users/dem/projects/bad-for-you"
    ]
    settings:
      editor:
        tabLength: 4
  }
]

What’s the correct way to specify a project specific editor setting?

I’m running project-manager v3.3.3 in Atom 1.14.3 on macOS Sierra v10.12.3.


#2

You can see an example of that in the project-manager documentation.


#3

Hmmm… that is the documentation I was attempting to follow. The example in the documentation uses 'Project Manager' which implies it’s for developers of the package rather than users of the package. Nonetheless, I attempted to follow the example to make a project specific editor setting.

What would be helpful is a comment on how I should fix my configuration. Am I editing the wrong file? Am I using the wrong syntax? Is this a bug? I was pretty careful in posting the question with complete information, but let me know if more information is needed.


#4

I imagine that Brodin uses the package to sort itself as well as his other projects, yes.

Nonetheless, I attempted to follow the example to make a project specific editor setting.

What you posted looks very different from the example. You have this:

    settings:
      editor:
        tabLength: 4

The example has this:

    settings:
      'editor.tabLength': 4

#5

It looks like those two CSON formats should have identical results. I originally tried the quoted format. Neither cause the tab length setting to be specific to the project.

My bet is this a bug.


#6

If it’s not working as the documentation says it should work, nobody here can help you. You need to open an issue on the GitHub repo.


#7

The documentation looks like it covers a use case for developer’s of the package. I’m not yet convinced that nobody here can help. My use case is very straightforward. I do extensive work on GitHub, and I only open issues on other people’s projects after I have a pretty good understanding of problem.


#8

It’s exactly the same use case as anybody else’s. “Define the settings for this project for use by project-manager.” The example project just happens to be the package itself (because it’s useful to have example text when you’re writing samples for documentation).

I do extensive work on GitHub, and I only open issues on other people’s projects after I have a pretty good understanding of problem.

You are setting up your configuration as specified in the documentation and it doesn’t work as expected. What more do you need to open an issue? If you really want to understand the problem, you could fork the package, fix it, and submit a PR.