Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for workspaceFolders #341

Closed
RobertBuhren opened this issue Jan 14, 2019 · 44 comments
Closed

Support for workspaceFolders #341

RobertBuhren opened this issue Jan 14, 2019 · 44 comments
Labels
enhancement New feature or request

Comments

@RobertBuhren
Copy link

Hi,
I'm having problems to get nvim.coc with ccls working with out-of-tree kernel modules. Initially I thought it is an ccls issue. The full description of my problem is here: MaskRay/ccls#201

I have a folder structure e.g. like this:

root/
    linux/
    mymodule/
        mymod.c

An example entry for the "mymod.c' of the compile_commands.json looks like this:

    {
        "arguments": [
            "gcc",
            "-c",
            "-Wp,-MD,/home/robert/kernel/ccp_test/.ccp_test.mod.o.d",
            "-nostdinc",
            "-isystem",
            "/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/include",
            "-I./arch/x86/include",
            "-I./arch/x86/include/generated",
            "-I./include",
            "-I./arch/x86/include/uapi",
            "-I./arch/x86/include/generated/uapi",
            "-I./include/uapi",
            "-I./include/generated/uapi",
            "-include",
            "./include/linux/kconfig.h",
            "-include",
            "./include/linux/compiler_types.h",
            "-D__KERNEL__",
            "-Wall",
            "-Wundef",
            "-Wstrict-prototypes",
            "-Wno-trigraphs",
            "-fno-strict-aliasing",
            "-fno-common",
            "-fshort-wchar",
            "-Werror-implicit-function-declaration",
            "-Wno-format-security",
            "-std=gnu89",
            "-fno-PIE",
            "-DCC_HAVE_ASM_GOTO",
            "-mno-sse",
            "-mno-mmx",
            "-mno-sse2",
            "-mno-3dnow",
            "-mno-avx",
            "-m64",
            "-falign-jumps=1",
            "-falign-loops=1",
            "-mno-80387",
            "-mno-fp-ret-in-387",
            "-mpreferred-stack-boundary=3",
            "-mskip-rax-setup",
            "-mtune=generic",
            "-mno-red-zone",
            "-mcmodel=kernel",
            "-funit-at-a-time",
            "-DCONFIG_AS_CFI=1",
            "-DCONFIG_AS_CFI_SIGNAL_FRAME=1",
            "-DCONFIG_AS_CFI_SECTIONS=1",
            "-DCONFIG_AS_FXSAVEQ=1",
            "-DCONFIG_AS_SSSE3=1",
            "-DCONFIG_AS_CRC32=1",
            "-DCONFIG_AS_AVX=1",
            "-DCONFIG_AS_AVX2=1",
            "-DCONFIG_AS_AVX512=1",
            "-DCONFIG_AS_SHA1_NI=1",
            "-DCONFIG_AS_SHA256_NI=1",
            "-pipe",
            "-Wno-sign-compare",
            "-fno-asynchronous-unwind-tables",
            "-mindirect-branch=thunk-extern",
            "-mindirect-branch-register",
            "-DRETPOLINE",
            "-fno-delete-null-pointer-checks",
            "-Wno-frame-address",
            "-Wno-format-truncation",
            "-Wno-format-overflow",
            "-Wno-int-in-bool-context",
            "-O2",
            "--param=allow-store-data-races=0",
            "-Wframe-larger-than=2048",
            "-fstack-protector-strong",
            "-Wno-unused-but-set-variable",
            "-Wno-unused-const-variable",
            "-fomit-frame-pointer",
            "-fno-var-tracking-assignments",
            "-g",
            "-gdwarf-4",
            "-Wdeclaration-after-statement",
            "-Wno-pointer-sign",
            "-Wno-stringop-truncation",
            "-fno-strict-overflow",
            "-fno-merge-all-constants",
            "-fmerge-constants",
            "-fno-stack-check",
            "-fconserve-stack",
            "-Werror=implicit-int",
            "-Werror=strict-prototypes",
            "-Werror=date-time",
            "-Werror=incompatible-pointer-types",
            "-Werror=designated-init",
            "-fmacro-prefix-map=./=",
            "-Wno-packed-not-aligned",
            "-DKBUILD_BASENAME=\"ccp_test.mod\"",
            "-DKBUILD_MODNAME=\"ccp_test\"",
            "-DMODULE",
            "-o",
            "/home/robert/kernel/ccp_test/ccp_test.mod.o",
            "../ccp_test/ccp_test.mod.c"
        ],
        "directory": "/home/robert/kernel/linux",
        "file": "../ccp_test/ccp_test.mod.c"
    },

As you can see, all paths (e.g. include paths) are relative to the "directory" entry of the json node. However, ccls can't find the headers includes in the module.

The author of ccls suggested that this is an issue of my client (nvim.coc) configuration.

Any suggestions what might be the issue here? And what configuration of nvim.coc might affect this issue?

Thanks in advance,

Robert

