Doc Blocks (Inline documentation)

80 views
Skip to first unread message

MGatner

unread,
Apr 18, 2020, 10:05:08 PM4/18/20
to BBEdit Talk
Hi all- I'm working on a PHP framework in BBEdit. A number of other contributors talk about the advantages of PHPStorm and how it can read, analyze, and output the "doc blocks" - popular inline documentation for methods that does actually have some bearing on things like unit tests. Example:

/**
* Copy each path to its relative destination.
*
* @param string $destination  Directory to copy files into
*
* @return array  Array of the actual files copied, relative paths
*/
public function copyPaths(string $destination): array
{

I'm fond of BBedit and like that it does not lock me into one language. Does anyone know of a way to get at some similar functionality within BBEdit, with a plugin or extension perhaps?

MGatner

unread,
Jun 27, 2020, 8:31:19 AM6/27/20
to BBEdit Talk
Nobody? Ideas?

Jan Erik Moström

unread,
Jun 29, 2020, 1:23:38 AM6/29/20
to 'MGatner' via BBEdit Talk
On 27 Jun 2020, at 14:15, 'MGatner' via BBEdit Talk wrote:

> Nobody? Ideas?

I assume there was a more extended version of the question earlier?

= jem

Watts Martin

unread,
Jul 7, 2020, 4:40:46 PM7/7/20
to 'MGatner' via BBEdit Talk
I've been fiddling around with trying to make a new PHP package, as well
as freshen some old packages that I used to maintain. I'll see if I can
get something out soon.

The closest to what you're asking about, though, was in an
"EditorActions" package that I have, which had a "Smart New Line"
function I bound to ^J (which was the old equivalent in Emacs, IIRC).
This was to fill in BBEdit's lack of context-aware indenting and go a
bit beyond it, like continuing Markdown bullet lists, indenting after
braces in C-like languages or lines ending in ":" in Python, filling in
an "end" statement after "def" in Ruby or Elixir, and so on. For
docblocks, if the line was "/**" then it would fill in a " * " on the
next line and a " **/" under it, and you could keep typing ^J and it
would continue the multi-line comment. It didn't introspect the actual
PHP code to fill in "@param" and "@result" lines, though.

I am hoping that a future version of BBEdit will have Language Server
Protocol support. When I write PHP in BBEdit, I miss some of those
IDE-like features that Visual Studio Code provides through LSP, but when
I write PHP in Code, I hit little editing snags that would be easier in
BBEdit. :)

On 27 Jun 2020, at 5:15, 'MGatner' via BBEdit Talk wrote:

> Nobody? Ideas?
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or need technical support, please email
> "sup...@barebones.com" rather than posting here. Follow @bbedit on
> Twitter: <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google
> Groups "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bbedit+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/03e7b5fb-a573-4bc5-91d0-f9010fd03702o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages