nigjo opened a new issue, #7166:
URL: https://github.com/apache/netbeans/issues/7166

   ### Apache NetBeans version
   
   Apache NetBeans 21
   
   ### What happened
   
   When using [Lua Language 
Server](https://github.com/LuaLS/lua-language-server) I encountered a problem 
that I had to repeat the NetBeans Project folder name inside the project folder 
to store "workspace" related config files (=`.luarc.json`). The logs of LuaLS 
showed that these "duplicate folder" config file is read correctly. This is not 
done when stored in the Netbeans Project folder. (What is expected)
   
   I checked the same language server with VSCode and there is no "folder 
duplication" is needed. The config is read from the project folder as a 
workspace.
   
   The main (?) difference from the server logs files is that NetBeans sends a 
trailing slash to "`rootUri`" while "`rootPath`" does not have a trailing path 
separator. In VSCode none of these config entries has a trailing separator
   The [Language Server Protocol 
Specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)
 does not give any hint if a trailing slash is needed or must be prevented.
   
   ### Language / Project Type / NetBeans Component
   
   Language Server Client
   
   ### How to reproduce
   
   - Configure Lua Language Server as a custom LS (Grammar file: e.g: 
https://github.com/LuaLS/lua.tmbundle)
   - Create a Project of any type in Netbeans
   - Create a file `.luarc.json` in that project's folder. Content: ```{
     "runtime":{
       "version":"Lua 5.1"
     }
   }```
   - create an empty `.lua` file in the project
   
   The language server should open a new (and empty) LS-Output-Window. In the 
"`log`" subfolder of the LuaLS installation is a new log file `file_*.log` with 
the project folders path as file name. That logfile has some log lines of 
interest:
   
   ```
   [15:18:53.775][info] [#0:script\workspace\workspace.lua:38]: Workspace init 
root:    file:///D:/nigjo/projekte/luademo/
   [15:18:53.807][warn] [#0:script\files.lua:111]: Fix real file uri: 
file:///d%3A/nigjo/projekte/luademo/ -> 
file:///d%3A/nigjo/projekte/luademo/luademo
   [15:18:53.807][info] [#0:script\workspace\workspace.lua:48]: Workspace 
create:       file:///d%3A/nigjo/projekte/luademo/luademo
   ```
   followed by two lines with `No config?` entries.
   
   After create a folder "luademo" inside of "luademo", copy the `.luarc.json` 
to that subfolder and restart the language server (kill the 
lua-language-server.exe via Task Manager) the server log will show that the 
config is found now:
   
   ```
   [15:25:28.014][info] [#0:script\provider\provider.lua:53]: Load config from 
.luarc.json/.luarc.jsonc file:///d%3A/nigjo/projekte/luademo/luademo
   ```
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 10
   
   ### JDK
   
   17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to