orbitalquark / textadept-lsp

Language server protocol client module for Textadept.
MIT License
28 stars 9 forks source link

How to add an unknown language server? #11

Closed ghost closed 1 year ago

ghost commented 1 year ago

Your wiki is useless @orbitalquark: https://github.com/orbitalquark/textadept/wiki/LSP-Configurations

At least, it must be something like this:

https://github.com/lite-xl/lite-xl-lsp

Taken from their config.lua (https://github.com/lite-xl/lite-xl-lsp/blob/master/config.lua):

---# ccls
--- __Status__: Works
--- __Site__: https://github.com/MaskRay/ccls/
--- __Installation__: https://github.com/MaskRay/ccls/wiki
lspconfig.ccls = add_lsp {
  name = "ccls",
  language = "c/cpp",
  file_patterns = {
    "%.c$", "%.h$", "%.inl$", "%.cpp$", "%.hpp$",
    "%.cc$", "%.C$", "%.cxx$", "%.c++$", "%.hh$",
    "%.H$", "%.hxx$", "%.h++$", "%.objc$", "%.objcpp$"
  },
  command = { "ccls" },
  verbose = false
}
ghost commented 1 year ago

For example, if the language server uses a custom TCP port, how could I specify it so TextAdept could know and use this port?

orbitalquark commented 1 year ago

The README suggests using a function that returns a string followed by a configuration table (that will be converted to JSON and sent to the language server):

lsp.server_commands.cpp = function() return 'cquery', { cacheDirectory = '/tmp/cquery-cache', compilationDatabaseDirectory = io.get_project_root(), progressReportFrequencyMs = -1 } end

ghost commented 1 year ago

For example, if the language server uses a custom TCP port, how could I specify it so TextAdept could know and use this port?

@orbitalquark How to tell TextAdept to listen to a specific port?

orbitalquark commented 1 year ago

You can't. This implementation operates over stdin and stdout.

ghost commented 1 year ago

You can't. This implementation operates over stdin and stdout.

You should add this to README.md.