-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add XML documentation download and display, user comments to hover an…
…d signature help (#34) * add comments to hover * wip on docs downloader * change HoverBuilder result type * wip * can hover * wip signature help docs * add highlighting for escript inside markdown * fixup downloading * implement configuration updates * finish up hover doc highlighting * cleanup code symbols from comments * Fix tests and various test implementations * Create scripts dir for tests * Remove multiline regex option * fix string casting * Use different std::filesystem::path ctor * lalala windows lalala * Run eslint * Decouple DocsDownloader, LSPServer, LSPWorkspace; tests * Address review comments - Use raw strings in regex - Incorrect usage of reference return for get_xml_doc_path * add tests for xml + comment docs on hover * add new line after codeblock end triple-backticks * Skip duplicate configuration change events
- Loading branch information
Showing
28 changed files
with
1,583 additions
and
246 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
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,27 @@ | ||
--- | ||
fileTypes: [] | ||
injectionSelector: L:text.html.markdown | ||
patterns: | ||
- include: "#escriptdoc-code-block" | ||
repository: | ||
escriptdoc-code-block: | ||
begin: "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(escriptdoc)(\\s+[^`~]*)?$)" | ||
name: markup.fenced_code.block.markdown | ||
end: "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$" | ||
beginCaptures: | ||
'3': | ||
name: punctuation.definition.markdown | ||
'4': | ||
name: fenced_code.block.language.markdown | ||
'5': | ||
name: fenced_code.block.language.attributes.markdown | ||
endCaptures: | ||
'3': | ||
name: punctuation.definition.markdown | ||
patterns: | ||
- begin: "(^|\\G)(\\s*)(.*)" | ||
while: "(^|\\G)(?!\\s*([`~]{3,})\\s*$)" | ||
contentName: meta.embedded.block.escriptdoc | ||
patterns: | ||
- include: source.escriptdoc | ||
scopeName: markdown.escriptdoc.codeblock |
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,91 @@ | ||
--- | ||
# `strings` and `numbers` shamelessly ripped from https://raw.githubusercontent.com/microsoft/vscode-textmate/main/test-cases/themes/syntaxes/c.json | ||
scopeName: source.escriptdoc | ||
name: EScript Markdown Documentation | ||
|
||
patterns: | ||
- include: '#symbolType' | ||
- include: '#moduleUnit' | ||
- include: '#functionDef' | ||
- include: '#closeParen' | ||
- include: '#variable' | ||
- include: '#assignment' | ||
- include: '#strings' | ||
- include: '#numbers' | ||
|
||
repository: | ||
symbolType: | ||
patterns: | ||
- comment: Symbol type (module function, user function, variable, ...) | ||
match: '^(\()([^)]+)(\))' | ||
captures: | ||
'1': { name: meta.parens.escriptdoc } | ||
'2': { name: entity.name.type.escriptdoc } | ||
'3': { name: meta.parens.escriptdoc } | ||
functionDef: | ||
patterns: | ||
- comment: Functions (module, user) | ||
match: '([a-zA-Z$_][0-9a-zA-Z$_]*)(\()' | ||
captures: | ||
'1': { name: entity.name.function.escriptdoc } | ||
'2': { name: meta.function.definition.parameters.escriptdoc } | ||
variable: | ||
patterns: | ||
- comment: Variables and parameters | ||
match: '([a-zA-Z$_][0-9a-zA-Z$_]*)' | ||
captures: | ||
'1': { name: meta.definition.variable.name.escriptdoc } | ||
assignment: | ||
patterns: | ||
- comment: Assignment | ||
match: := | ||
captures: | ||
'0': { name: keyword.operator.escriptdoc } | ||
closeParen: | ||
patterns: | ||
- comment: Close parenthesis | ||
match: '\)' | ||
captures: | ||
'0': { name: keyword.operator.escriptdoc } | ||
strings: | ||
patterns: | ||
- begin: "\"" | ||
beginCaptures: | ||
'0': | ||
name: punctuation.definition.string.begin.escriptdoc | ||
end: "\"" | ||
endCaptures: | ||
'0': | ||
name: punctuation.definition.string.end.escriptdoc | ||
name: string.quoted.double.escriptdoc | ||
patterns: | ||
- include: "#string_escaped_char" | ||
- begin: "'" | ||
beginCaptures: | ||
'0': | ||
name: punctuation.definition.string.begin.escriptdoc | ||
end: "'" | ||
endCaptures: | ||
'0': | ||
name: punctuation.definition.string.end.escriptdoc | ||
name: string.quoted.single.escriptdoc | ||
patterns: | ||
- include: "#string_escaped_char" | ||
string_escaped_char: | ||
patterns: | ||
- match: |- | ||
(?x)\\ ( | ||
\\ | | ||
[abefnprtv'"?] | | ||
[0-3]\d{,2} | | ||
[4-7]\d? | | ||
x[a-fA-F0-9]{,2} | | ||
u[a-fA-F0-9]{,4} | | ||
U[a-fA-F0-9]{,8} ) | ||
name: constant.character.escape.escriptdoc | ||
- match: "\\\\." | ||
name: invalid.illegal.unknown-escape.escriptdoc | ||
numbers: | ||
patterns: | ||
- match: "\\b((0(x|X)[0-9a-fA-F]*)|(0(b|B)[01]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" | ||
name: constant.numeric.escriptdoc |
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
Oops, something went wrong.