typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Update lsp generation for more accurate documentation

Open dyl10s opened this issue 8 months ago • 4 comments

I was poking around the lsp server and found that you guys generate a good bit of the types using the meta model. I noticed that when I re-ran the generation, I got different results than the currently committed file, and some of the documentation had weird indenting/spacing.

My efforts here were to normalize it and make it map more closely to the metaModel.json. I then ran the generation script so that it updated the lsp_generated.go

dyl10s avatar Apr 03 '25 03:04 dyl10s

@microsoft-github-policy-service agree

dyl10s avatar Apr 03 '25 03:04 dyl10s

I noticed that when I re-ran the generation, I got different results than the currently committed file

This shouldn't be possible; the script is deterministic. Did you run the scripts in the dir to grab the pinned copy? Are you missing a format step maybe? Note how CI fails.

I'm not sure I like the code added for this, honestly. It's a lot of code to duplicate for all of the places we write things.

jakebailey avatar Apr 03 '25 04:04 jakebailey

This shouldn't be possible; the script is deterministic. Did you run the scripts in the dir to grab the pinned copy? Are you missing a format step maybe? Note how CI fails.

I did run the fetchModel script in the directory to grab the pinned copy using node.

The primary fix for this PR was to resolve the issue where the since documentation would be formatted correctly. I ran the initial script with no changes and got a problem where additional comment lines were added in places they shouldn't be (see image). This is why there was a slightly larger refactor. image

Let me know if there is a specific way I should be running the fetchModel or generate script. I could be missing something here.

dyl10s avatar Apr 03 '25 11:04 dyl10s

Merging #789 and rerunning CI here shows that the formatting is in fact being changed in an unexpected way.

jakebailey avatar Apr 10 '25 19:04 jakebailey