PhilippeChab / nwscript-ee-language-server

A NWScript Language Server.
https://marketplace.visualstudio.com/items?itemName=PhilippeChab.nwscript-ee-language-server
MIT License
20 stars 7 forks source link

clang-format Pathing Issue #23

Closed tinygiant98 closed 2 years ago

tinygiant98 commented 2 years ago

I was able to successfully (and easily!) install this lsp, however I can't seem to get clang-format pathed correctly. I'm tried leaving "executable" as clang-format because it's on the PATH, but that didn't work. Also tried absolute pathing as mentioned in setup using both / and \\ as directory separators to the clang-format file (like this -> "executable": "C:/Users/Ed/AppData/Roaming/npm/clang-format"), also with no luck. Any guidance on the correct pathing formatting to get clang-format to work on a Windows install? Do I need to change this option somewhere other than vscode's settings.json, such as in package.json or config.ts?

tinygiant98 commented 2 years ago

It appears that clang-format was working correctly by setting "executable" to "clang-format" without any pathing, however, some global options in vsCode were preventing some options in clang-format from displaying as expected. Here's the final answer I used, assuming clang-format is on the global PATH: "executable": "clang-format". It also helps to find formatting options in vsCode and have the document auto-formatted on save/paste. Although vsCode has an option for it, it is not currently possible to format the document as you type each line.