Skip to content

Commit d52e4d9

Browse files
author
Isaac
committed
Temp
1 parent 4f517ed commit d52e4d9

14 files changed

+555
-182
lines changed

‎.bazelrc‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,18 @@ build --strategy=SwiftCompile=worker
2222

2323
#common --registry=https://raw.githubusercontent.com/bazelbuild/bazel-central-registry/main/
2424

25+
# SourceKit BSP: Swift indexing features
26+
common --features=swift.index_while_building
27+
common --features=swift.use_global_index_store
28+
common --features=swift.use_global_module_cache
29+
common --features=oso_prefix_is_pwd
30+
31+
# SourceKit BSP: Index build config (used for background indexing)
32+
common:index_build --experimental_convenience_symlinks=ignore
33+
common:index_build --show_result=0
34+
common:index_build --noshow_loading_progress
35+
common:index_build --noshow_progress
36+
common:index_build --noannounce_rc
37+
common:index_build --noshow_timestamps
38+
common:index_build --curses=no
39+
common:index_build --color=no

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ Telegram.LSP.json
7676
spm-files
7777
xcode-files
7878
.bsp/**
79+
.sourcekit-lsp/**
7980
/.claude/
8081
/buildbox/*

‎.vscode/launch.json‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Debug Telegram",
5+
"type": "lldb-dap",
6+
"request": "attach",
7+
"preLaunchTask": "_launch_telegram",
8+
"debuggerRoot": "${workspaceFolder}",
9+
"attachCommands": [
10+
"command script import '${workspaceFolder}/scripts/lldb_attach.py'"
11+
],
12+
"terminateCommands": [
13+
"command script import '${workspaceFolder}/scripts/lldb_kill_app.py'"
14+
],
15+
"internalConsoleOptions": "openOnSessionStart",
16+
"timeout": 9999
17+
}
18+
]
19+
}

‎.vscode/settings.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
"search.exclude": {
1313
".git/**": true
1414
},
15-
"files.associations": {
16-
},
1715
"swift.sourcekit-lsp.backgroundIndexing": "on",
1816
"swift.sourcekit-lsp.trace.server": "messages",
1917
"terminal.integrated.profiles.osx": {
@@ -25,5 +23,5 @@
2523
]
2624
}
2725
},
28-
"swift.sourcekit-lsp.serverPath": "${workspace}/build-input/sourcekit-lsp"
26+
"swift.sourcekit-lsp.serverPath": "${workspaceFolder}/build-input/sourcekit-lsp"
2927
}

‎.vscode/tasks.json‎

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Select Simulator for Apple Development",
6+
"type": "shell",
7+
"command": "./scripts/select_simulator.sh",
8+
"presentation": {
9+
"reveal": "always",
10+
"focus": true,
11+
"panel": "dedicated"
12+
},
13+
"problemMatcher": []
14+
},
15+
{
16+
"label": "Build Telegram",
17+
"type": "shell",
18+
"command": "./scripts/lldb_build.sh",
19+
"options": {
20+
"env": {
21+
"BAZEL_LABEL_TO_RUN": "//Telegram:Telegram",
22+
"BAZEL_EXTRA_BUILD_FLAGS": ""
23+
}
24+
},
25+
"group": {
26+
"kind": "build"
27+
},
28+
"problemMatcher": [
29+
{
30+
"owner": "bazel",
31+
"source": "bazel",
32+
"fileLocation": [
33+
"relative",
34+
"${workspaceFolder}"
35+
],
36+
"pattern": {
37+
"regexp": "^(.+?):(\\d+):(\\d+):\\s+(error|warning|note):\\s+(.*)$",
38+
"file": 1,
39+
"line": 2,
40+
"column": 3,
41+
"severity": 4,
42+
"message": 5
43+
}
44+
}
45+
]
46+
},
47+
{
48+
"label": "_launch_telegram",
49+
"type": "shell",
50+
"command": "./scripts/lldb_launch_and_debug.sh",
51+
"options": {
52+
"env": {
53+
"BAZEL_LABEL_TO_RUN": "//Telegram:Telegram",
54+
"BAZEL_EXTRA_BUILD_FLAGS": "",
55+
"BAZEL_LAUNCH_ARGS": ""
56+
}
57+
},
58+
"presentation": {
59+
"reveal": "always"
60+
},
61+
"hide": true,
62+
"isBackground": true,
63+
"problemMatcher": [
64+
{
65+
"owner": "bazel",
66+
"source": "bazel",
67+
"fileLocation": [
68+
"relative",
69+
"${workspaceFolder}"
70+
],
71+
"pattern": {
72+
"regexp": "launcher_error in (.*): (.*)",
73+
"kind": "file",
74+
"file": 1,
75+
"message": 2
76+
},
77+
"background": {
78+
"activeOnStart": true,
79+
"beginsPattern": "^Starting launch task\\.\\.\\.$",
80+
"endsPattern": "^ph.telegra.Telegraph: .*"
81+
}
82+
},
83+
{
84+
"owner": "bazel",
85+
"source": "bazel",
86+
"fileLocation": [
87+
"relative",
88+
"${workspaceFolder}"
89+
],
90+
"pattern": {
91+
"regexp": "^(.+?):(\\d+):(\\d+):\\s+(error|warning|note):\\s+(.*)$",
92+
"file": 1,
93+
"line": 2,
94+
"column": 3,
95+
"severity": 4,
96+
"message": 5
97+
},
98+
"background": {
99+
"activeOnStart": true,
100+
"beginsPattern": "^Starting launch task\\.\\.\\.$",
101+
"endsPattern": "^ph.telegra.Telegraph: .*"
102+
}
103+
}
104+
],
105+
"runOptions": {
106+
"instanceLimit": 1
107+
}
108+
}
109+
]
110+
}

‎BUILD.bazel‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
load("@sourcekit_bazel_bsp//rules:setup_sourcekit_bsp.bzl", "setup_sourcekit_bsp")
22

33
setup_sourcekit_bsp(
4-
name = "setup_sourcekit_bsp_telegram_project",
4+
name = "setup_sourcekit_bsp",
55
bazel_wrapper = "./build-input/bazel-8.4.2-darwin-arm64",
66
files_to_watch = [
7-
"**/*.swift",
8-
"**/*.h",
9-
"**/*.m",
10-
"**/*.mm",
11-
"**/*.c",
12-
"**/*.cc",
13-
"**/*.cpp",
14-
"**/*.hpp",
7+
"Telegram/**/*.swift",
8+
"Telegram/**/*.h",
9+
"Telegram/**/*.m",
10+
"Telegram/**/*.mm",
11+
"Telegram/**/*.c",
12+
"Telegram/**/*.cpp",
13+
"submodules/**/*.swift",
14+
"submodules/**/*.h",
15+
"submodules/**/*.m",
16+
"submodules/**/*.mm",
17+
"submodules/**/*.c",
18+
"submodules/**/*.cpp",
19+
],
20+
aquery_flags = [
21+
"define=telegramVersion=12.5",
22+
"define=buildNumber=100000",
1523
],
1624
index_flags = [
1725
"config=index_build",
26+
"define=telegramVersion=12.5",
27+
"define=buildNumber=100000",
1828
],
29+
index_build_batch_size = 10,
1930
targets = [
2031
"//Telegram:Telegram",
2132
],
33+
merge_lsp_config = False,
2234
)

0 commit comments

Comments
 (0)