mfussenegger / nvim-jdtls

Extensions for the built-in LSP support in Neovim for eclipse.jdt.ls
GNU General Public License v3.0
1.09k stars 62 forks source link

Supress creation of eclipse dot files and directories #448

Closed mikehaertl closed 1 year ago

mikehaertl commented 1 year ago

Problem Statement

jdt.ls seems to create these files and directories in the project root:

.classpath
.factorypath
.project
.settings/

It would be nice if this could be supressed.

Ideas or possible solutions

I found the same files created in the -data directory. This made me wonder if there's maybe a configuration missing. From their wiki:

  1. Choosing a value for -data: the value for your data directory, should be the directory where your active workspace is, and you wish for the java langserver to add in its default files.

So this should be the "workspace path". But what exactly is the "workspace"? From the example on the bottom of that page I've also seen this:

InitializeParams: {
    ...
    "initializationOptions": {
        "bundles": [
        ],
        "workspaceFolders": [
            "file:///home/snjeza/Project"
        ],

So I wondered if we should configure the workspace path to point to the same directory as -data so I tried to add this to my init options:

  init_options = {
    bundles = ...
    workspaceFolders = {
      -- same path as used for -data 
      'file://' .. (nvim_data_path .. 'jdtls_data/' .. project_name)
    }
  },

But then I end up with the "... is a non-project file, only syntax errors are reported" problem.

mfussenegger commented 1 year ago

These files are created by eclipse.jdt.ls and as far as I'm aware they're required.