forked from move-language/move
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[move-analyzer] Add Docstring rendering on-hover (move-language#328)
* [move-analyzer] Add docstring rendering for consts, structs, functions * [move-analyzer] Optimize docstring construction * [move-analyzer] Add rendering for docstrings across other modules * [move-analyzer] Fix M1.move tests * [move-analyzer] Add unit tests for docstring construction * [move-analyzer] Add integration tests for docstring construction * [move-analyzer] Add support for /** .. */ docstring comments * [move-analyzer] Update unit/integration tests to test asterix-based docstrings * [move-analyzer] Fix general PR comments * [move-analyzer] Improve extract_doc_string readability * [move-analyzer] Fix linter issues
- Loading branch information
Showing
10 changed files
with
570 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,7 @@ | |
"max-len": [ | ||
"warn", | ||
{ | ||
"code": 100, | ||
"code": 120, | ||
"ignoreUrls": true | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
language/move-analyzer/editors/code/tests/lsp-demo/sources/M2.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Symbols::M2 { | ||
|
||
/// Constant containing the answer to the universe | ||
const DOCUMENTED_CONSTANT: u64 = 42; | ||
|
||
/** | ||
This is a multiline docstring | ||
This docstring has empty lines. | ||
It uses the ** format instead of /// | ||
*/ | ||
fun other_doc_struct(): Symbols::M3::OtherDocStruct { | ||
Symbols::M3::create_other_struct(DOCUMENTED_CONSTANT) | ||
} | ||
|
||
use Symbols::M3::{Self, OtherDocStruct}; | ||
|
||
fun other_doc_struct_import(): OtherDocStruct { | ||
M3::create_other_struct(7) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
language/move-analyzer/editors/code/tests/lsp-demo/sources/M3.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Symbols::M3 { | ||
|
||
/// Documented struct in another module | ||
struct OtherDocStruct has drop { | ||
some_field: u64, | ||
} | ||
|
||
/// Documented initializer in another module | ||
public fun create_other_struct(v: u64): OtherDocStruct { | ||
OtherDocStruct { some_field: v } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.