@chemzqm chemzqm added the bug Something isn't working label Jan 15, 2019
@chemzqm
Copy link
Member

chemzqm commented Jan 15, 2019

In your root/ folder create a file .ccls-root and add "rootPatterns": [".ccls-root"], to your ccls language server configuration.

@chemzqm chemzqm removed the bug Something isn't working label Jan 15, 2019
@chemzqm chemzqm closed this as completed Jan 15, 2019
@RobertBuhren
Copy link
Author

Thanks. Unfortunately this does not work. The result is the same. Could you elaborate on why this setting is necessary? The compilation data base file should contain all required paths and flags.
It does work with clangd though.

Here's the coc config for clangd I use:

{
  "languageserver": {
    "clangd": {
      "command": "clangd",
      "rootPatterns": ["compile_flags.txt", "compile_commands.json", ".vim/", ".git/", ".hg/"],
      "filetypes": ["c", "cpp", "objc", "objcpp"],
    },

and for ccls

    "ccls": {
      "command": "ccls",
      "args": ["--log-file=/tmp/ccls.log"],
      "rootPatterns": [".ccls-root"],
      "filetypes": ["c", "cpp", "objc", "objcpp"],
      "initializationOptions": {
        "cacheDirectory": "/tmp/ccls"
      }
    }
  },

As ccls does provide more features, I'd like to use ccls.

Thanks again for the quick response.

Regards,

Robert

@chemzqm
Copy link
Member

chemzqm commented Jan 15, 2019

Hm, I got the problem, coc doesn't have correct workspace folders yet, it only send current one to language server.

I'm working on CocList feature, that would add workspace folder support.

@chemzqm chemzqm reopened this Jan 15, 2019
@chemzqm chemzqm changed the title Correct setting for out-of-tree kernel modules? Support for workspaceFolders Jan 15, 2019
@aravind2612krishna
Copy link

Just to chime in, I'm facing the same, if not a similar issue.
The ccls log says it is adding a workspace folder which is one level above my project root. I'm not sure how this can be fixed. The rootUri is correct(I give rootPatterns), but because of the incorrect workspace path, the whole thing doesn't work.

12:51:28 ccls initialize.cc:340 I add workspace folder <one_level_above>

@chemzqm
Copy link
Member

chemzqm commented Jan 17, 2019

Vim doesn't have concept of workspace, so we need to build one.

Workspace would have add remove save load actions.

@ripperapid
Copy link

Just to chime in, I'm facing the same, if not a similar issue.
The ccls log says it is adding a workspace folder which is one level above my project root. I'm not sure how this can be fixed. The rootUri is correct(I give rootPatterns), but because of the incorrect workspace path, the whole thing doesn't work.

12:51:28 ccls initialize.cc:340 I add workspace folder <one_level_above>

If you want a workaround for that, I have that exact same problem. I think it is because it finds a git-folder in the folder above. If I create an empty folder named .git in the correct path everything works again.

I want it to use my compilation_commands.json as a rootmarker, which i think used to work. But now it seems like the git folder has a higher priority. I first noticed the problem after the
change to use "rootPatterns" instead of g:rooter_patterns, and I haven't been able to configure it to work again.

@chemzqm
Copy link
Member

chemzqm commented Jan 17, 2019

I've changed client to send current workspaceFolder (resolved form coc.preferences.rootPatterns) as only workspaceFolders on language server initialize.

The rootPatterns in server configuration is used for resolve rootPath and rootUri on server initialize.

@aravind2612krishna
Copy link

I had given compile_commands.json as a rootpattern and it failed to change the workspace path. In addition, it didn't load the compile_commands.json.
I had to remove the line
"rootPatterns": ["compile_commands.json"],
for it to load the file and I had to create a dummy .git folder as @ripperapid suggested for it to set the correct workspace path. I hope this is useful for debug.

@chemzqm chemzqm added the enhancement New feature or request label Jan 25, 2019
@oblitum
Copy link
Member

oblitum commented Feb 4, 2019

It's worth noticing that there's missing "compile_commands.json" as rootPattern at the start of this discussion, it's important, and the wiki should be taken as reference. Later on, it was mentioned by those that chimed in.

It would be weird that ".git/" takes priority over "compile_commands.json" if ".git/" comes latter in the rootPatterns list. Personally I can't reproduce that, I just tried a project dir with "compile_commands.json" and coc.nvim + ccls worked fine recognizing it, even when this project is deep in the parent git repo of my dotfiles.

I didn't try the relative path issue.

I'd just like to comment, the wiki is good reference for good defaults for rootPatterns, and you frequently may also avoid a clang database and simply use flags per dir like .ccls, compile_flags.txt, etc. Also, that the compilation database, as mentioned, worked for clangd but not for ccls, seems to point that it could be a LSP server misconfiguration, instead of coc to blame.

@wbthomason
Copy link

@oblitum With coc.nvim + ccls configured exactly as given in the wiki, I'm seeing the same exact bug as reported by @aravind2612krishna and @ripperapid, and fixed by the exact same workaround (add a dummy .git in my desired root and remove compile_commands.json from the rootPatterns list.

@oblitum
Copy link
Member

oblitum commented Feb 6, 2019

@wbthomason I can't reproduce this, I use compile_commands.json without problems..

@oblitum
Copy link
Member

oblitum commented Feb 6, 2019

@wbthomason did you actually copy the compile_commands.json from the build directory where it's generated to the root one?

@wbthomason
Copy link

@oblitum Yup, I tried that, as well as keeping it in build/ with the appropriate initializationOption set for ccls (specifically, "compilationDatabaseDirectory": "build"). Neither works. Running mkdir .git in my desired root (the same directory I'd copied compile_commands.json to) does work.

I have, however, just tried reintroducing compile_commands.json to my configured rootPatterns and found that everything still works (with .git in place). As soon as I delete .git from the root, the problem reappears.

@wbthomason
Copy link

I'll also note that my unchanged setup worked previously with LanguageClient-Neovim without any further configuration of ccls, so I don't think the problem is with my workspace configuration?

@oblitum
Copy link
Member

oblitum commented Feb 7, 2019

Can't reproduce this, I just copied a project to /tmp, removed the ./.git, and now I don't even have any far parent root with a .git dir, it's simply a plain CMake project directory on /tmp/foo, without any git involved, I got there and run CMake and copied the generated database in the build directory to the project folder, and I opened a c++ source in the project folder, and it's simply following the flags from the compilation database for the file, no issues...

@oblitum
Copy link
Member

oblitum commented Feb 7, 2019

I do my configuration from .vimrc, but I guess that doesn't affect anything, it's similar to the wiki.

@wbthomason
Copy link

wbthomason commented Feb 7, 2019

Indeed, trying your configuration in my .vimrc does not change anything. Interestingly, when I try the same test you did (in my case, making a fresh Meson project in a temp dir), I also cannot reproduce the issue. It's only there with my more complex project.

EDIT: I spoke too soon. By adding a layer of nesting in the directories, I can reproduce the issue.

@oblitum
Copy link
Member

oblitum commented Feb 7, 2019

I'll also note that my unchanged setup worked previously with LanguageClient-Neovim without any further configuration of ccls, so I don't think the problem is with my workspace configuration?

Not sure how you see that, the LSP clients are completely different, and each is configured in their own way. That one client is configured correctly doesn't imply the other is.

@oblitum
Copy link
Member

oblitum commented Feb 7, 2019

It's only there with my more complex project.

Well, so I guess that's what needs to be clarified.

@wbthomason
Copy link

wbthomason commented Feb 7, 2019

coc_ccls_bug_example.tar.gz
If you unzip that tarball, you can look at what I used to reproduce the issue with a dead-simple project. There's a .git directory in the top-level (coctest), then the project root itself is in coctest/example/barfoo with a compile_commands.json. Opening example.cc with the minimal coc.nvim configuration given in the README and the ccls + coc.nvim configuration given in the wiki results in ccls being unable to find the file example.hh. When example.cc is opened with LCN and ccls, example.hh is found.

This directory structure mimics my more complex project.

@oblitum
Copy link
Member

oblitum commented Feb 7, 2019

Indeed I was simply unable to get the include recognized. I've even simplified compile_commands.json to the most basic level, using absolute paths:

[
  {
    "directory": "/tmp/coctest/example/barfoo",
    "command": "c++ -I/tmp/coctest/example/barfoo/foobar/include -std=c++17 -c example.cc",
    "file": "example.cc"
  }
]

Even then, cd /tmp/coctest/example/barfoo/, nvim example.cc and the issue is still there. While still on /tmp/coctest/example/barfoo/, touch .git, nvim example.cc, and the issue is gone.

The above simplified compile_commands.json lies on /tmp/coctest/example/barfoo/.

@oblitum
Copy link
Member

oblitum commented Feb 7, 2019

I think that makes things a lot simpler to understand, and it's some very basic issue, still no sure whether it's coc or ccls to blame, but compile_commands.json is not being as helpful as .git for looking up include paths somehow.

@oblitum
Copy link
Member

oblitum commented Feb 7, 2019

Funny, I did touch .git, so it's a file :D

@oblitum
Copy link
Member

oblitum commented Feb 12, 2019

ping @chemzqm. Given the above resolution, do you still think this is a matter of more complex workspaceFolder support to fix it? It looked like a simpler bug for me.

@siddharth99
Copy link

siddharth99 commented Mar 4, 2019

I am facing a similar issue; any help or workaround would be great. My coc-config file is as listed below; the code directory consists of multiple nested git repositories.

{
  "timeout": 1000,
  "hoverTarget": "echo",
  "rootPatterns": [".ccls-root"],
  "languageserver": {
    "ccls": {
      "command": "ccls",
      "args": ["--log-file=/tmp/ccls_coc.log"],
      "trace.server": "verbose",
      "filetypes": ["c", "cpp", "objc", "objcpp"],
      "rootPatterns": [".ccls-root"],
      "initializationOptions": {
        "cacheDirectory": "/tmp/ccls_coc",
        "compilationDatabaseDirectory": "/home/code",
        "index": {"threads": 4},
        "clang": {"resourceDir": "/x/clang60/lib/clang/6.0.1"},
        "completion": {"filterAndSort": true}
      }
    }
  }
}

I created a file /home/code/.ccls-root
If I open a file /home/code/repo1/folder1/main.cpp the workspace directory in ccls log is set as /home/code/repo1 (which contains a .git file but I removed .git from rootPatterns).

I tried setting rootPatterns to compile_commands.json, .ccls-root (touch .ccls-root) but none of them are able to set the workspace-directory in ccls correctly. I am just dealing with 1 large code-base so don't really indend to use multiple workspaces for now.

Just to confirm the problem the async linting is working file but none of the goto definition, implementation type things are working.

LanguageClient-neovim doesn't have support for workspace directories (afaik) and it was able to find the LC root directory correctly probably just using compile_commands.json since I didn't have to specify anything on it. Here, I also need to specify compile_commands.json manually; I would very much like to switch to coc.nvim since it works better than languageclient-neovim which seems to get stuck ever so often for me.

@chemzqm
Copy link
Member

chemzqm commented Mar 4, 2019

  "timeout": 1000,
  "hoverTarget": "echo",
  "rootPatterns": [".ccls-root"],

Those configurations're not supported, install coc-json to get completion and validation support.

@siddharth99
Copy link

Thanks! It works after using "coc.preferences.rootPatterns"; sorry for the dumb question; I was earlier using in-line config from my .vimrc so missed the prefixes when I tried coc config.

@oblitum
Copy link
Member

oblitum commented Mar 8, 2019

I think I'm hitting something related to this issue more explicitly now when trying purescript-language-server. If I open a file with nvim src/Main.purs, I get errors because cwd and root path are resolved badly to <cwd>/src, not <cwd>. If I just open nvim and then :e src/Main.purs, I get no errors. I can avoid the issue if I touch .git. I've used spago to create an empty project and I have 'rootPatterns': ['bower.json', 'psc-package.json', 'spago.dhall'].

  if executable('purescript-language-server')
    let languageservers['purescript'] = {
    \   'command': 'purescript-language-server',
    \   'args': ['--stdio'],
    \   'filetypes': ['purescript'],
    \   'rootPatterns': ['bower.json', 'psc-package.json', 'spago.dhall']
    \ }
  endif

I don't understand why touch .git makes any difference since I don't use it as rootPatterns.

@oblitum
Copy link
Member

oblitum commented Mar 8, 2019

On nvim src/Main.purs, from :CocInfo I get

Starting with cwd: /home/francisco/samples/purescript/src and using root path: /home/francisco/samples/purescript/src

If I just run nvim and then :e src/Main.purs OR if I touch .git to run nvim src/Main.purs I get

Starting with cwd: /home/francisco/samples/purescript and using root path: /home/francisco/samples/purescript

@oblitum
Copy link
Member

oblitum commented Mar 8, 2019

I don't understand why touch .git makes any difference since I don't use it as rootPatterns.

Does setting 'rootPatterns' actually extend instead of overriding the default 'rootPatterns' (['.vim/', '.git/', '.hg/', '.projections.json'])? If so, I think docs could make that clear.

@chemzqm
Copy link
Member

chemzqm commented Mar 8, 2019

It's not, please provide verbose output from language server.

@oblitum
Copy link
Member

oblitum commented Mar 8, 2019

## versions

vim version: NVIM v0.3.4
node version: v11.10.1
coc.nvim version: 0.0.58
term: tmux-256color
platform: linux

## Error messages

## Output channel: languageserver.purescript
[Trace - 6:32:56 AM] Sending request 'initialize - (0)'.
Params: {
    "processId": 1660,
    "rootPath": "/home/francisco/Projects/samples/purescript",
    "rootUri": "file:///home/francisco/Projects/samples/purescript",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional"
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "definition": {
                "dynamicRegistration": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "codeAction": {
                "dynamicRegistration": true,
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true
            },
            "documentLink": {
                "dynamicRegistration": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "declaration": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            }
        }
    },
    "initializationOptions": {},
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///home/francisco/Projects/samples/purescript/src",
            "name": "src"
        }
    ]
}


