20Tauri / DoxyDoxygen

The last word in code documentation generation
140 stars 5 forks source link

How to override certain setting for "js" only #146

Open rchl opened 4 years ago

rchl commented 4 years ago

I can't figure out how to apply "preferred_tabs_sizes": [0] to the JS files only. Tried this:

// Settings in here override those in "${packages}/DoxyDoxygen/Doxy.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
    "profiles": [
        {
            "languages":  [ "js" ],
            "parsers":    [ "LanguageJavaScript" ],
            "doc_styles": [ "JsDoc" ],
            "continuation_on_singleline_comment": true,
            "preferred_tabs_sizes": [0],
        }
    ]
}

but it's not changing anything.

This works but I don't want to apply that setting globally:

// Settings in here override those in "${packages}/DoxyDoxygen/Doxy.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
    "continuation_on_singleline_comment": true,
    "preferred_tabs_sizes": [0],
}

Some of the settings

Edited text

- sublime.syntax:      Packages/JavaScript/JavaScript.sublime-syntax
- doxy.language:       js
Cursor 1

source.js meta.export.js meta.function.js meta.block.js

20Tauri commented 4 years ago

It's currently not possible to change this per language. But, you can change overload the "JsDoc" entry in "doc_styles" settings... Unfortunatly, you will have to replace "\t" with " " per command

Alternativly, the settings should be changed per project: Open: Menu > Project > Edit Project, then add

    "settings":
    {
        "DoxyDoxygen":
        {
            "preferred_tabs_sizes": [ 0 ],
        }
    }

Documentation is here

rchl commented 4 years ago

There are examples in the default configuration like:

        {
            "languages":  [ "json" ],
            "parsers":    [ "LanguageJson" ],
            "doc_styles": [ "Doxygen" ], // or JsDoc, "JavaDoc"...
            "preferred_comments_styles": [
                [
                    [ "/// ", "", "" ],
                    [ "/// " ]
                ]
            ]
        },

Does that mean that preferred_comments_styles is not applied here either or it's an exception that it's supported in this context?

But thanks, I guess the best I can do is to use project-specific settings.

20Tauri commented 4 years ago

preferred_comments_styles is an exception in this context.

rchl commented 4 years ago

I just want to say that it's kinda unclear and confusing that preferred_comments_styles can be overridden in this context but preferred_tabs_sizes, which has similar naming even, can't.

Otherwise, I can live with that problem. :)

20Tauri commented 4 years ago

Note that preferred_comments_styles is extended, not overridden.

But I reopen this issue (with 'enhancement' mark)', and will consider to make overridable parameter in this section