Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 46999ca

Browse filesBrowse files
author
Akos Kitta
committed
Forward the compilation database path to the LS.
Tha path to the compilation database is optional. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent a6a24ca commit 46999ca
Copy full SHA for 46999ca

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed

‎src/extension.ts

Copy file name to clipboardExpand all lines: src/extension.ts
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ interface LanguageServerConfig {
77
readonly lsPath: string;
88
readonly cliPath: string;
99
readonly clangdPath: string;
10+
/**
11+
* Filesystem path pointing to the folder that contains the `compile_commands.json` file.
12+
*/
13+
readonly compileCommandsPath?: string;
1014
readonly board: {
1115
readonly fqbn: string;
1216
readonly name?: string;
@@ -55,11 +59,14 @@ function buildLanguageClient(config: LanguageServerConfig): LanguageClient {
5559
if (!serverTraceChannel) {
5660
serverTraceChannel = vscode.window.createOutputChannel('Arduino Language Server (trace)');
5761
}
58-
const { lsPath: command, clangdPath, cliPath, board, flags, env } = config;
62+
const { lsPath: command, clangdPath, cliPath, board, flags, env, compileCommandsPath } = config;
5963
const args = ['-clangd', clangdPath, '-cli', cliPath, '-fqbn', board.fqbn];
6064
if (board.name) {
6165
args.push('-board-name', board.name);
6266
}
67+
if (compileCommandsPath) {
68+
args.push('-compile-commands-dir', compileCommandsPath);
69+
}
6370
if (flags && flags.length) {
6471
args.push(...flags);
6572
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.