[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "PureScript Language Server started"
}


PureScript Language Server started
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "{\"processId\":1660,\"rootPath\":\"/home/francisco/Projects/samples/purescript\",\"rootUri\":\"file:///home/francisco/Projects/samples/purescript\",\"capabilities\":{\"workspace\":{\"applyEdit\":true,\"workspaceEdit\":{\"documentChanges\":true,\"resourceOperations\":[\"create\",\"rename\",\"delete\"],\"failureHandling\":\"textOnlyTransactional\"},\"didChangeConfiguration\":{\"dynamicRegistration\":true},\"didChangeWatchedFiles\":{\"dynamicRegistration\":true},\"symbol\":{\"dynamicRegistration\":true,\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},\"executeCommand\":{\"dynamicRegistration\":true},\"configuration\":true,\"workspaceFolders\":true},\"textDocument\":{\"publishDiagnostics\":{\"relatedInformation\":true},\"synchronization\":{\"dynamicRegistration\":true,\"willSave\":true,\"willSaveWaitUntil\":true,\"didSave\":true},\"completion\":{\"dynamicRegistration\":true,\"contextSupport\":true,\"completionItem\":{\"snippetSupport\":true,\"commitCharactersSupport\":true,\"documentationFormat\":[\"markdown\",\"plaintext\"],\"deprecatedSupport\":true,\"preselectSupport\":true},\"completionItemKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},\"hover\":{\"dynamicRegistration\":true,\"contentFormat\":[\"markdown\",\"plaintext\"]},\"signatureHelp\":{\"dynamicRegistration\":true,\"signatureInformation\":{\"documentationFormat\":[\"markdown\",\"plaintext\"],\"parameterInformation\":{\"labelOffsetSupport\":true}}},\"definition\":{\"dynamicRegistration\":true},\"references\":{\"dynamicRegistration\":true},\"documentHighlight\":{\"dynamicRegistration\":true},\"documentSymbol\":{\"dynamicRegistration\":true,\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},\"codeAction\":{\"dynamicRegistration\":true,\"codeActionLiteralSupport\":{\"codeActionKind\":{\"valueSet\":[\"\",\"quickfix\",\"refactor\",\"refactor.extract\",\"refactor.inline\",\"refactor.rewrite\",\"source\",\"source.organizeImports\"]}}},\"codeLens\":{\"dynamicRegistration\":true},\"formatting\":{\"dynamicRegistration\":true},\"rangeFormatting\":{\"dynamicRegistration\":true},\"onTypeFormatting\":{\"dynamicRegistration\":true},\"rename\":{\"dynamicRegistration\":true,\"prepareSupport\":true},\"documentLink\":{\"dynamicRegistration\":true},\"typeDefinition\":{\"dynamicRegistration\":true},\"implementation\":{\"dynamicRegistration\":true},\"declaration\":{\"dynamicRegistration\":true},\"colorProvider\":{\"dynamicRegistration\":true},\"foldingRange\":{\"dynamicRegistration\":true,\"rangeLimit\":5000,\"lineFoldingOnly\":true}}},\"initializationOptions\":{},\"trace\":\"verbose\",\"workspaceFolders\":[{\"uri\":\"file:///home/francisco/Projects/samples/purescript/src\",\"name\":\"src\"}]}"
}


