8000
Skip to content

Implement initialization option compilationDatabaseCommand on Windows#220

Merged
MaskRay merged 1 commit intomasterfrom
compilationDatabaseCommand
Jan 22, 2019
Merged

Implement initialization option compilationDatabaseCommand on Windows#220
MaskRay merged 1 commit intomasterfrom
compilationDatabaseCommand

Conversation

@MaskRay
Copy link
Copy Markdown
Owner
@MaskRay MaskRay commented Jan 21, 2019

Fix #217

@Gei0r @Riatre @Yanpas

I don't have a Windows so...

To test compilationDatabaseCommand on POSIX, mkdir /tmp/c; cd /tmp/c; git init

initialization options:

{
        "compilationDatabaseCommand": "/tmp/c/x"
}

/tmp/c/x:

#!/bin/zsh
print '[{"arguments":["c++","-c","-o","a","a.cc"],"directory":"/tmp/c","file":"a.cc"}]'

@MaskRay MaskRay force-pushed the compilationDatabaseCommand branch 2 times, most recently from f7544ed to 0a028c7 Compare January 21, 2019 04:51
@Gei0r
Copy link
Copy Markdown
Gei0r commented Jan 21, 2019

Thank you, I will check when I get home from work in about 9 hours.

@MaskRay MaskRay force-pushed the compilationDatabaseCommand branch from 0a028c7 to 61f859f Compare January 21, 2019 08:17
@MaskRay MaskRay force-pushed the compilationDatabaseCommand branch from 61f859f to a4893db Compare January 21, 2019 12:48
@Gei0r
Copy link
Copy Markdown
Gei0r commented Jan 21, 2019

I get the following error in emacs *Messages*:

LSP :: Connected to [ccls:7708 status:starting].
error in process filter: lsp--send-no-wait: Writing to process: Invalid argument, ccls
error in process filter: Writing to process: Invalid argument, ccls
LSP :: ccls has exited (exited abnormally with code 127)
Server ccls:7708 exited with status exit. Do you want to restart it? (y or n) n

Log file:

18:57:45                initialize.cc:278 I initialize in directory D:/Adrian/ccls/testproj2/ with uri file:///d:/Adrian/ccls/testproj2/
18:57:45                initialize.cc:301 I initializationOptions: {"compilationDatabaseCommand":"node D:/Adrian/cquery-Hackbrett/src/justLog.js","compilationDatabaseDirectory":"","cacheDirectory":".ccls-cache","cacheFormat":"binary","clang":{"excludeArgs":[],"extraArgs":[],"pathMappings":[],"resourceDir":""},"client":{"hierarchicalDocumentSymbolSupport":true,"linkSupport":true,"snippetSupport":true},"codeLens":{"localVariables":true},"completion":{"caseSensitivity":2,"detailedLabel":true,"dropOldRequests":true,"duplicateOptional":true,"filterAndSort":true,"include":{"blacklist":[],"maxPathSize":30,"suffixWhitelist":[".h",".hpp",".hh",".inc"],"whitelist":[]},"maxNum":100},"diagnostics":{"blacklist":[],"onChange":1000,"onOpen":0,"onSave":0,"spellChecking":true,"whitelist":[]},"highlight":{"largeFileSize":2097152,"lsRanges":false,"blacklist":[],"whitelist":[]},"index":{"blacklist":[],"comments":2,"initialBlacklist":[],"initialWhitelist":[],"multiVersion":0,"multiVersionBlacklist":[],"multiVersionWhitelist":[],"onChange":false,"threads":0,"trackDependency":2,"whitelist":[]},"request":{"timeout":5000},"session":{"maxNum":10},"workspaceSymbol":{"caseSensitivity":1,"maxNum":1000,"sort":true},"xref":{"maxNum":2000}}
18:57:45                initialize.cc:328 I use -resource-dir=C:\msys64\mingw64\lib\clang\7.0.1
18:57:45                   project.cc:355 E failed to load D:/Adrian/ccls/testproj2/ program not executable

So apparently ccls is trying to execute the project dir.

@Gei0r
Copy link
Copy Markdown
Gei0r commented Jan 21, 2019

OK it's just the the error message that's confusing: It doesn't try to execute the project root as a program.
The problem is that I used a program with an argument as compilationDatabaseCommand (node D:/...).

It does work when I replace it with a bat file:

@echo off
node %~dp0\justLog.js %*

So 👍 from me!

@MaskRay MaskRay force-pushed the compilationDatabaseCommand branch from a4893db to d385f74 Compare January 22, 2019 01:00
@MaskRay MaskRay merged commit d385f74 into master Jan 22, 2019
@MaskRay MaskRay deleted the compilationDatabaseCommand branch January 22, 2019 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0