Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .clangd

This file was deleted.

1 change: 0 additions & 1 deletion ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -45160,7 +45160,6 @@ ORIGIN: ../../../flutter/vulkan/vulkan_utilities.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/vulkan/vulkan_window.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/vulkan/vulkan_window.h + ../../../flutter/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../flutter/.clangd
FILE: ../../../flutter/.engine-release.version
FILE: ../../../flutter/.pylintrc
FILE: ../../../flutter/assets/asset_manager.cc
Expand Down
18 changes: 17 additions & 1 deletion tools/clangd_check/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,21 @@ void main(List<String> args) {
return;
}

// Run clangd.
final Engine engineRoot = Engine.findWithin(p.canonicalize(compileCommandsDir));
final io.File clangdConfig = io.File(p.join(engineRoot.flutterDir.path, '.clangd'));
try {
// Write a .clangd file to the engine root directory.
//
// See:
// - https://clangd.llvm.org/config#compileflags
// - https://github.com/clangd/clangd/issues/662
clangdConfig.writeAsStringSync(
'CompileFlags:\n'
' Add: -Wno-unknown-warning-option\n'
' Remove: [-m*, -f*]\n'
);

// Run clangd.
final io.ProcessResult result = io.Process.runSync(clangd, <String>[
'--compile-commands-dir',
compileCommandsDir,
Expand All @@ -128,5 +141,8 @@ void main(List<String> args) {
io.stderr.writeln('Failed to run clangd: $e');
io.stderr.writeln(const JsonEncoder.withIndent(' ').convert(entry));
io.exitCode = 1;
} finally {
// Remove the copied .clangd file from the engine root directory.
clangdConfig.deleteSync();
}
}