[Info  - 6:32:56 AM] {"processId":1660,"rootPath":"/home/francisco/Projects/samples/purescript","rootUri":"file:///home/francisco/Projects/samples/purescript","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"definition":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true},"declaration":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true}}},"initializationOptions":{},"trace":"verbose","workspaceFolders":[{"uri":"file:///home/francisco/Projects/samples/purescript/src","name":"src"}]}
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Starting with args: [\"/usr/bin/node\",\"/home/francisco/.yarn/bin/purescript-language-server\",\"--stdio\"]"
}


Starting with args: ["/usr/bin/node","/home/francisco/.yarn/bin/purescript-language-server","--stdio"]
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Starting with cwd: /home/francisco/Projects/samples/purescript/src and using root path: /home/francisco/Projects/samples/purescript/src"
}


Starting with cwd: /home/francisco/Projects/samples/purescript/src and using root path: /home/francisco/Projects/samples/purescript/src
[Trace - 6:32:56 AM] Received response 'initialize - (0)' in 158ms.
Result: {
    "capabilities": {
        "textDocumentSync": 1,
        "completionProvider": {
            "resolveProvider": false,
            "triggerCharacters": []
        },
        "hoverProvider": true,
        "definitionProvider": true,
        "workspaceSymbolProvider": true,
        "documentSymbolProvider": true,
        "codeActionProvider": true,
        "executeCommandProvider": {
            "commands": [
                "purescript.addCompletionImport",
                "purescript.caseSplit-explicit",
                "purescript.addClause-explicit",
                "purescript.replaceSuggestion",
                "purescript.build",
                "purescript.startPscIde",
                "purescript.stopPscIde",
                "purescript.restartPscIde",
                "purescript.typedHole-explicit",
                "purescript.replaceAllSuggestions",
                "purescript.fixTypo"
            ]
        },
        "referencesProvider": true
    }
}


