Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options are not properly collected and applied #346

Closed
6 tasks done
Glavin001 opened this issue May 19, 2015 · 1 comment
Closed
6 tasks done

Options are not properly collected and applied #346

Glavin001 opened this issue May 19, 2015 · 1 comment

Comments

@Glavin001
Copy link
Owner

  • Language fallbacks are not handled properly
  • Project options are collected in incorrect order / priority, see
    # Get all options in configuration files from this directory upwards to root
    projectOptions = []
    p = path.dirname(editedFilePath)
    # Check if p is root (top directory)
    while p isnt path.resolve(p, "../")
    # Get config for p
    pf = path.join(p, "FAKEFILENAME")
    pc = @getConfig(pf, false)
    # Add config for p to project's config options
    projectOptions.push(pc)
    # logger.verbose p, pc
    # Move upwards
    p = path.resolve(p, "../")
    else
    editorConfigOptions = {}
    projectOptions = []
    # Combine all options together
    allOptions = [
    editorOptions
    configOptions
    homeOptions
    editorConfigOptions
    ]
    allOptions = allOptions.concat(projectOptions)

  • Options that are not nested under a language namespace should be nested under _default namespace. All options should therefore be nested. /cc Rename .jsbeautifyrc to .atombeautifyrc #41
  • Selecting options for language should (in beautify function)
    • get the options for the language's namespace
    • get the options for the language's fallbacks
    • get the options for the _default namespace
    • merge all options
@Glavin001
Copy link
Owner Author

Published to v0.27.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant