aboutsummaryrefslogtreecommitdiffstats
path: root/.ycm_extra_conf.py
blob: fe5fc5c570bd4c8dcb666741874d6078ad8080b1 (plain) (blame)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python


# def getClassPath() -> list:
#     import subprocess
#     import sys

#     proj_root = sys.argv[0][0 : sys.argv[0].rfind("/")]
#     CMD = [proj_root + "/gradlew", "properties"]
#     cp = subprocess.run(CMD, capture_output=True)
#     lines = cp.stdout.decode("utf-8").split("\n")
#     for line in lines:
#         if line.find("ClassPath") > 0:
#             bin = line.find("bin") + 2
#             bin_beg = line.find("[", bin)
#             bin_end = line.find("]", bin_beg)
#             src = line.find("src") + 2
#             src_beg = line.find("[", src)
#             src_end = line.find("]", src_beg)
#             # print(line[bin_beg + 1 : bin_end])
#             # print(line[src_beg + 1 : src_end])
#             return [line[bin_beg + 1 : bin_end], line[src_beg + 1 : src_end]]


# paths = getClassPath()
# print(paths)


def Settings(**kwargs):
    if kwargs["language"] == "java":
        return {
            "ls": {
                "java.import.gradle.enabled": True,
                "java.import.gradle.offline.enabled": True,
                "java.import.gradle.wrapper.enabled": True,
                "java.maven.downloadSources": True,
                "java.import.maven.enabled": True,
                "java.signatureHelp.enabled": True,
                "java.rename.enabled": True,
                "java.eclipse.downloadSources": True,
                "java.project.sourcePaths": "/home/devi/.gradle/caches/modules-2/files-2.1",
                "extendedClientCapabilities": {
                    "classFileContentsSupport": True
                },
            }
        }