[Trace - 6:32:56 AM] Sending notification 'initialized'.
Params: {}


[Trace - 6:32:56 AM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///home/francisco/Projects/samples/purescript/src/Main.purs",
        "languageId": "purescript",
        "version": 1,
        "text": "module Main where\n\nimport Prelude\n\nimport Effect (Effect)\nimport Effect.Console (log)\n\nmain :: Effect Unit\nmain = do\n  log \"🍝\"\n"
    }
}


[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 2,
    "message": "Proceeding with no config receieved"
}


[Warn  - 6:32:56 AM] Proceeding with no config receieved
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Starting IDE server"
}


[Info  - 6:32:56 AM] Starting IDE server
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Resolved IDE server paths (npm-bin: false) from PATH of /home/francisco/.local/bin:/home/francisco/.rbenv/shims:/home/francisco/.pyenv/plugins/pyenv-virtualenv/shims:/home/francisco/.pyenv/shims:/home/francisco/.go/bin:/home/francisco/.yarn/bin:/home/francisco/.rbenv/bin:/home/francisco/.gem/ruby/2.6.0/bin:/home/francisco/.pyenv/bin:/home/francisco/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/opt/android-ndk:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl (1st is used):"
}


[Info  - 6:32:56 AM] Resolved IDE server paths (npm-bin: false) from PATH of /home/francisco/.local/bin:/home/francisco/.rbenv/shims:/home/francisco/.pyenv/plugins/pyenv-virtualenv/shims:/home/francisco/.pyenv/shims:/home/francisco/.go/bin:/home/francisco/.yarn/bin:/home/francisco/.rbenv/bin:/home/francisco/.gem/ruby/2.6.0/bin:/home/francisco/.pyenv/bin:/home/francisco/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/opt/android-ndk:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl (1st is used):
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "/usr/bin/purs: 0.12.3\n"
}


