Skip to content

Implement DocumentationProvider#24

Merged
lerno merged 2 commits intoc3lang:masterfrom
lyranie:master
Apr 15, 2025
Merged

Implement DocumentationProvider#24
lerno merged 2 commits intoc3lang:masterfrom
lyranie:master

Conversation

@lyranie
Copy link
Contributor

@lyranie lyranie commented Apr 10, 2025

  • added C3DocumentationProvider for hover docs for function declarations and variable declarations

Variables

Functions

- added C3DocumentationProvider for hover docs for function declarations and variable declarations
@lerno lerno self-requested a review April 10, 2025 11:46
println("---")

if (element is C3FuncDef) return generateFuncDefDoc(element)
if (element is C3LocalDeclAfterType) return generateVarDeclDoc(element)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not picking up the globals, could that be made to work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as of now i don't see a way to detect top level elements as it win't even recognize the module declaration or imports. the other changes are finished i just can't get around to getting this to work

- added documentation for const declarations
- fixed function docs not displaying correctly in default module
- added highlighting for doc comments
- added basic completion for doc comments
- added check for existing function parameters for doc comments
- updated regex for pattern matching in doc comments
@lerno
Copy link
Contributor

lerno commented Apr 15, 2025

The free text before the params would be nice to add later. Thank you for this!

@lerno lerno merged commit 4ecf2b4 into c3lang:master Apr 15, 2025
1 of 2 checks passed
@lerno
Copy link
Contributor

lerno commented Apr 15, 2025

This breaks:

<*
 Pop a value who's type is known. If the type is incorrect, this
 will still pop the element.

 @param $Type : "The type we assume the value has"
 @return "The last value as the type given"
 @return? TYPE_MISMATCH, NO_MORE_ELEMENT
*>

@lerno
Copy link
Contributor

lerno commented Apr 15, 2025

This also fails:

<*
 Push an element to the front of the list.

 @param value : "The value to push to the list"
*>
macro void AnyList.push_front(&self, value)
{
	self.insert_at(0, value);
}

@lyranie
Copy link
Contributor Author

lyranie commented Apr 16, 2025

This also fails:

<*
 Push an element to the front of the list.

 @param value : "The value to push to the list"
*>
macro void AnyList.push_front(&self, value)
{
	self.insert_at(0, value);
}

this fails because i forgot to check for macros. it currently only checks for functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants