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

Allow relative path for directory #704

Closed
wants to merge 4 commits into from
Closed

Allow relative path for directory #704

wants to merge 4 commits into from

Conversation

rohit04saluja
Copy link

directory in compiler_commands.json
If the value is relative we resolve it from the root

This will help in VS Code integration. We open the root folder in VS Code and the directory value can be specified as related to the root folder. Thus the compile_commnads.json can be committed to the code repository rather than having to build it every time code is pulled.

@rohit04saluja
Copy link
Author

rohit04saluja commented Oct 6, 2020

Linked issue: directory value as relative path in compile_commands.json #703

@MaskRay
Copy link
Owner

MaskRay commented Oct 6, 2020

Currently realPath resolves the "directory" value relative to the current working directory. Is current working directory unchanged in VSCode?

@rohit04saluja
Copy link
Author

Assuming that the current working directory refers to the workspace directory. I tried all possible combinations but it didn't work.

In CCLS logs, I can see that the files are resolved with relative paths only.
With this fix, it's resolved properly

@rohit04saluja
Copy link
Author

Hi @MaskRay did you get time to check this?

@MaskRay
Copy link
Owner

MaskRay commented Oct 25, 2020

I believe the problem is that your client does not chdir to the project root. Which client do you use?

@rohit04saluja
Copy link
Author

I use VSCode

@rohit04saluja
Copy link
Author

You were right @MaskRay . VSCode does not chdir to the project root It's always pointing to my home directory.

But since ccls is given a project path to initialize, won't be it good to chdir to the project path during initialization?

@rohit04saluja
Copy link
Author

Need to be looked into from another angle

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.

None yet

2 participants