[Info  - 6:32:56 AM] /usr/bin/purs: 0.12.3

[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "/bin/purs: 0.12.3\n"
}


[Info  - 6:32:56 AM] /bin/purs: 0.12.3

[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 2,
    "message": "Found multiple IDE server executables; using /usr/bin/purs"
}


[Warn  - 6:32:56 AM] Found multiple IDE server executables; using /usr/bin/purs
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Found existing port from file: 15852"
}


[Info  - 6:32:56 AM] Found existing port from file: 15852
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Starting IDE server on port 15846 with cwd /home/francisco/Projects/samples/purescript"
}


[Info  - 6:32:56 AM] Starting IDE server on port 15846 with cwd /home/francisco/Projects/samples/purescript
[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Started IDE server (port 15846)"
}


Started IDE server (port 15846)
[Trace - 6:32:56 AM] Received request 'window/showMessageRequest - (0)'.
Params: {
    "type": 1,
    "message": "It doesn't look like the workspace root is a PureScript project (has bower.json/psc-package.json/spago.dhall). The PureScript project should be opened as a root workspace folder.",
    "actions": []
}


[Trace - 6:32:56 AM] Sending response 'window/showMessageRequest - (0)'. Processing request took 3ms
No result returned.


[Trace - 6:32:56 AM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Output directory does not exist at 'output'"
}


[Info  - 6:32:56 AM] Output directory does not exist at 'output'
[Trace - 6:32:56 AM] Received request 'window/showMessageRequest - (1)'.
Params: {
    "type": 2,
    "message": "Output directory does not exist at 'output'. Ensure project is built, or check configuration of output directory and build command.",
    "actions": [
        {
            "title": "Build project"
        }
    ]
}


[Trace - 6:32:59 AM] Sending response 'window/showMessageRequest - (1)'. Processing request took 2934ms
No result returned.

@chemzqm
Copy link
Member

chemzqm commented Mar 8, 2019

rootPath and rootUri is expected, the problem is language server doesn't respect them, but use cwd of process instead.

@oblitum
Copy link
Member

oblitum commented Mar 8, 2019

Hmm, ok, thanks @chemzqm.

@oblitum
Copy link
Member

oblitum commented Mar 8, 2019

@chemzqm any explanation why touch .git fix the problem then? I think .git doesn't affect servers, just the client.

@chemzqm
Copy link
Member

chemzqm commented Mar 8, 2019

@chemzqm any explanation why touch .git fix the problem then? I think .git doesn't affect servers, just the client.

It affect workspaceFolders, I think I should pass workspaceFolders same as rootUri until there's real workspaceFolders support.

@chemzqm
Copy link
Member

chemzqm commented Mar 10, 2019

I just disabled workspaceFolders support in language-client, since it's not workspaceFolders should be.

@oblitum
Copy link
Member

oblitum commented Mar 10, 2019

@chemzqm ok, thanks. Sadly it produced no effect to that purescript server :-/, exactly same behavior (not working opening with nvim src/Main.purs, works with :e src/Main.purs or touch .git).

@chemzqm
Copy link
Member

chemzqm commented Mar 10, 2019

@oblitum verbose output from language server is needed,workspaceFolders should not exists in initialize request.

@oblitum
Copy link
Member

oblitum commented Mar 10, 2019

Here's the log, I couldn't find any tip how touch .git would affect behavior:

## versions

vim version: NVIM v0.3.4
node version: v11.11.0
coc.nvim version: 0.0.58
term: tmux-256color
platform: linux

## Error messages

