From 225b10a528d60a64ebb65d0db8dab6f71cc026bf Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Mon, 20 Jan 2014 04:32:06 -0800 Subject: [PATCH] Doc and build script updates --- README.md | 17 +++++++++++++---- build.bat | 4 ++-- build.sh | 5 +---- client.d | 4 ++++ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 058a0a1..4d3dae8 100644 --- a/README.md +++ b/README.md @@ -99,12 +99,21 @@ When the first line of output is "calltips", the editor should display a functio call tip. #####Output format A line containing the string "calltips", followed by zero or more lines, each -containing a call tip for an overload of the given function as well as its -DDoc comment, if available. Be sure to escape the \n sequences to newlines -when implementing an editor plugin. +containing a call tip for an overload of the given function. #####Example output calltips - Some DDoc comment\nspread over two lines\n\nACSymbol findSymbolInCurrentScope(size_t cursorPosition, string name) + ACSymbol findSymbolInCurrentScope(size_t cursorPosition, string name) + +## Doc comment display +```dcd-client --doc +When run with the --doc or -d option, DCD will attempt to display documentation +comments associated with the symbol at the cursor position. In the case of +functions there can be more than one documentation comment associated with a +symbol. One doc comment will be printed per line. Newlines within the doc +comments will be replaced with "\n". +####Example output + An example doc comment\nParams: a = first param\n Returns: nothing + An example doc comment\nParams: a = first param\n b = second param\n Returns: nothing ##Clear server's autocomplete cache ```dcd-client --clearCache``` diff --git a/build.bat b/build.bat index 6b1989f..591aee2 100644 --- a/build.bat +++ b/build.bat @@ -1,3 +1,3 @@ dmd -wi client.d messages.d msgpack-d/src/msgpack.d -Imsgpack-d/src -release -inline -noboundscheck -O -ofdcd-client.exe -dmd actypes.d astconverter.d autocomplete.d constants.d messages.d modulecache.d semantic.d server.d stupidlog.d dscanner/stdx/d/ast.d dscanner/stdx/d/parser.d dscanner/stdx/lexer.d dscanner/stdx/d/lexer.d dscanner/stdx/d/entities.d dscanner/formatter.d datapicked/dpick/buffer/buffer.d datapicked/dpick/buffer/traits.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner -Idatapicked -wi -g -ofdcd-server.exe - +dmd -wi actypes.d astconverter.d autocomplete.d constants.d messages.d modulecache.d semantic.d server.d stupidlog.d dscanner/stdx/d/ast.d dscanner/stdx/d/parser.d dscanner/stdx/lexer.d dscanner/stdx/d/lexer.d dscanner/stdx/d/entities.d dscanner/formatter.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner -O -release -noboundscheck -inline -ofdcd-server.exe + diff --git a/build.sh b/build.sh index 9e4458e..aa5229c 100755 --- a/build.sh +++ b/build.sh @@ -2,10 +2,7 @@ dmd -wi client.d\ messages.d\ msgpack-d/src/msgpack.d\ -Imsgpack-d/src\ - -release\ - -inline\ - -noboundscheck\ - -O\ + -release -inline -noboundscheck -O\ -ofdcd-client dmd \ diff --git a/client.d b/client.d index caacbf7..417e469 100644 --- a/client.d +++ b/client.d @@ -176,6 +176,10 @@ Options: Get the file name and position that the symbol at the cursor location was defined. + --doc | -d + Gets documentation comments associated with the symbol at the cursor + location. + -IPATH Instructs the server to add PATH to its list of paths searced for imported modules.