ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
385 stars 151 forks source link

fix: wrong "open" completion position with namespace #1300

Closed MrLuje closed 1 month ago

MrLuje commented 1 month ago

Fix code completion for external namespace being inserted before namespace and bring back Completion.AutoOpen tests

before : fix-open-namespace-before

after : fix-open-namespace-after

NB: I changed the position for Namespace.fsx & NamespaceWithNewLine.fsx to match the actual behavior, it is correct F# syntax but I would have expected it to be aligned with the code below instead of the namespace (at least we get coverage for the inserted line part) fix-open-namespace-nested

NB2: Since I added back Completion.AutoOpen tests, I can't get the full test suite to run locally, the test adapter is crashing with OOM. Maybe the dedicated createServer function missed some "recent" optimisations applied to others createServer since it was not running until now ?

baronfel commented 1 month ago

Wow yeah, the stack on macOS is much smaller so you can clearly see the crashes there.

Since the script files are all logically independent, the server could probably be shared across the tests entirely if you want to try that out.

MrLuje commented 1 month ago

Yep, much better ! Thanks

baronfel commented 1 month ago

Thanks for this great fix @MrLuje!