## Output channel: languageserver.purescript
[Trace - 6:14:30 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 18145,
    "rootPath": "/home/francisco/Projects/samples/purescript",
    "rootUri": "file:///home/francisco/Projects/samples/purescript",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional"
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "definition": {
                "dynamicRegistration": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "codeAction": {
                "dynamicRegistration": true,
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true
            },
            "documentLink": {
                "dynamicRegistration": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "declaration": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            }
        }
    },
    "initializationOptions": {},
    "trace": "verbose"
}


[Trace - 6:14:30 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "PureScript Language Server started"
}


PureScript Language Server started
[Trace - 6:14:30 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "{\"processId\":18145,\"rootPath\":\"/home/francisco/Projects/samples/purescript\",\"rootUri\":\"file:///home/francisco/Projects/samples/purescript\",\"capabilities\":{\"workspace\":{\"applyEdit\":true,\"workspaceEdit\":{\"documentChanges\":true,\"resourceOperations\":[\"create\",\"rename\",\"delete\"],\"failureHandling\":\"textOnlyTransactional\"},\"didChangeConfiguration\":{\"dynamicRegistration\":true},\"didChangeWatchedFiles\":{\"dynamicRegistration\":true},\"symbol\":{\"dynamicRegistration\":true,\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},\"executeCommand\":{\"dynamicRegistration\":true},\"configuration\":true},\"textDocument\":{\"publishDiagnostics\":{\"relatedInformation\":true},\"synchronization\":{\"dynamicRegistration\":true,\"willSave\":true,\"willSaveWaitUntil\":true,\"didSave\":true},\"completion\":{\"dynamicRegistration\":true,\"contextSupport\":true,\"completionItem\":{\"snippetSupport\":true,\"commitCharactersSupport\":true,\"documentationFormat\":[\"markdown\",\"plaintext\"],\"deprecatedSupport\":true,\"preselectSupport\":true},\"completionItemKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},\"hover\":{\"dynamicRegistration\":true,\"contentFormat\":[\"markdown\",\"plaintext\"]},\"signatureHelp\":{\"dynamicRegistration\":true,\"signatureInformation\":{\"documentationFormat\":[\"markdown\",\"plaintext\"],\"parameterInformation\":{\"labelOffsetSupport\":true}}},\"definition\":{\"dynamicRegistration\":true},\"references\":{\"dynamicRegistration\":true},\"documentHighlight\":{\"dynamicRegistration\":true},\"documentSymbol\":{\"dynamicRegistration\":true,\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},\"codeAction\":{\"dynamicRegistration\":true,\"codeActionLiteralSupport\":{\"codeActionKind\":{\"valueSet\":[\"\",\"quickfix\",\"refactor\",\"refactor.extract\",\"refactor.inline\",\"refactor.rewrite\",\"source\",\"source.organizeImports\"]}}},\"codeLens\":{\"dynamicRegistration\":true},\"formatting\":{\"dynamicRegistration\":true},\"rangeFormatting\":{\"dynamicRegistration\":true},\"onTypeFormatting\":{\"dynamicRegistration\":true},\"rename\":{\"dynamicRegistration\":true,\"prepareSupport\":true},\"documentLink\":{\"dynamicRegistration\":true},\"typeDefinition\":{\"dynamicRegistration\":true},\"implementation\":{\"dynamicRegistration\":true},\"declaration\":{\"dynamicRegistration\":true},\"colorProvider\":{\"dynamicRegistration\":true},\"foldingRange\":{\"dynamicRegistration\":true,\"rangeLimit\":5000,\"lineFoldingOnly\":true}}},\"initializationOptions\":{},\"trace\":\"verbose\"}"
}


