Sublime Forum

[DocBlockr] DocBlockr is not parsing my PHP Functions and does not autocomment the next line anymore

#1

Hi, I code in PHP and have used SublimeText for a couple of years now. I swear by it. It’s awesome.

One of the plugins that makes it awesome is DocBlockr (aka sublime-jsdocs). Normally all I have to do to start a docblock is to type /** and hit on the line right before my function. DocBlockr starts a comment block with @param and @return tags and I can through the things I need to fill in. Works great.

Or at least it did on my other laptop. I just got a new one and it’s not working right anymore! In fact it’s not working at all… Not only does it not parse my function header, but typing /** no longer even starts a docblock!

And another nice feature that it did (I’m pretty sure DocBlockr was responsible for this) was that if I was in a function document header and hit enter, it would at the * at the beginning of the next line and auto-indent for me. It would also auto-comment the next line of an inline comment for me by adding the // at the beginning.

It’s not doing that anymore either.

Has anyone else had this trouble? Any suggestions of a solution?

Windows 10 64-bit
Sublime Build: 3083
DocBlockr 2.14.1 (the version installed for me through Sublime Package Control)

  • from browsing the changelog, it does look like a lot of work was done on php parsing, so maybe that’s got something to do with it…

Here’s also my User settings for the DocBlockr plugin

{ "jsdocs_deep_indent": false, "jsdocs_extend_double_slash": true, "jsdocs_indentation_spaces": 1, "jsdocs_indentation_spaces_same_para": 1, "jsdocs_align_tags": false, "jsdocs_extra_tags": [], "jsdocs_extra_tags_go_after": true, "jsdocs_notation_map": [], "jsdocs_return_tag": "@return", "jsdocs_function_description": true, "jsdocs_return_description": true, "jsdocs_param_description": true, "jsdocs_param_name": true, "jsdocs_spacer_between_sections": true, "jsdocs_per_section_indent": true, "jsdocs_min_spaces_between_columns": 1, "jsdocs_autoadd_method_tag": false, "jsdocs_simple_mode": false, "jsdocs_lower_case_primitives": true, "jsdocs_short_primitives": true, "jsdocs_override_js_var": false, "jsdocs_newline_after_block": false, "jsdocs_decorate": true, "jsdocs_quick_open_inline": true, "jsdocs_development_mode": false }

0 Likes

#2

Well I don’t know exactly how, but I just fixed it for myself. Not sure which of the following actually fixed the problem, but this is what I did:

  • Cleared out my Key Bindings - User file
  • Pared my DocBlockr user settings file down to what I’ve posted below
  • Removed the phpdoc package
  • Removed the phpcs package
  • Reinstalled the phpcs package

It started working after I removed phpcs. I though, “Maybe there’s a conflict between these two,” so I reinstalled it to confirm, but it still worked after.

Odd.

Here’s my current DocBlockr user settings:
{ "jsdocs_deep_indent": false, "jsdocs_spacer_between_sections": true, "jsdocs_align_tags": false, "jsdocs_per_section_indent": true, "jsdocs_lower_case_primitives": true, "jsdocs_short_primitives": true }

Here’s my current User Key Bindings:
`[
// Custom bindings.
{ “keys”: [“ctrl+f12”], “command”: “goto_definition” },
{ “keys”: [“ctrl+alt+f12”], “command”: “goto_definition” },
{ “keys”: [“f11”], “command”: “jump_back” },
{ “keys”: [“f10”], “command”: “jump_forward” },
{ “keys”: [“ctrl+f11”], “command”: “jump_back” },
{ “keys”: [“ctrl+f10”], “command”: “jump_forward” },

{ “keys”: [“alt+up”], “command”: “select_lines”, “args”: {“forward”: false} },
{ “keys”: [“alt+down”], “command”: “select_lines”, “args”: {“forward”: true} }
]`

Here’s my current Package List:
"installed_packages": [ "AdvancedNewFile", "Auto Semi-Colon", "AutoFileName", "BracketHighlighter", "Composer", "Console Exec", "DocBlockr", "Drupal Completions", "Git", "GitCommitMsg", "GitGutter", "GitGutter-Edge", "jQuery", "JSHint", "Package Control", "PHP Companion", "PHP Completions Kit", "PHP Constructors", "PHP Getters and Setters", "php-snippets", "Phpcs", "PHPIntel", "SideBarGit", "SublimeCodeIntel", "SyncedSideBar", "Xdebug Client" ]

And my Current Global User Settings File:
{ "auto_complete_commit_on_tab": true, "bold_folder_labels": true, "caret_style": "wide", "default_line_ending": "unix", "draw_white_space": "selection", "ensure_newline_at_eof_on_save": true, "fade_fold_buttons": false, "fallback_encoding": "UTF-8", "find_selected_text": true, "font_options": [ "subpixel_antialias" ], "font_size": 11, "highlight_line": true, "ignored_packages": [ "BracketHighlighter", "GitGutter", "GitGutter-Edge", "Vintage" ], "line_padding_bottom": 1, "open_files_in_new_window": false, "reveal-on-activate": true, "rulers": [ 80 ], "shift_tab_unindent": true, "tab_size": 2, "translate_tabs_to_spaces": true, "trim_automatic_white_space": true, "trim_trailing_white_space_on_save": true, "use_tab_stops": true, "word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}~?",
“word_wrap”: true,
“wrap_width”: 80
}`

With this configuration, DocBlockr works for me.

0 Likes

#3

I hit a similar problem in JavaScript. It seems that DocBlockr is no longer getting called when I hit Enter. This started when I switched from the stable to dev channel Sublime build.

I tracked it down to the context that the command is invoked for. There’s a regex that ensures the line only has the text /** on it and checks for the beginning of the with a ^. For some reason, that no longer matches. This seems like a Sublime bug. I was able to work around by adding the command to my user keybindings file without the leading ^. So I added:

{ "keys": ["enter"], "command": "jsdocs", "context": [ { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "\\s*(\\/\\*|###)[*!]\\s*$", "match_all": true } ] },

0 Likes

#4

Still works fine for me. Windows 7 3099.

0 Likes

#5

Also stopped working for me since 3099 (on OS X though). So yeah looks like a regression in SublimeText

0 Likes

#6

On Windows 7/Sublime 3099. I just tried an completely fresh install with no other packages and DocBlockr still doesn’t work. A coworker said it does work for him with that combination though. Not sure what the difference is, but that’s such an important package for me I had to fallback to the Sublime stable channel.

0 Likes

#7

Reverting to 3095 also does help. So something must be happened in between

0 Likes

#8

You may be interested in a specific topic on DocBlockr forum:
https://github.com/spadgos/sublime-jsdocs/issues/406
Some users have solve the problem with a script (that also clean workspace)… Perhaps you may try it

If you still have problem, I suggest you to have a look on a plugin called DoxyDoxygen. I’m the author and it doesn’t seem to be affected (even if the user base is smaller).

As suggested by “frontend_dev”, reverting to 3095 seem to be an universal solution

0 Likes

#9

I stuck with the stable version, so haven’t tried this tip yet. Fortunately, the new stable build 3103 has all the dev channel changes and also seems to have fixed the underlying problem–DocBlockr is working fine again.

I’ll be sure to check out DoxyDoxygen later too. Thanks.

0 Likes

#10

According to the Github issue, this was fixed as of Sublime Build 3102.

I just updated to build 3103, and DocBlockr works for me.

0 Likes