rhaiscript / lsp

Language server for Rhai.
Apache License 2.0
43 stars 4 forks source link

Fix parsing of numbers, identifiers and doc comments. #58

Closed schungx closed 2 years ago

schungx commented 2 years ago

Should resolve https://github.com/rhaiscript/lsp/issues/55

Numbers parsing - numbers should not start with underscore, no should an underscore following the decimal point.

Identifiers parsing - the first non-underscore letter should be alpha.

Doc comments parsing - Long streams of /////// or /******* are not counted as block comments.

@tamasfe some of my modest contributions :-)

tamasfe commented 2 years ago

Thanks!

Can you elaborate on what the issue is with the doc comments? I don't immediately see it.

image

schungx commented 2 years ago

Can you elaborate on what the issue is with the doc comments? I don't immediately see it.

////////////////////////////////
//  This is not a doc comment //
////////////////////////////////

/**********************************
 * This is also not a doc comment *
 **********************************/

Normal comment blocks with decorative borders are not treated as doc-comments in Rhai.

Sorry, I think I made a typo in the original message. It should be: Doc comments parsing - Long streams of /////// or /******* are not counted as doc-comments.

tamasfe commented 2 years ago

Ah I see, thanks! LGTM.