[Info  - 6:14:30 PM] {"processId":18145,"rootPath":"/home/francisco/Projects/samples/purescript","rootUri":"file:///home/francisco/Projects/samples/purescript","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"definition":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true},"declaration":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true}}},"initializationOptions":{},"trace":"verbose"}
[Trace - 6:14:30 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Starting with args: [\"/usr/bin/node\",\"/home/francisco/.yarn/bin/purescript-language-server\",\"--stdio\"]"
}


Starting with args: ["/usr/bin/node","/home/francisco/.yarn/bin/purescript-language-server","--stdio"]
[Trace - 6:14:30 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Starting with cwd: /home/francisco/Projects/samples/purescript/src and using root path: /home/francisco/Projects/samples/purescript/src"
}


Starting with cwd: /home/francisco/Projects/samples/purescript/src and using root path: /home/francisco/Projects/samples/purescript/src
[Trace - 6:14:30 PM] Received response 'initialize - (0)' in 152ms.
Result: {
    "capabilities": {
        "textDocumentSync": 1,
        "completionProvider": {
            "resolveProvider": false,
            "triggerCharacters": []
        },
        "hoverProvider": true,
        "definitionProvider": true,
        "workspaceSymbolProvider": true,
        "documentSymbolProvider": true,
        "codeActionProvider": true,
        "executeCommandProvider": {
            "commands": [
                "purescript.addCompletionImport",
                "purescript.caseSplit-explicit",
                "purescript.addClause-explicit",
                "purescript.replaceSuggestion",
                "purescript.build",
                "purescript.startPscIde",
                "purescript.stopPscIde",
                "purescript.restartPscIde",
                "purescript.typedHole-explicit",
                "purescript.replaceAllSuggestions",
                "purescript.fixTypo"
            ]
        },
        "referencesProvider": true
    }
}


[Trace - 6:14:30 PM] Sending notification 'initialized'.
Params: {}


[Trace - 6:14:30 PM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///home/francisco/Projects/samples/purescript/src/Main.purs",
        "languageId": "purescript",
        "version": 1,
        "text": "module Main where\n\nimport Prelude\n\nimport Effect (Effect)\nimport Effect.Console (log)\n\nmain ∷ Effect Unit\nmain = do\n  log \"hello\"\n"
    }
}


[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 2,
    "message": "Proceeding with no config receieved"
}


[Warn  - 6:14:31 PM] Proceeding with no config receieved
[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Starting IDE server"
}


[Info  - 6:14:31 PM] Starting IDE server
[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Resolved IDE server paths (npm-bin: false) from PATH of /home/francisco/.local/bin:/home/francisco/.rbenv/shims:/home/francisco/.pyenv/plugins/pyenv-virtualenv/shims:/home/francisco/.pyenv/shims:/home/francisco/.go/bin:/home/francisco/.yarn/bin:/home/francisco/.rbenv/bin:/home/francisco/.gem/ruby/2.6.0/bin:/home/francisco/.pyenv/bin:/home/francisco/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/opt/android-ndk:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl (1st is used):"
}


[Info  - 6:14:31 PM] Resolved IDE server paths (npm-bin: false) from PATH of /home/francisco/.local/bin:/home/francisco/.rbenv/shims:/home/francisco/.pyenv/plugins/pyenv-virtualenv/shims:/home/francisco/.pyenv/shims:/home/francisco/.go/bin:/home/francisco/.yarn/bin:/home/francisco/.rbenv/bin:/home/francisco/.gem/ruby/2.6.0/bin:/home/francisco/.pyenv/bin:/home/francisco/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/opt/android-ndk:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl (1st is used):
[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "/usr/bin/purs: 0.12.3\n"
}


[Info  - 6:14:31 PM] /usr/bin/purs: 0.12.3

[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "/bin/purs: 0.12.3\n"
}


[Info  - 6:14:31 PM] /bin/purs: 0.12.3

[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 2,
    "message": "Found multiple IDE server executables; using /usr/bin/purs"
}


[Warn  - 6:14:31 PM] Found multiple IDE server executables; using /usr/bin/purs
[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Found existing port from file: 15718"
}


[Info  - 6:14:31 PM] Found existing port from file: 15718
[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Starting IDE server on port 15641 with cwd /home/francisco/Projects/samples/purescript"
}


[Info  - 6:14:31 PM] Starting IDE server on port 15641 with cwd /home/francisco/Projects/samples/purescript
[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Started IDE server (port 15641)"
}


Started IDE server (port 15641)
[Trace - 6:14:31 PM] Received request 'window/showMessageRequest - (0)'.
Params: {
    "type": 1,
    "message": "It doesn't look like the workspace root is a PureScript project (has bower.json/psc-package.json/spago.dhall). The PureScript project should be opened as a root workspace folder.",
    "actions": []
}


[Trace - 6:14:31 PM] Sending response 'window/showMessageRequest - (0)'. Processing request took 1ms
No result returned.


[Trace - 6:14:31 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Output directory does not exist at 'output'"
}


[Info  - 6:14:31 PM] Output directory does not exist at 'output'
[Trace - 6:14:31 PM] Received request 'window/showMessageRequest - (1)'.
Params: {
    "type": 2,
    "message": "Output directory does not exist at 'output'. Ensure project is built, or check configuration of output directory and build command.",
    "actions": [
        {
            "title": "Build project"
        }
    ]
}


[Trace - 6:14:32 PM] Sending response 'window/showMessageRequest - (1)'. Processing request took 1435ms
No result returned.



## Output channel: prettier

@chemzqm
Copy link
Member

chemzqm commented Mar 10, 2019

"Output directory does not exist at 'output'" looks like it needs some additional configuration.

@oblitum
Copy link
Member

oblitum commented Mar 10, 2019

@chemzqm no no, this happened previously too, I just stripped it before because it's not important. It can't find the output directory because it's at ./output, not ./src/output, and it's taking ./src as root, which it should not, since rootPattern file is at ..

@chemzqm
Copy link
Member

chemzqm commented Mar 10, 2019

It requries workspaceFolders and configuration to work, an extension could help.

@oblitum
Copy link
Member

oblitum commented Mar 17, 2019

fyi: problem with purescript server got fixed in some of the latest commits 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants