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

[server] support getting compile commands for header files #74

Open
github-actions bot opened this issue Jun 16, 2022 · 1 comment
Open

[server] support getting compile commands for header files #74

github-actions bot opened this issue Jun 16, 2022 · 1 comment
Labels
Milestone

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Jun 16, 2022

/// TODO(server): support getting compile commands for header files

#[cfg(feature = "server")]
impl State {
    /// Get [`CompilationDatabase`] for a .compile file path.
    /// TODO(server): support getting compile commands for header files
    pub fn compile_commands(&mut self, compile_filepath: &Path) -> Result<&XCCompilationDatabase> {
        tracing::debug!("Getting compile commands");
        if self.compile_commands.contains_key(compile_filepath) {
            tracing::debug!("Using Cached compile database");
            self.compile_commands.get(compile_filepath)
        } else {
            tracing::debug!("Reading from {compile_filepath:?}");
            XCCompilationDatabase::try_from_filepath(compile_filepath)?
                .pipe(|cmds| self.compile_commands.insert(compile_filepath.into(), cmds))
                .pipe(|_| self.compile_commands.get(compile_filepath))
        }
@github-actions
Copy link
Contributor Author

Closed in 3c53d44

@kkharji kkharji reopened this Jun 17, 2022
@kkharji kkharji added this to the 0.5 milestone Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant